delete all the files without one in linux
# delete all except the filename
$ rm -v !("filename")
delete all the files without one in linux
# delete all except the filename
$ rm -v !("filename")
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
shopt -u extglob
bash delete everything except
$ rm -v !("filename1"|"filename2")
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us