LinuxQuestions.org
Register a domain and help support LQ
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-10-2005, 06:21 AM   #1
abhi
LQ Newbie
 
Registered: Apr 2005
Location: India
Distribution: REd Hat AS 3.0
Posts: 4

Rep: Reputation: 0
Lightbulb search special files and copy in directory.


Hi this is my first message to forum .
I got stuck in a problem i wants to copy all character special file or any special file from directory Hierarchy to one directory.
i ran command
$ find /dev/ -type c -exec cp * ./ {} \;
But it doesn't give me proper result.
 
Old 04-10-2005, 09:49 AM   #2
tommeke
LQ Newbie
 
Registered: Apr 2005
Location: Belgium
Distribution: Debian
Posts: 18

Rep: Reputation: 0
why "*" ?
why not cp {} ./ \;
{} represents the the char file found, so cp {} ./ copies the found char file to ./
 
Old 04-10-2005, 10:22 AM   #3
homey
Senior Member
 
Registered: Oct 2003
Posts: 3,057

Rep: Reputation: 59
Try this..
Code:
find /dev -type c -exec cp -R {} /new/folder \;
 
  


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
How do you copy hidden files from one directory to another? Akhran Linux - Newbie 19 12-29-2011 04:31 AM
copy 3 files to a directory and all subdirectories? snip128 Linux - Newbie 9 08-12-2005 10:18 PM
copy files from directory to directory without subfile ALInux Linux - General 2 06-03-2005 12:51 PM
search and copy multiple files NiallC Programming 2 04-29-2005 05:40 AM
locate and copy files - without directory tree rodda Linux - General 1 01-16-2005 03:10 AM


All times are GMT -5. The time now is 06:38 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