Not Just Paranoid

Another site by Pete Maynard

rm exclude

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 the file/folder name.

Chomputers away!

21 Jan 2011 | Tags ( bash grep Linux ls rm UNIX )

Website Last Updated on 15 Sep 2023 (CC BY-SA 4.0)

This site uses JQuery and nanogallery2 hosted by
for the Flickr photo feed and GoatCounter for user insights.