Files

Updated: 2018-05-29

Remove

Mac OS X empty trash

$ sudo rm -rf ~/.Trash/*

ln

$ sudo ln -s <source_path> <target_path>


$ ln -s 0.1.0-SNAPSHOT/ snapshot
$ ls -l
... snapshot -> 0.1.0-SNAPSHOT/

Global Search And Replacement

find / -name game

find . -type f -name '*.txt' -exec sed -i '' s/this/that/g {} +

List the largest files/directories

If you want to find and print the top 10 largest files names (not directories) in a particular directory and its sub directories

$ find . -printf '%s %p\n'|sort -nr|head

To restrict the search to the present directory use "-maxdepth 1" with find.

$ find . -maxdepth 1 -printf '%s %p\n'|sort -nr|head

print the top 10 largest "files and directories":

$ du -a . | sort -nr | head