Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #gzip
- gzip file.txt // this replaces file.txt with file.txt.gz
- gzip -d file.txt.gz // this replaces file.txt.gz with file.txt
- #recursive directory size
- du -hs directory
- #find 10 biggest in directory tree
- find . -ls | sort -rn +6 -7 | head -10
- #remove empty directories
- find -depth -type d -empty -exec rmdir {} \;
- #do something in every dir
- for file in *; do
- if [ -d $file ]; then
- echo $file
- mkdir -p -v $file/src/{test,main}/java/com/practicalunittesting;
- fi
- done
- #filename with current date / timestamp
- cp file.txt whatever_`date +"%Y%m%d_%H%M"`.txt
- #recover from dump
- psql -h my.db.server -U userName -d dbName < sql_dump.sql
Advertisement
Add Comment
Please, Sign In to add comment