Results 1 to 7 of 7
  1. #1

    What would be deleted?

    Greetings,
    If I did the following what would be deleted in your opinion?
    Thanks...

    PWD
    /home/account/files/temp
    rm -rf */

  2. #2
    Join Date
    Apr 2003
    Location
    Los Angeles, CA
    Posts
    800
    I think everything on all mounted and writeable drives, actually.
    Pings <1 ms, Unlimited Transfer, Lowest Price: http://localhost/

  3. #3
    Join Date
    Nov 2001
    Posts
    551
    I would guess the same files as

    [email protected] /home/account/files/temp$ ls -a */

  4. #4
    Thanks for the reply... Do you agree that this would not have deleted the /bin dir without deleting more?

  5. #5
    Join Date
    Apr 2003
    Location
    Los Angeles, CA
    Posts
    800
    I would guess the same files as

    [email protected] /home/account/files/temp$ ls -a */
    No, because ls does not do it recursively, while rm does (-r option). So when you start at the root of the file system (/) and enter every directory, all files are affected. I am NOT sure if it extends beyond the current file system (2nd drive mounted somewhere), but it may.
    Pings <1 ms, Unlimited Transfer, Lowest Price: http://localhost/

  6. #6
    Join Date
    Jan 2003
    Location
    San Diego, California
    Posts
    336

    Re: What would be deleted?

    Originally posted by alert3ff
    Greetings,
    If I did the following what would be deleted in your opinion?
    Thanks...

    PWD
    /home/account/files/temp
    rm -rf */

    Everything under /home/account/files/temp would be removed.

    Now, if you changed rm -rf */ to rm -rf /* everything under the / of your system will be removed.

    Look at the difference between ls */ while in the directory you mention and ls /* within the same directory. Answers the question as well.

  7. #7
    Join Date
    Nov 2001
    Posts
    551
    Originally posted by luki
    No, because ls does not do it recursively, while rm does (-r option). So when you start at the root of the file system (/) and enter every directory, all files are affected. I am NOT sure if it extends beyond the current file system (2nd drive mounted somewhere), but it may.
    ok,

    how about:
    [email protected] /path/$ find */ *

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •