March 1, 2015

How to copy multiple directories from one directory to another directory in linux system ?

# for example, a list between {}...

# for example, a list between {}
cd source_dir
cp -r {tic,tac,toe} destination_dir
#

Like  (2 likes)

example:...

example:
consider this (simple) directory structure.
/
/home
/home/user1
/home/user2
/home/user3
/home/user4
/new-home

and you want to copy 'user2' and 'user3' from /home to /new-home.
you'd do it like this:
cd /home
cp -a user[23] /new-home
(the -a means 'copy all recursively')
that's it.

Like  (5 likes)
Click Here!