unix help please

Discussion in 'Mac Help/Tips' started by jelloshotsrule, May 2, 2002.

  1. jelloshotsrule macrumors G3

    jelloshotsrule

    Joined:
    Feb 7, 2002
    Location:
    serendipity
    #1
    related to my other question but simpler:

    there is a file that is in the trash but i cannot get it to delete. ie, it doesn't show up in there.

    under os 9 i can do a find for it and it shows up under harddrive/trashes/501... but it won't let me touch it.

    under os x it doesn't show up at all. i am signed in as root user.

    i assume i could probably best get rid of it via the terminal... could someone shed some light onto how?

    thanks in advance..
     
  2. PCUser macrumors regular

    Joined:
    Mar 1, 2002
    #2
    The bash commands required would be 'cd' and 'rm'.

    #cd <directory path to file>
    #rm -f <filename>

    The 'rm -f' makes it force the removal.
     
  3. jelloshotsrule thread starter macrumors G3

    jelloshotsrule

    Joined:
    Feb 7, 2002
    Location:
    serendipity
    #3
    sorry to be dumb... but what would the directory path end up being...?

    using greg's browser in os 9, i am able to see the file in my:

    "harddrive/Trashes/501/file"

    the thing is that the "trashes" appears to be .Trashes and both it and the 501 are invisible and i can't see them in os x....

    so any more specific you could be as far as the directory path would be great... thanks a ton.
     
  4. Baseline macrumors member

    Joined:
    Apr 9, 2002
    Location:
    Southern Ontario
    #4
    Well, in *nix, a '.' in front of a filename or directory means it's hidden. It's just a simple hiding scheme though.

    If the directory is listed in OS 9 as harddrive/Trashes/501/file,
    then in OS X it's probably (note: I don't even own a Mac so I don't have OS X. I'm going by my Linux knowledge here)

    /harddrive/.Trashes/.501/file

    Try this. Open a terminal and
    1) "cd /harddrive/.Trashes"
    2) "cd .501" If that doesn't work (it says directory doesn't exist or something) then try "cd 501"
    3) "ls" This will print the contents of the current directory, make sure that the file is really there
    4) "rm -f filename" This will forcibly remove the file (ie. won't ask you for Yes/No confirmation. Take out the -f if you want that confirmation)

    Hope this helps! Anyone who actually *uses* OS X, please correct any mistakes I've made in terms of OS X directory structure.
     
  5. jelloshotsrule thread starter macrumors G3

    jelloshotsrule

    Joined:
    Feb 7, 2002
    Location:
    serendipity
    #5
    whoo!

    thank you both a bunch. it worked.... and i learned a bit about unix along the way

    again, thanks a lot
     
  6. Taft macrumors 65816

    Taft

    Joined:
    Jan 31, 2002
    Location:
    Chicago
    #6
    New layout for trashes.

    The newest version of OS X has a new way of dealing with trashes. Previously, all trash was put under /.Trash under seperate folders for each user (ie 501 for user1, 502 for user2, etc.).

    It seems as though Apple is moving in a more intelligent direction with OS X 10.1.4. Now, they are putting each user's trash inside the users folder. For example, all user1's trash would be put in /Users/user1/.Trash

    This does present a problem, however, when dealing with drives other than the main drive. In this case, they still use the more cryptic system with .Trashes at the root level of the drive and user folders underneath. I still think this is a step in the right direction though. It will make managing trash much easier for those users who don't have partitions and multiple drives (ie your average Mac user).

    Matthew
     
  7. mc68k macrumors 68000

    mc68k

    Joined:
    Apr 16, 2002
    #7
    Just a nitpick, if the file is hidden (prefixed with a dot), then the ls has to be followed by the -a switch.

    I'm sure you know this, but I just wanted to clarify.
     
  8. Baseline macrumors member

    Joined:
    Apr 9, 2002
    Location:
    Southern Ontario
    #8
    D'oh! How could I forget something so basic? I guess that's what I get for using Win95 exclusively for five days straight...

    BTW it also works with -A, which for some reason I prefer to use :)
     
  9. mc68k macrumors 68000

    mc68k

    Joined:
    Apr 16, 2002
    #9
    You can also truncate ls down to l (as if this command wasn't short enough already!)

    Win95 for five days straight? I pity you… :) I have the opposite problem sometimes, typing in ls in place of dir. The command ls is actually recognized in Win95 but is more limited than dir.
     

Share This Page