Hi, I want to delete all the files in a directory that I am in except one file. How should I execute the command in the terminal?Thanks
To delete all the files, first, you need to enter to your considered directory and then use the below PHP codes:
rm -f !(file.txt)
Note that you need to type the name of the file you do not want to delete Instead of file.txt.
Thank you for sending the message.
7 days a week, 24 hours a day