Horje
rm except one file Code Example
rm except one file
shopt -s extglob 
rm !(file.txt)
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 




Shell

Related
bash limit memory use of a function Code Example bash limit memory use of a function Code Example
windows usb serial number Code Example windows usb serial number Code Example
$? in shell script Code Example $? in shell script Code Example
node ace list routes Code Example node ace list routes Code Example
adonis list routes Code Example adonis list routes Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
14