LinuxQuestions.org
Visit Jeremy's Blog.
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 12-03-2003, 10:53 PM   #1
tearinox
Member
 
Registered: Aug 2003
Location: you dont want to know
Distribution: Gentoo 2004.2, Slackware 10, Windows XP, Windows 2003 Server
Posts: 348

Rep: Reputation: 30
piping data


find -name *.mp3 | cp *.mp3 //home/tearinox

Now i would like to get used to this whole piping data idea. That command doesn't work and they are mp3 files in the directory. How do i copy all my mp3 files to using the piping technique seen above?
 
Old 12-03-2003, 11:02 PM   #2
neo77777
LQ Addict
 
Registered: Dec 2001
Location: Brooklyn, NY
Distribution: *NIX
Posts: 3,704

Rep: Reputation: 56
find . -type f -name \*.mp3 -exec cp '{}' /where/to/copy \;

Last edited by neo77777; 12-03-2003 at 11:19 PM.
 
Old 12-03-2003, 11:14 PM   #3
tearinox
Member
 
Registered: Aug 2003
Location: you dont want to know
Distribution: Gentoo 2004.2, Slackware 10, Windows XP, Windows 2003 Server
Posts: 348

Original Poster
Rep: Reputation: 30
thx neo77777

however, if i wanted to do it with ls, How would i use the "|" or "> <" symbols to accomplish the same thing?

(btw if theres a man page on this, let me know, id like to read it)
 
Old 12-03-2003, 11:19 PM   #4
neo77777
LQ Addict
 
Registered: Dec 2001
Location: Brooklyn, NY
Distribution: *NIX
Posts: 3,704

Rep: Reputation: 56
Sorry I am editing the command over and over you can ignore -prune -path thing. As for piping I will need to investigate farther.
 
Old 12-03-2003, 11:28 PM   #5
Demonbane
LQ Guru
 
Registered: Aug 2003
Location: Sydney, Australia
Distribution: Gentoo
Posts: 1,796

Rep: Reputation: 47
I'm not an expert on the subject but try

find -name *.mp3 | cp $(cat) ~/tearinox

cp $(find -name *.mp3) ~/tearnox
should also do the same thing

Last edited by Demonbane; 12-03-2003 at 11:50 PM.
 
Old 12-04-2003, 05:58 AM   #6
Vincent_Vega
Member
 
Registered: Nov 2003
Location: Jacksonville, FL
Distribution: Slackware & Arch
Posts: 825

Rep: Reputation: 31
did any of that work? This is my guess:

find . -name "*.mp3" -exec cp {} ~/tearinox \;

or maybe:

ls *.mp3 | cp {} ~/tearinox

but I'm no expert - I'm a newbie!
 
Old 12-04-2003, 06:12 AM   #7
qwijibow
LQ Guru
 
Registered: Apr 2003
Location: nottingham england
Distribution: Gentoo
Posts: 2,672

Rep: Reputation: 47
lol.. piping is GREAT !!!

cat bigfile | more (usefull)
rpm -ivh `find ~/backup | grep mplayer` (usefull)
rpm -e `rpm -qa` (lol, did it once, interesting reult, DONT TRY !)

cat /dev/urandom > /dev/dsp (funny !!!!)
cat outputs opens the rendom number genrator, and prints to screen.
but the > redirects this standard output to a file....
and /dev/dsp is the sound card file....

turn ur speakers up REEALY high first though
 
Old 12-08-2003, 10:23 AM   #8
tearinox
Member
 
Registered: Aug 2003
Location: you dont want to know
Distribution: Gentoo 2004.2, Slackware 10, Windows XP, Windows 2003 Server
Posts: 348

Original Poster
Rep: Reputation: 30
cool, thx guys
 
Old 12-08-2003, 04:25 PM   #9
qwijibow
LQ Guru
 
Registered: Apr 2003
Location: nottingham england
Distribution: Gentoo
Posts: 2,672

Rep: Reputation: 47
oohh, here's anouther good one...

cat /dev/urandom > /dev/mouse

now try getting a headshot in unreal tournament !!!!!!
 
Old 12-09-2003, 02:43 PM   #10
tearinox
Member
 
Registered: Aug 2003
Location: you dont want to know
Distribution: Gentoo 2004.2, Slackware 10, Windows XP, Windows 2003 Server
Posts: 348

Original Poster
Rep: Reputation: 30
thats harsh. Ill try it
 
  


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
Help with piping mijohnst Linux - General 7 10-21-2005 05:14 PM
Need help with commands and piping basselstine Linux - General 1 10-02-2005 10:43 PM
piping /forking geminigal Programming 3 04-10-2005 10:49 PM
Piping question OtisLinux Linux - Software 1 02-12-2004 02:38 PM
piping data to grace DavidPhillips Linux - General 0 09-06-2003 12:10 AM


All times are GMT -5. The time now is 08:18 AM.

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