#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2002
    Posts
    2
    Rep Power
    0

    Question Removing files in UNIX


    Hello,

    1) I have a file with the names of the files inside.
    2) I need to make the rm command to use that file as an input of files to delete.

    Here is I what I tried but it did not work:

    cat rm_list.txt > rm

    It is probably a simple thing to do but I'm not very good with connecting I/O from commands yet.

    Please show me how if you know

    Reagards,
    sqdProgrammer
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2003
    Location
    Jersey
    Posts
    64
    Rep Power
    11

    Almost had it right


    Almost had it...

    Uuse the following from the command line:

    for x in `cat rm_list.txt`
    do
    rm $x
    done

    (Just in case you're not aware, those are ticks, the symbol on the same key as the tilde, not single quotes)

    Let it run, your files will be gone.

    Hope this helps.

    -Gary

IMN logo majestic logo threadwatch logo seochat tools logo