Linux snippets

Just a small, unsorted collection of Linux commandline snippets. Just for myself mostly.

list files and dirs sorted by size

du -cks * |sort -g

list dirs sorted by size

du -cks `find . -maxdepth 2 -type d `|sort -g

find a dir

find -name "images" | less

find file

find -name "file.py" | less

find text in file by dir

grep -r ohohoh /var/some/path/dir/