Created
January 24, 2019 23:38
-
-
Save jawardell/d1aef2ccbbb90fa9818e239b1d9b2a18 to your computer and use it in GitHub Desktop.
bash commands
This file contains hidden or 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
#recursively format print all files using awk | |
ls -R | awk ' /:$/&&f{s=$0;f=0} /:$/&&!f{sub(/:$/,"");s=$0;f=1;next} NF&&f{ print s"/"$0 }' | |
#recursively show the size of files in MegaBytes | |
ls -Rl --block-size=M | |
#list files recursively along with their size in bytes | |
find . -type f -exec du -ab {} + | sort -n -r | less | |
#move executables to a folder called ./executables/ | |
for f in *; do | |
if [ -f "$f" ] && [ -x "$f" ]; then | |
mv "$f" executables/ | |
fi | |
done | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment