Skip to content

Instantly share code, notes, and snippets.

@PSJoshi
Last active August 29, 2015 14:14
Show Gist options
  • Save PSJoshi/388f475634a316acf09d to your computer and use it in GitHub Desktop.
Save PSJoshi/388f475634a316acf09d to your computer and use it in GitHub Desktop.
Linux tips
How to Zip the files from given start date to end date
### find all files that were modified less than 29 days ago and more than 21 days ago.
# find . -type f -mtime -29 -mtime +21 | zip -@ my.zip
# tar cvf - `find . -type f -mtime -29 -mtime +21` | gzip -c 1>061110_061201.tgz
# find largest files
# du -m /some/path | sort -nr | head -n 20
# find / -type f -size +20M -exec ls -lh {} \;
# find hard disk usage - top space consuming directories
# du -hcsx *
# du -hcsx * |sort -r|head -10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment