Answers for "remove all file"

3

how to remove all files except one in linux

# if you are using a loop

shopt -s extglob

rm -rf !("abc.txt" | "abc.log" )  # others will be removed except these two
OR
rm -v !(*.zip|*.odt)

shopt -u extglob
Posted by: Guest on December-10-2020
2

delete all files in a directory command

rd /s/q Foldername
Posted by: Guest on May-26-2021

Code answers related to "remove all file"

Code answers related to "Shell/Bash"

Browse Popular Code Answers by Language