Skip to content

Instantly share code, notes, and snippets.

@j-manu
Created January 7, 2011 10:58
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 j-manu/769355 to your computer and use it in GitHub Desktop.
Save j-manu/769355 to your computer and use it in GitHub Desktop.
Bash Tips
# extract only the filename without extension
for i in *.xhtml
do
filename=$(basename $i});
extension=${filename##*.};
filename=${filename%.*};
wkhtmltopdf -O landscape -s A3 $i $filename'.pdf';
done
---
#Delete large number of files:
ls|xargs -L 1000 rm
--
# remove all files older than 7 days
find /path/to/directory* -mtime +7 -exec rm {} \;
# remove all *.py files younger than 30 minutes
find /path/to/directory* -name '*.py' -mmin -30 -exec rm {} \;
--
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment