Very useful tip about rm command.

Here I am sharing one small but very useful tip shared on our forum by one student Mr. Amit Gupta. I was just browsing and it got my attention. So here it is guys.. learn by sharing.

You can remove all the files from a directory using “rm -rf”, but think you want to save one file from that directory then??

You can use –

rm -rf !(filetobesaved)

This will remove all the files except this one. GREAT TIP!!

Here is the screenshot from my machine.

networknuts-remove-all-butone

networknuts-remove-all-butone

Advertisements