Fork me on GitHub
Nation Pigeon

Viewing Tags ls

Delete files based on last modified date

3rd October 11 | Linux

First create some files to test with: touch -d 01/01/2015 newfile touch -d 01/01/2009 oldfile Check it worked. using ls -l osaka@rika:~/test$ ls -l total 0 -rw-r–r– 1 osaka osaka 0 Jan 1 2015 newfile -rw-r–r– 1 osaka osaka 0 Jan 1 2009 oldfile And now delete all files which where last modified over one [...]

[ Read More → ]

rm exclude

21st January 11 | Linux

With help from Google and Linux forum, found a cool command that will delete everything else but not the folder or file name in the specified field behold the command of destiny! rm -r `ls | grep -v ‘snapshots’` Make sure that around the piped ls command you have tilda and a single quote around [...]

[ Read More → ]

Copyright © 2007 ∞ Nation Pigeon - Designed by Peter Mayanrd
Theme Based on Black-Green - Fork it on GitHub