27

I would like to move folders like 'Pictures', 'Documents', 'Movies' to a different from the default under the root of user's home location, preferably into a sub-folder under the same user's home folder. For example, user/Music would go to user/stuff/Music.

I'd rather not create symbolic links to moved folders, but change system's behaviour altogether, so it knows where to find those folders.

Please bear in mind that I do not want to move user's home folder, but just those ones, for example, move them to /Users/[user name]/stuff/ since I don't like them polluting the home folder there.

4
  • The best way is to move your whole home directory altogether. Just did that to free some space on my SSD—worked perfectly fine.
    – Dan
    Sep 25, 2011 at 22:24
  • 1
    Thanks Dan, but I don't actually want to move my home folder, just those ones I mentioned, I'd rather have them under 'Documents' or some other folder, which in its own turn, sits under user's home. I don't really like how those folders pollute the home directory with their presence.
    – Art
    Sep 26, 2011 at 10:05
  • 2
    If you dislike their presence and don't use them, issue chflags hidden <folder> to hide any of them in Finder. This won't move them of course but I like to hide Public folder, for instance.
    – Dan
    Sep 28, 2011 at 15:10
  • I would actually like to keep using them, Dan, although move them.
    – Art
    Sep 29, 2011 at 22:24

8 Answers 8

14

Art,

Do you have this working successfully?

Have you tried hiding the folders using something like:

chflags hidden ~/Documents 

Then creating a link to it such as (in Terminal):

cd ~
mkdir stuff
cd stuff
ln -s ~/Documents

I believe that this will hide the ~/Documents folder from the Finder but it will still be there so anything writing to it will work OK. In addition you will see the link in ~/stuff...

5
  • 1
    That actually sounds very promising, I will give it a shot, thanks man!
    – Art
    May 3, 2012 at 3:33
  • 1
    Although they are still visible in terminal after 'ls -la', I am glad you suggested this solution which will cover around 90% of cases for me. Thank you!
    – Art
    May 3, 2012 at 3:45
  • 1
    This is perfect, thanks. It still would be cooler if you could somehow rename them... if the default folder names started with lower case and I'd probably keep them around. Oct 30, 2013 at 15:05
  • 1
    This does not hide it from ls. How can that be done?
    – Ivan Perez
    Jan 18, 2019 at 11:01
  • 1
    To unhide: chflags nohidden ~/Documents Sep 22, 2019 at 12:36
8

I personally use symlinks to move all of those directories under my User account. I logged in as root and symlinked all of my directories "Documents' Downloads " Movies", etc and moved them to an external drive.

Mac OS sees the changes just fine and points to those directories (on the external drive) automatically and I have had no issues doing it this way.

There is a System Service called SymbolicLinker that will add an option to your context menu that will create a symbolic link for you.

enter image description here

How to enable the root user

OS X Lion

  1. From the Apple menu choose System Preferences....
  2. From the View menu choose Users & Groups.
  3. Click the lock and authenticate as an administrator account.
  4. Click Login Options....
  5. Click the "Edit..." or "Join..." button at the bottom right.
  6. Click the "Open Directory Utility..." button.
  7. Click the lock in the Directory Utility window.
  8. Enter an administrator account name and password, then click OK.
  9. Choose Enable Root User from the Edit menu.
  10. Enter the root password you wish to use in both the Password and Verify fields, then click OK.

Mac OS X v10.6.x

  1. From the Apple menu choose System Preferences....
  2. From the View menu choose Accounts.
  3. Click on the lock and authenticate with an administrator account.
  4. Click Login Options....
  5. Click the "Edit..." or "Join..." button at the bottom right.
  6. Click the "Open Directory Utility..." button.
  7. Click the lock in the Directory Utility window.
  8. Enter an administrator account name and password, then click OK.
  9. Choose Enable Root User from the Edit menu.
  10. Enter the root password you wish to use in both the Password and Verify fields, then click OK.
8
  • This is a cool trick. I just thought it would've been nicer if you could expand a little for not-so-power-users? A link on how to enable root account, an explanation on how to launch this System Service would help a lot.
    – Dan
    Sep 25, 2011 at 22:43
  • 1
    When you download the service extension, there will be instructions on how to install it. Basically, you just copy SymbolicLinker.service to /Library/Services/, then log out and log back in.
    – WrightsCS
    Sep 25, 2011 at 22:55
  • Edited answer with instructions on how to enable root user for Lion and Snow.
    – WrightsCS
    Sep 25, 2011 at 23:01
  • Well-written answer, but I have to agree with other users that you will be messing with things that Mac OS X, for good reason, does not want you to mess with, and you may be unnecessarily complicating your system's structure. Please think about this: Is Time Machine going to back up these folders and their contents now that you have moved them to another hard drive? You had better confirm this.
    – user9290
    Sep 25, 2011 at 23:45
  • 2
    @WheatWilliams yes, actually, Time Machine backs up these directories pretty well for me.
    – WrightsCS
    Sep 26, 2011 at 1:15
5

You can move your entire user account (home) folder using the following steps:

  1. Click on Users & Groups in System Preferences.
  2. Unlock the pane (lock icon).
  3. Right click on your selected user and choose the "advanced" option from the list.
  4. You will be greeted by the following screen:

enter image description here

From there, simply select the "home directory" to which you wish to relocate the profile to, then reboot.

Note: This will move all the contents found under /Users/{your user}/ (Downloads, Documents, Music, etc.)

5
  • @chsum: Are you sure the actual contents of Documents, Pictures etc. are moved? I would assume that OSX just creates a new home directory structure in the indicated place, the content must be moved by the user himself afterwards.
    – nohillside
    Sep 25, 2011 at 16:47
  • cksum, from the way I read the question, the asker does not want to move his entire home folder directory or user account. He wants to retain his home directory but move certain system-defined sub-folders out from under his home folder to remote volumes or places outside his home folder for disk space reasons.
    – user9290
    Sep 25, 2011 at 18:09
  • 2
    Just make sure that if you do want to keep your content, first copy the home folder to whatever location you prefer, then change this setting to match the new location. Just changing this setting doesn't copy any files—you'll start clean again.
    – Dan
    Sep 25, 2011 at 22:25
  • Also, if that new place is a different drive, make sure to make a second emergency administrator account in case the new drive where your home folder is sitting fails.
    – Fomite
    Sep 25, 2011 at 23:54
  • Thanks cksum, but I don't want to move my home folder, just these folders - I just don't like them sitting straight under user's home.
    – Art
    Sep 26, 2011 at 10:17
4

Well, the short answer is: Don't, because too many things depend on it. This is also the reason why Apple choose to make it difficult to rename these folders.

If you want to take the risk anyway, this answer to a somewhat related question should give you some ideas.

5
  • I +1'd this answer, but I also have to say that I strongly agree with this. I understand your desire, but it's a bad idea, and likely just impossible because the OS would just re-create them anyway unless you get into mucking around with things you shouldn't be mucking around with.
    – TJ Luoma
    Sep 25, 2011 at 20:25
  • May I disagree? I just seamlessly moved my home folder using this reference so I can save some space on SSD drive. Yes, you can't move individual folders but your post sounds as if moving the entire home folder is hard to do, when it fact it's not.
    – Dan
    Sep 25, 2011 at 22:41
  • If there's a reason I don't see it yet - there's a way you can be flexible with these names - for instance in Windows you can always refer to those folders using aliases, i.e. %System% etc. Looks like standard single-minded stubborness with Apple logo to me.
    – Art
    Sep 26, 2011 at 10:15
  • Dan, moving the whole home folder is easy (as pointed out already in another answer), renaming specific folder names (which appears to be the original question) isn't.
    – nohillside
    Sep 26, 2011 at 11:31
  • 7
    I would -100 this answer if I could. On my computer I do whatever I want! Including removing the useless directories.
    – devin
    Dec 14, 2012 at 17:53
2

Interpretation of OP's question

My guess is that OP doesn't want to see all of OSX's folders in the $HOME directory when they're in the terminal (like ~/Pictures, ~/Documents, etc.). Those folders are friendly for GUI users but they get in the way for CLI users.

I don't recommend moving any folders that GUI apps create from the Mac Home directory. This would probably break some things. Pogue's answer is very interesting, but it will probably hide those folders in Finder.

Solution: Just using a different folder as your CLI workspace

I offer a simple BASH command to make using the CLI friendlier on OSX.

Solution: Examples of usage

  • Type w and hit <Enter> from your Terminal to instantly cd ~/workspace and ls ~/workspace.
  • (Whenever you open a shell) You'll automatically navigate to ~/workspace and list the contents.

Why this solution?

As a CLI user, I'm constantly typing cd to return to $HOME, and then doing ls to find the folder I'm looking for. This does both of those things with 4 fewer keystrokes, while being simple and benign.

Full details: Installing the script and explaining what it does.

If you want to have these helper commands be available every time you open a terminal, you can paste this code into the ~/.bashrc file for BASH or ~/.zshrc file for ZSH.

                                                                                                                               
# Configure this however you want.                                                                                                   
export WORKSPACE=${HOME}/workspace                                                                                                   
mkdir -p ${WORKSPACE}                                                                                                                
                                                                                                                                     
#   This is a BASH function. It works in a similar way to                                                                            
# executing a program that is in your $PATH (for example, `ls`)                                                                      
#   If the BASH function was loaded into your shell then it will                                                                     
# be available to run as a command.                                                                                                  
w() {                                                                                                                                
  cd ${WORKSPACE}                                                                                                                    
  ls ${WORKSPACE}                                                                                                                    
}                                                                                                                                    
                                                                                                                                     
# Run the command every time a shell is opened.                                                                                      
w                                                                                                                                    

Regarding my previous script

The old script was complicated and involved creating a temporary directory whenever you run ls from $HOME, symlinking all files in $HOME to inside of that directory, and then running ls there. Goal was to make ls pretend that those folders weren't there but also keep CLI colors in the output. Kind of a mouthful but if you're curious, you can see it in the edits of this answer.

5
  • Can you add some explanation about what your script does?
    – nohillside
    Mar 9, 2016 at 5:43
  • I cannot retract my upvote. To any future visitor: this script does not work as desired.
    – Newb
    Sep 24, 2016 at 18:35
  • @Newb thanks for your comment, I'll take a look today
    – robert
    Sep 26, 2016 at 17:12
  • 1
    @Newb the script is working fine for me, could your explain your issue in greater detail? How did you install it?
    – robert
    Sep 26, 2016 at 17:17
  • @nohillside Thanks for the feedback, I've simplified the answer.
    – robert
    Feb 17 at 18:49
0

Just move them wherever you like. The only important one is Library and for the rest you can normally choose where apps place stuff.

There's only a few crappy apps that won't allow you to change where they write stuff, Microsoft and Adobe apps come to mind. They will put files in ~/Documents. All the rest will work with your files no matter where you put them.

1
  • I am afraid I didn't make myself clear enough - I don't want to move folders to other drive, I just want them out of sight from the root of home folder (i.e. hidden under some 'Apple junk' folder)
    – Art
    Apr 6, 2012 at 21:11
0

I would not suggest you to move your entire home folder, instead it is better to make symbolic links of your folders to external drive. After that you will get:

  1. Flexibility - if something happens with your external HD (remember that your hidden Library folder is on main drive if HDD is down you will need to do something because it will be down too), you will be able to start repairing it right in that moment without turning it off.
  2. In case if your main drive is SSD - when your home folder is on your main drive it loads up faster, when it would be on external.
  3. If you have Mac Pro - you can set for movies folder one HD, for music folder another HD...
2
  • 1
    I am sorry but this answer is very loosely related to the original question. I specifically do not want to move the home folder or create symbolic links.
    – Art
    Apr 9, 2012 at 15:09
  • It still adds value to the discussion, besides I agree
    – Asier
    Sep 4, 2015 at 13:23
0

I added a Transcend 256G drive in the expansion slot and tried this process but it did NOT move the data. It DID create a new profile with all the folders relocated to the expansion drive BUT I had to manually move all data from the internal SSD to the new location. I eventually got what I wanted but I had to recreate the entire profile (Outlook email account, preferences etc).

0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .