1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Weird Unix issue

Discussion in 'Software' started by greenbrucelee, Dec 11, 2008.

  1. greenbrucelee
    Highly Decorated Member Award

    greenbrucelee Zettabyte Poster

    14,283
    254
    329
    I am trying to delete a directory in Unix (I am a bit rusty in Unix)

    So I have typed rm -r nameofdirectory

    but the cursor is just spining and not getting rid of the files and the directory. I am pretty sure the rm -r should wipe out the files and directory without me having to delete every single file,

    Anyone got any ideas or tell me where I am going wrong
     
    Certifications: A+, N+, MCDST, Security+, 70-270
    WIP: 70-620 or 70-680?
  2. Sparky
    Highly Decorated Member Award

    Sparky Zettabyte Poster Moderator

    10,189
    296
    319
    Im no UNIX guru but I think you have to do rm -rf nameofdirectory

    The f bit forces the deletion of the files and sub directories in the directory you have specified.
     
    Certifications: MSc MCSE MCSA:M MCSA:S MCITP:EA MCTS(x5) Security+ Network+ A+
    WIP: Exchange 2007\2010
  3. tripwire45
    Honorary Member

    tripwire45 Zettabyte Poster

    13,493
    179
    287
    Try this:
     
    Certifications: A+ and Network+
  4. greenbrucelee
    Highly Decorated Member Award

    greenbrucelee Zettabyte Poster

    14,283
    254
    329
    ahhh cheers -f does remove everything but there are some protected files in the directory that I think I have to unprotect before getting rid of the whole thing.

    Cheers
     
    Certifications: A+, N+, MCDST, Security+, 70-270
    WIP: 70-620 or 70-680?
  5. greenbrucelee
    Highly Decorated Member Award

    greenbrucelee Zettabyte Poster

    14,283
    254
    329
    cheers Trip so I did rm -r-f nameofdirectory after unprotecting the two files in the directory.

    Havent done any Unix since 2002 when we swapped to 2k3, although still prefer Unix as it was faster or the Sun boxes were anyway.
     
    Certifications: A+, N+, MCDST, Security+, 70-270
    WIP: 70-620 or 70-680?
  6. tripwire45
    Honorary Member

    tripwire45 Zettabyte Poster

    13,493
    179
    287
    Hopefully, you entered,
    Code:
    rm -rf nameofdirectory
    instead. :wink: If you get stuck, as in my example, just type the name of the command and then --help as in
    Code:
    rm --help
    . You can also google the command to see the options (just google "rm" and see what comes up). Cheers. :)
     
    Certifications: A+ and Network+
  7. greenbrucelee
    Highly Decorated Member Award

    greenbrucelee Zettabyte Poster

    14,283
    254
    329
    :oops: yep that's what I did not -r-f :oops: I am on my managers computer where he has everything installed about 50 times in various places and it takes the computer about 5 seconds to catch up. He wont let mean clean it up or defrag it.
     
    Certifications: A+, N+, MCDST, Security+, 70-270
    WIP: 70-620 or 70-680?
  8. tripwire45
    Honorary Member

    tripwire45 Zettabyte Poster

    13,493
    179
    287
    Probably afraid you'll discover his secret pr0n stash. :twisted:
     
    Certifications: A+ and Network+
  9. greenbrucelee
    Highly Decorated Member Award

    greenbrucelee Zettabyte Poster

    14,283
    254
    329
    lol, I already know where his pr0n is and he has plenty of it too :D
     
    Certifications: A+, N+, MCDST, Security+, 70-270
    WIP: 70-620 or 70-680?
  10. supernova

    supernova Gigabyte Poster

    1,422
    21
    80
    Dont forget man pages via the "man" command!
     
    Certifications: Loads
    WIP: Lots
  11. hbroomhall

    hbroomhall Petabyte Poster Gold Member

    6,623
    115
    224
    Note that in the Unix world single switches (i.e. those that take no argument) can be combined.

    So rm -r -f is the same thing as rm -rf.

    If there were a *lot* of files in the directory you were removing then that would explain the long delay in getting a response.

    Harry.
     
    Certifications: ECDL A+ Network+ i-Net+
    WIP: Server+
  12. Daniel

    Daniel Byte Poster

    236
    6
    25
    Is this the Unix equivalent of:

    Code:
    rmdir
    
    In Windows?

    I think the /f switch doesn't exist for rmdir I don't think.

    There one for files is:

    Code:
    del /f filename
    
    I think :biggrin
     
    Certifications: 70-270, 70-290, 70-291
    WIP: None, but learning SEO/SEM
  13. greenbrucelee
    Highly Decorated Member Award

    greenbrucelee Zettabyte Poster

    14,283
    254
    329
    Yep a lot of DOS commands are similar in Unix some are the same.
     
    Certifications: A+, N+, MCDST, Security+, 70-270
    WIP: 70-620 or 70-680?
  14. Daniel

    Daniel Byte Poster

    236
    6
    25
    Thanks :biggrin!
     
    Certifications: 70-270, 70-290, 70-291
    WIP: None, but learning SEO/SEM
  15. greenbrucelee
    Highly Decorated Member Award

    greenbrucelee Zettabyte Poster

    14,283
    254
    329
    There are plenty of free unix tutorials on the net if your interested in learning it. The only major difference in commands is with unix you don't get "are you sure Y/N" when you are doing something like deleting files unless you put the argument in with the delete command.

    I actually prefer Unix especially for managing a production process like were I work but it's expensive to maintain and can easily go bye bye if the wrong commands are used. But we use 2k3 now at work.
     
    Certifications: A+, N+, MCDST, Security+, 70-270
    WIP: 70-620 or 70-680?

Share This Page

Loading...