Making A Folder Or File Invisible

Posted:
in Genius Bar edited January 2014
How can I make a folder invisible? Is there a CLI command I can do? Thanks.

Comments

  • Reply 1 of 20
    baumanbauman Posts: 1,248member
    Do you have the Dev tools installed? There's a command hidden in there (/Developer/Tools/SetFile) that will let you do it.



    To get it to go, type "/Developer/Tools/SetFile -a V filename"
  • Reply 2 of 20
    torifiletorifile Posts: 4,024member
    Quote:

    Originally posted by Proud iBook Owner 2k2

    How can I make a folder invisible? Is there a CLI command I can do? Thanks.



    mv filename .filename



    adding a "dot" at the beginning makes it invisible in the finder.
  • Reply 3 of 20
    http://www.apimac.com/sf/index.html



    Secret Folder by Apimac. Haven't used, never heard of it, but noticed it today on macnn.
  • Reply 4 of 20
    Quote:

    Originally posted by torifile

    mv filename .filename



    adding a "dot" at the beginning makes it invisible in the finder.




    That doesn't work... mv is the move command...
  • Reply 5 of 20
    torifiletorifile Posts: 4,024member
    Quote:

    Originally posted by Proud iBook Owner 2k2

    That doesn't work... mv is the move command...



    I know what it is.



    And it does work, I've tried it. And the mv command is actually a cp and rm command in one. It works to rename, too. Make sure you put the trailing slashes after the folder names.



    edit:



    Quote:

    In its first form, the mv utility renames the file named by the source

    operand to the destination path named by the target operand. This form

    is assumed when the last operand does not name an already existing direc-

    tory.



    man mv - please read before telling someone they don't know what they're talking about.
  • Reply 6 of 20
    Quote:

    Originally posted by Proud iBook Owner 2k2

    That doesn't work... mv is the move command...



    Yes, it does work.



    mv renames files too. If you rename a file to have a dot '.' in front of it, the file is then invisible to the Finder and other GUI apps.



    edit: damn, beat by torifile again.
  • Reply 7 of 20
    torifiletorifile Posts: 4,024member
    Quote:

    Originally posted by Brad

    edit: damn, beat by torifile again.



  • Reply 8 of 20
    I did mv /sw .sw all that did was erase the folder... Luckily I only need it to keep my Terminal.app happy... I doesn't work for me.
  • Reply 9 of 20
    torifiletorifile Posts: 4,024member
    Quote:

    Originally posted by Proud iBook Owner 2k2

    I did mv /sw .sw all that did was erase the folder... Luckily I only need it to keep my Terminal.app happy... I doesn't work for me.



    Reading problem tonight? I said make sure you have the trailing slashes. Sheesh.
  • Reply 10 of 20
    Meaning like this:



    mv /sw /sw .sw



    What do you mean exactly?
  • Reply 11 of 20
    torifiletorifile Posts: 4,024member
    Quote:

    Originally posted by Proud iBook Owner 2k2

    Meaning like this:



    mv /sw /sw .sw



    What do you mean exactly?




    No. If your directory is called "foo" and you're in the directory that contains the folder foo, you do mv foo/ .foo/





    So you would do mv /sw/ /.sw/





    Sorry I wasn't clear.
  • Reply 12 of 20
    Quote:

    Originally posted by torifile

    No. If your directory is called "foo" and you're in the directory that contains the folder foo, you do mv foo/ .foo/





    So you would do mv /sw/ /.sw/





    Sorry I wasn't clear.




    OKay I did that and here's what it tells me:



    Gaspar-Hellers-Computer:/ gasparhe$ mv /sw/ /.sw/

    mv: rename /sw/ to /.sw/sw/: Directory not empty



    What now?
  • Reply 13 of 20
    torifiletorifile Posts: 4,024member
    Quote:

    Originally posted by Proud iBook Owner 2k2

    OKay I did that and here's what it tells me:



    Gaspar-Hellers-Computer:/ gasparhe$ mv /sw/ /.sw/

    mv: rename /sw/ to /.sw/sw/: Directory not empty



    What now?




    That's a good question. I just did it myself with a directory full of stuff. Anyone with any ideas?
  • Reply 14 of 20
    mv /sw /.sw



    mv = move

    /sw = source

    /.sw = destination



    You shouldn't be using trailing slashes.



    This assumes there is something already named "sw" at the top level of the drive.
  • Reply 15 of 20
    Quote:

    Originally posted by Brad

    mv /sw /.sw



    mv = move

    /sw = source

    /.sw = destination



    You shouldn't be using trailing slashes.



    This assumes there is something already named "sw" at the top level of the drive.




    I did exactly what you said and it still says:



    Gaspar-Hellers-Computer:~ gasparhe$ mv /sw /.sw

    mv: rename /sw to /.sw/sw: Directory not empty



    -_- Could you please ssh into me and do it for me?
  • Reply 16 of 20
    baumanbauman Posts: 1,248member
    Nooooo!



    Don't do this!!!



    Renaming sw will completely mess up all your fink paths, and such.



    If you don't like my SetFile suggestion, then edit the .hidden file on the root of your hard drive. It's really easy. Just open it in an editor like BBEdit (since it can open invisible files) or a terminal editor, and add sw to the end of it. Make sure that there is still a trailing carriage return, though.



    Once you relaunch the finder, the new changes take effect.



    If you want, I could even ssh for you, or vnc so you could see what I am doing.
  • Reply 17 of 20
    Quote:

    Originally posted by bauman

    Nooooo!



    Don't do this!!!



    Renaming sw will completely mess up all your fink paths, and such.



    If you don't like my SetFile suggestion, then edit the .hidden file on the root of your hard drive. It's really easy. Just open it in an editor like BBEdit (since it can open invisible files) or a terminal editor, and add sw to the end of it. Make sure that there is still a trailing carriage return, though.



    Once you relaunch the finder, the new changes take effect.




    Heh. I don't really have fink installed... I only have the bin and etc directories with init.sh and fink.conf. I only have it there to keep Terminal.app happy.. It would otherwise complain that it can't find /sw/bin/init.sh. Don't worry. I wouldn't be doing this if I had a working fink installed. I've been having problems with it lately....
  • Reply 18 of 20
    baumanbauman Posts: 1,248member
    Of course, you'd be messing up the paths to these .conf files then, too.



    My way is better...
  • Reply 19 of 20
    Quote:

    Originally posted by bauman

    Of course, you'd be messing up the paths to these .conf files then, too.



    My way is better...




    Again I only have it there so Terminal.app doesn't get on my nerves with the constant "/sw/bin/init.sh Directory not found" message...
  • Reply 20 of 20
    baumanbauman Posts: 1,248member
    Right, and putting a period in front of the sw folder will still cause the error to show up.



    It's looking for a folder named "sw", not one named ".sw". There is a significant difference... it's not just appearance that you're changing.



    You could rename the folder, and then go into your terminal configuration files and change the paths to ".sw", adding a period everywhere you have a path through the sw folder.



    Or, you could just use the .hidden method or the SetFile method. Both work nicely. Both cause zero side effects. Both make it invisible. Your terminal will find /sw, and you won't get any more errors, and have a nice, clean root drive.



    Putting a period in front of sw will make it invisible, but it will NOT fix the errors.



    Capiche?



    [Edited to make my post sound a bit less hostile... it came off a little strong ]
Sign In or Register to comment.