Last active
November 13, 2016 17:10
-
-
Save gotofritz/5232223 to your computer and use it in GitHub Desktop.
various bash find command
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#sort files by number of lines | |
find /path/to/folder -name '*.js' | xargs wc -l | sort |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#find files inside archive | |
find /dir/ -iname archive.tar -print0 | xargs -0 tar t -f | grep "filename you are searching for" | |
find /dir/ -iname archive.zip -print0 | xargs -0 unzip -l | grep "filename you are searching for" | |
find /dir/ -iname archive.rar -print0 | xargs -0 unrar l | grep "filename you are searching for" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#list files that were changed in the last day, sorted by size | |
sudo find / -type f -mtime -1 -print0 | xargs -0 du -sk | sort -nr |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment