I would like to remove all of the archives (.tar, .zip, etc) on my system.
I know how to delete files using
rm but I'm wondering if there is a command just for deleting the archives on my system (and not regular files).
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It only takes a minute to sign up.Sign up to join this community
You can delete an archive like you would any regular file you have rights to:
To delete all the files in a certain directory or a folder with more than one file use the
-r flag (recursive).
rm -r /path/to/directory
To delete just .tar and .zip files in /path/to/directory/ use this line:
rm -r /path/to/directory/*.tar /path/to/directory/*.zip
Note: If you get permission denied, then run the command again with
sudo in front of it.
For more information, check out the rm manual page.