Copy all the files except one folder in Linux:
We have to run the following commands:
shopt -s extglob #setting bash shell option to recognize regex patterns
cp -r A/!(B) dest_dir #This will copy directory A to dest_dir and
#excludes B directory
We have to run the following commands:
shopt -s extglob #setting bash shell option to recognize regex patterns
cp -r A/!(B) dest_dir #This will copy directory A to dest_dir and
#excludes B directory
Labels: bash.linux, cp
0 Comments:
Post a Comment
<< Home