Skip to content

Instantly share code, notes, and snippets.

@timkellogg
Last active August 29, 2015 14:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save timkellogg/d1920c8ef68af21d7e17 to your computer and use it in GitHub Desktop.
Save timkellogg/d1920c8ef68af21d7e17 to your computer and use it in GitHub Desktop.
Useful Shell Commands
Find size of Rails app files in order
$ clear && ls -lr | awk '{ print $5 "--" $9 }' | sort -gr
Sample Output:
5563--Gemfile.lock
1814--Guardfile
821--Gemfile
408--config
306--testss
272--app
255--README.md
249--Rakefile
238--public
238--db
238--bin
204--tmp
170--log
153--config.ru
136--lib
102--vendor
40--Procfile
In Mac (have to install via homebrew)
$ tree -Is *.cache
Sample Output (is a tree of subdirectories)
Find out last write time files in current dir
$ ls -lr | awk '{ print $6,$8 }' | sort -r
Sample output:
Apr 22:15
Apr 18:14
Apr 14:39
Apr 14:32
Apr 14:26
Apr 12:13
Apr 12:13
Apr 12:13
Apr 12:13
Apr 12:13
Apr 12:13
Apr 12:13
Apr 11:46
Apr 11:44
Apr 11:42
Apr 11:39
Apr 11:10
Apr 11:09
@timkellogg
Copy link
Author

Will keep updating as I make use of Shell commands

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment