The /root Home Directory of the root User. Generally, youll just need to go into the partitioning options, create a separate partition, and mount it at /home. Suppose you have to go in any other user's home directory, use the following command To go in your last directory, you can use the following command bash, ksh, csh, etc.) To be super-precise here -- /bin/sh is guaranteed under POSIX to be a Bourne-compliant shell, but tilde expansion (~ and ~user) is not one of the required features of such shell.Linux distributions use BASH as /bin/sh, for which tilde expansion works.If you run echo ~ using /bin/sh under some other UNIX OS, you can get back just the tilde (e.g. chown username:username /home/new_home_directory. At any stage, while working on the Linux command mode you may want to list all files and subdirectories in the directory. Former Lifewire writer Juergen Haas is a software developer, data scientist, and a fan of the Linux operating system. An increasingly popular configuration for modern personal computers is to have a medium-sized Solid State Drive (SSD) holding your operating system and a larger Solid State Hybrid Drive (SSHD) or traditional hard drive (HD) as your the main storage for data. It is one of the most basic and frequently used commands when working on the Linux terminal. Moving your home folder means you can reinstall Linux and not have to worry about your personal files. How to find the Home Directory? Since we launched in 2006, our articles have been read more than 1 billion times. -d (abbreviation for --home) will change the user's home directory. It takes the pain out of reinstalls and takes the risk out of upgrades. Next, go to the directory where the downloaded icon theme is. When multiple files or directories are given as a SOURCE, the DESTINATION must be a directory. To access the home directory graphically, open the files application, and click on the Home option from the left side menu. other Any account that is not yours and that does not belong to a permissions group that your account belongs to. $ cd Downloads/ $ tar xf ../ostechnix.tar When you log on to Linux, your starting directory is always your home directory, so youll be in /home/ [your username] as any other user than root, or /root if youre logged in as root. Heres a straightforward and step by step way to do it that should work on any distribution. Answer: The easiest but not only way to return to user's home directory from any directory within a filesystem is to use cd command without any options and arguments. Copy Multiple Files from One Directory to Another in Linux; Copy Using rsync Command; Other Options; Introduction . There are multiple ways to access and return to the home directory. in this example, the new drive is the second drive to be fitted to the system. 2. ls = list with several options, -l is long, -a is all (show hidden directories) -F gives details about the type of file/directory you are looking at. However, if theres another directory you use often that you want immediate access to when you open the Terminal, theres an easy way to set this up. cp -r dir1 dir2 dir3/ (2) How to copy the directory tree structure without copying the files inside them. Were going to create a single partition for the whole disk, so when prompted for the first sector we can press Enter to accept the default value. By default, the tree command is not included in Write a unix/linux cd command to go back to one directory? This is easily achieved with the mkfs command. When the copy has completed, use ls to have a look around and verify that your data is where you expect it to be in the new filesystem. If it doesnt, youve still got the safety net of your original /home directory and fstab file that could be restored if required. Change the user's home directory + Move the contents of the user's current directory: usermod -m -d /newhome/username username $ tar xf ostechnix.tar -C Downloads/ Or, go to the Downloads folder and something like the following extract the archive. We can do so using fdisk. Want to move your Linux home folder to another drive? For example, to delete a directory named dir1 you would type: rmdir dir1. For example, if you're currently in /var/www/html but you want to move to /var/www/html/img, either command works: Use the following shortcuts with the cd command: Depending on your shell, you may see either one of the shortcut symbols appended to your username at the shell prompt or the current directory name. For example, a regular user account operating in a Bash shell, trying to access /root, will obtain the following error: Either move using elevated privileges (e.g., through the sudo command) or change the permissions of the directory using the chmod command. During his career, he has worked as a freelance programmer, manager of an international software development team, an IT services project manager, and, most recently, as a Data Protection Officer. As humans we call this the the root directory, however there is possibly anther directory that you might be thinking of; '/root', which is the home directory of the user 'root'. Before you use the usermod command the new home directory should be created, ownership should be assigned to the new user and the folder should be chmoded correctly so that no one else can access it.