LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Having rm or mv take file input (https://www.linuxquestions.org/questions/linux-newbie-8/having-rm-or-mv-take-file-input-199231/)

BlueOrb 06-29-2004 04:48 PM

Having rm or mv take file input
 
how can i get rm to take a file input? i have a text file with a bunch of paths in it, but how do i get rm or mv to do their stuff to the files instead of to the text file itself?

scuzzman 06-29-2004 04:53 PM

Code:

[user@domain ~]$ rm < filename
this should do the trick

BlueOrb 06-29-2004 06:15 PM

nah, im not that n00bish tried that it says for rm too few args and for mv missing file arg... :(

iulius 06-29-2004 09:40 PM

xargs
 
You need to use xargs to split the file into separate tokens, each with its own call to rm.

Like so:
Code:

xargs rm -f < thefile

BlueOrb 06-29-2004 09:42 PM

alright ill try that thanks guys!


All times are GMT -5. The time now is 11:54 AM.