Thursday, October 04, 2012

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

No comments: