How to delete all files/directories with exception/s using RM command in Linux

You can delete all files and/or directories with some exceptions using this command: We will be using: ls command to list all the names of files and folders on our current directory. | grep -v (grep inverse) to filter all the names of  files and folders which are not on your <name> list.  | xargs to pass the results from the previous commands […]

Read More