Something to keep in mind, is that particular directory houses user data. However, the command line – sometimes known as the terminal – doesn’t have an intuitive interface for checking disk space in Linux.. Unix/Linux get current working directory. ls. Let’s check them out. And if you want to list the contents of a directory just like a file manager, there are a few commands to do so. Full name of the user (GECOS). @choroba Add a user, delete the user, then add a user with the same username. ; In this example set the user’s new login directory to /users/v/vivek from /home/vivek, enter: # usermod -m -d /users/v/vivek vivek By default, all non-root user home directories are located in a directory named "home", below the / (root) directory - in the path of /home. It’s not limited only to users home directory and you can backup any directories. 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. How to get current working directory. Many users run Linux from the command line. For example if we change the directory to /home/user, pwd will print /home/user as the current working directory: $ cd /home/user $ pwd /home/user . tar is one of the best command for a local or manual backup solution. Scripts accepts user name and command as the argument. By default, ls lists the contents of a directory in columns. To get the current working directory use the pwd command. Linux has far more flexibility, however. Check whether a user exists in the Linux system # Now that we know how to list all users, to check whether a user exists in our Linux box we, can simply filter the users' list by piping the list to the grep command. – Andrew Dec 12 '15 at 18:59 One often-forgotten area of Linux security is the home directory--otherwise known as ~/. It is one of the best suitable solution for the data backup. Different colors are used to display files and directories. 6. The most common Linux command to list the content of a directory is ls. Where,-d dirnanme: Path to new login (home) directory.-m : The contents of the current home directory will be moved to the new home directory, which is created if it does not already exist. The above discussion covers standard Linux permissions—applying rwx to the user, group, and all others. Question: If you are in a subdirectory such as /PROJECTS/P1/A/A1/A11, what single command would you use to return to your home directory from the current working directory? I need to check a list of directories if it contains a directory newer than 1 month before now. This guide shows you how to find the size of a specific directory in Linux from the command line. User home directory. If the user's home folder is different the second time, this command gives the original home folder rather than the current one. Update: Based on this question's title, people seem to come here just looking for a way to find a different user's home directory, without the need to impersonate that user.. For example, for a Linux user named cwest, the home directory is in the path of /home/cwest. glenn jackman's answer gives the current one. Shell script that run linux commands in all users home directories and outputs its results. The /root Home Directory of the root User. If not and would like to take users home directory then this tutorial will help you to achieve it. Special permissions permit users to run applications with other credentials, control the inheritance of group associations, and keep files from being changed accidentally.