linux cp everything except 1

linux cp everything except

$ cp -r !(dir2) /home/sk/backup/

Here is what the above code is Doing:
1. The !(dir2) is a glob pattern that matches all files and directories except dir2.
2. The cp command copies all the files and directories except dir2 to the /home/sk/backup/ directory.

Similar Posts