LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 04-13-2004, 12:57 PM   #1
rob-n
LQ Newbie
 
Registered: Apr 2004
Location: in a garbage can
Distribution: Madrake10ce
Posts: 27

Rep: Reputation: 15
copying a lot of files with bash or terminal.


hi

ok guys, i have about 200 files spread thruout about 50 dirs. thing is, that some files are in dirs, where only the files are supposed to be copied. so how does this work? i mean i have all the paths but how do i use them with the cp cmd?

tanks already

rob
 
Old 04-13-2004, 05:21 PM   #2
AutOPSY
Member
 
Registered: Mar 2004
Location: US
Distribution: Redhat 9 - Linux 2.6.3
Posts: 836

Rep: Reputation: 31
cp /usr/bin/* /usr/sbin

like that.

or to include directories too....

cp -R /usr/bin/* /usr/sbin

cp -dpR /directories/* /todirectory
for recursive permission preservation then.

Last edited by AutOPSY; 04-13-2004 at 05:55 PM.
 
Old 04-13-2004, 05:39 PM   #3
tmillard
Member
 
Registered: Sep 2003
Distribution: Gentoo
Posts: 74

Rep: Reputation: 15
Make sure you get the right swiches to keep the permissions.
Other wise you end up with $USER owning all the copyed files.
 
Old 04-13-2004, 07:01 PM   #4
Thymox
Senior Member
 
Registered: Apr 2001
Location: Plymouth, England.
Distribution: Debian + Ubuntu
Posts: 4,358

Rep: Reputation: 57
I tend to use the switch -a to copy recursively whilst preserving permissions and ownership. It can be annoying when copying from a CD because everything is RO by default.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
copying text from terminal Linuxuser_81 Linux - Newbie 4 09-30-2005 02:12 AM
Copying linked files, replacing directories in bash scripts? ta0kira Programming 2 10-10-2004 05:46 AM
copying/moving stalls when moving a lot of data to a usb stick =X= Linux - Hardware 10 07-30-2004 06:29 AM
copying from terminal screen bjb123 Linux - Newbie 1 01-08-2003 05:07 PM
Terminal Text Copying Hitokiri_X Linux - General 4 06-18-2002 06:02 PM


All times are GMT -5. The time now is 04:24 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration