How to hide files that are located elsewhere besides "User/Username..." in terminal?

Discussion in 'Mac Basics and Help' started by Laxex Valentine, Jul 13, 2009.

  1. Laxex Valentine macrumors newbie

    Joined:
    Aug 17, 2008
    #1
    Hello!

    I've been wondering, if there is a way to hide files that are not located in "User/Username/...." in Terminal?

    The command I use to hide the files for example is: chflag hidden ~/Desktop/*

    However, if I the file/folder I want to hide is not in 'User/Username..." I will not be able to hide it... So how do you change it so that you can hide the folders that are not located in "User/Username"?

    Also, I've ran into a problem!

    My "Username" that one that has an house icon is missing when I access it from Machintosh HD --> Users Folder.

    I guessed that it was hidden somehow but not too long ago it was in the User folder... So I typed in "defaults write com.apple.finder ShowAllFiles True" and I found a bunch of weird files on my Desktop and my Machintosh HD... and I found the Username house icon... I do not know what I did in terminal that hid it...

    Can someone please help!?


    Thanks!
     
  2. angelwatt Moderator emeritus

    angelwatt

    Joined:
    Aug 16, 2005
    Location:
    USA
    #2
    Obviously you shouldn't have been trying to hide files. It's a poor method for hiding as well. You have to use sudo at the start of your command for it to work outside your home directory, but I don't encourage as you obviously don't know what you're doing and you can very likely mess up your system, more so.

    The weird files you see are likely fine. There's lots of hidden files created by the system and applications.
     
  3. BlueRevolution macrumors 603

    BlueRevolution

    Joined:
    Jul 26, 2004
    Location:
    Montreal, QC
    #3
    You can make your home folder reappear with

    chflags nohidden ~

    After that, I don't recommend hiding anything else. Doing so makes your computer more difficult to use, and if you don't know how to access something you've hidden from the command line, it becomes inaccessible.

    As for the already-hidden stuff you've found, to put it mildly: don't touch. It was hidden for a reason. Just run

    defaults write com.apple.finder ShowAllFiles False; killall Finder

    and forget about it.
     
  4. swiftaw macrumors 603

    swiftaw

    Joined:
    Jan 31, 2005
    Location:
    Omaha, NE, USA
  5. Laxex Valentine thread starter macrumors newbie

    Joined:
    Aug 17, 2008
    #5

    Wait, so in order to hide folders outside of my home directory... I'll have to use sudo... Do you know the command line for it? I just realized that those "weird" files are supposed to be there. I figured it out, you can use "Super Get Info" to show files that you have hidden. :)

    Hey Blue!

    Uhhh, do you just type in "chflag nohidden ~" to make the home folder reappear? Thanks :)

    >.< Yeah I just started to play around with Terminal because it's summer and I don't really have much to do, and it's something that interests me ):
     
  6. BlueRevolution macrumors 603

    BlueRevolution

    Joined:
    Jul 26, 2004
    Location:
    Montreal, QC
    #6
    I really suggest you get a book on UNIX to give you some grounding in the subject. Permissions are a bit more complicated than I'm prepared to explain in a forum post.

    Correct.
     
  7. Laxex Valentine thread starter macrumors newbie

    Joined:
    Aug 17, 2008
    #7
    Ohhh! Nice! Thanks for the suggestion since I guess it best to know the basic functions, because I treat this as a hobby. :)
     
  8. angelwatt Moderator emeritus

    angelwatt

    Joined:
    Aug 16, 2005
    Location:
    USA
    #8
    I don't feel comfortable telling you too much because you could do some more damage. I recommend reading some Unix tutorials online to start understanding the basics of common commands like ls, cd, chmod, mkdir, etc. then you'll be a little more prepared for the responsibility of using sudo with them. I'm simply trying to watch out for you and your machine. The Terminal is a geek's world and there's not a lot of room for errors.
     
  9. jzuena macrumors 6502a

    jzuena

    Joined:
    Feb 21, 2007
    Location:
    Lexington, MA, USA
    #9
    I'll second getting a book on UNIX (or Linux) and not trying too many commands until you know what they do and how they will affect the system. Then again, if you don't have much to do for the summer and don't mind that you may have to reinstall OS X a couple of times when you accidentally kill your system, then now might be a good time to go ahead and experiment (back up anything important first). If you are going to be spending your time in terminal, you might as well get something better. I use and recommend iTerm.
     

Share This Page