LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   piping data (https://www.linuxquestions.org/questions/linux-newbie-8/piping-data-122504/)

tearinox 12-03-2003 09:53 PM

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?

neo77777 12-03-2003 10:02 PM

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

tearinox 12-03-2003 10:14 PM

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)

neo77777 12-03-2003 10:19 PM

Sorry I am editing the command over and over you can ignore -prune -path thing. As for piping I will need to investigate farther.

Demonbane 12-03-2003 10:28 PM

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

Vincent_Vega 12-04-2003 04:58 AM

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!

qwijibow 12-04-2003 05:12 AM

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 :)

tearinox 12-08-2003 09:23 AM

cool, thx guys

qwijibow 12-08-2003 03:25 PM

oohh, here's anouther good one...

cat /dev/urandom > /dev/mouse

now try getting a headshot in unreal tournament !!!!!!

tearinox 12-09-2003 01:43 PM

thats harsh. Ill try it :)


All times are GMT -5. The time now is 02:20 PM.