Skip to content

Instantly share code, notes, and snippets.

@ksharsha
Created April 7, 2017 07:27
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 ksharsha/7a52efe4ad950128baf6c434418a05f3 to your computer and use it in GitHub Desktop.
Save ksharsha/7a52efe4ad950128baf6c434418a05f3 to your computer and use it in GitHub Desktop.
Some common commands which males our life simpler
echo */ | wc --> Count the number of directories in a folder
for f in *\ *; do mv "$f" "${f// /_}"; done --> replace spaces in folder names, not recursive
for f in model/* ; do mv "$f" `echo "$f" | sed 's/_//g'` ; done --> Remove underscores from the file names
./sout.py 2>&1 | tee test.txt --> To print the logs to the terminal as well as save them to a text file
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment