How can I remove all files in one folder minus one file (.zip) from the command line? I am using bash to ssh to my server where I want to do this. I know I could use rm -rf *
being in that folder, but I need to keep the zipped file as that contains all the new files to replace the others. How can I do this from the command-line?
Linux – Remove all file in a folder minus one zipped file
bashlinux
Related Topic
- Linux – compress remotely server folders and files and copy them to the local drive
- Linux Process Management – Keeping a Linux Process Running After Logout
- Linux Web Server – Proper Permissions for Website Files and Folders
- Bash – Run an interactive bash subshell with initial commands without returning to the (“super”) shell immediately
- Linux – Script to run chown on all folders and setting the owner as the folder name minus the trailing /
- Linux – zcat/gzcat works in linux, not on osx. general linux/osx compatibility
- Linux – How to zip files with a size limit
Best Answer
info "(bash) Pattern Matching"