Skip to content

Instantly share code, notes, and snippets.

@kargaranamir
Created May 22, 2023 18:15
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 kargaranamir/218b433fa08df3c43e2046f8c9f9d2d3 to your computer and use it in GitHub Desktop.
Save kargaranamir/218b433fa08df3c43e2046f8c9f9d2d3 to your computer and use it in GitHub Desktop.
common commands
# remove empty folders in the current directory.
find . -type d -empty -delete
# flat folder in. folder
find . -type f -exec mv -i {} . \;
# delete other files that doesnot match:
find . ! -name "*-sentences.txt" -type f -delete
# grep over not txt:
ls -p | grep -v txt
# extract all tar files:
find path -name "*.tar.gz" -exec tar -xvf {} -C path \;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment