LinuxQuestions.org
Visit the LQ Articles and Editorials section
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices

Reply
 
Search this Thread
Old 09-18-2008, 08:19 AM   #1
cadcrazy
LQ Newbie
 
Registered: Sep 2008
Posts: 12

Rep: Reputation: 0
How to copy files from diffrent folders to a single folder


I have one folder having many subfolders. Want to copy all the files (remember only files) from those folders to a single folder. Can anyone tell me how to do it in terminal
 
Old 09-18-2008, 08:24 AM   #2
indeliblestamp
Member
 
Registered: Feb 2006
Distribution: Fedora
Posts: 341
Blog Entries: 3

Rep: Reputation: 38
Very roughly, this should work:
Code:
cp */* destination-folder
cp skips folders by default anyway. (Note that the above command will also copy files from the current folder, not just its subfolders).
 
Old 09-18-2008, 09:50 AM   #3
cadcrazy
LQ Newbie
 
Registered: Sep 2008
Posts: 12

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by arungoodboy View Post
Very roughly, this should work:
Code:
cp */* destination-folder
cp skips folders by default anyway. (Note that the above command will also copy files from the current folder, not just its subfolders).
Thanks buddy its working

What if i wana copy folders also ?????
 
Old 09-18-2008, 09:57 AM   #4
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Arch/XFCE
Posts: 17,802

Rep: Reputation: 728Reputation: 728Reputation: 728Reputation: 728Reputation: 728Reputation: 728Reputation: 728
Quote:
Originally Posted by cadcrazy View Post
Thanks buddy its working

What if i wana copy folders also ?????
cp -R *
copies everything from the current directory down

cp -R dirname
copies everything from dirname down. dirname can be an absolute or relative path.
 
  


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
getting strings for all the files and folders in a folder Hard_Working_ Programming 6 04-07-2007 10:55 AM
Command to copy files/folders but skip bad/corrupt files?? leemoreau Linux - Newbie 2 04-02-2007 02:27 PM
script or utility to copy files and folders m2azer Linux - General 1 12-22-2005 10:09 AM
copy files and folders codepoet Linux - Newbie 2 06-12-2005 02:08 PM
how to copy files/folders??? Gallienus Linux - General 4 12-15-2003 12:02 PM


All times are GMT -5. The time now is 01:00 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration