All you need is the PWD(Print Working Directory) command, this will list your current directory absolute path All you need is the PWD(Print Working Directory) command, this will list your current directory absolute path
The root directory is the top level directory of the entire file system. Every branch starts from there. The current working directory is where you happen to be in the tree at the moment. If the root is always "/" and my process is in the directory /usr/local/bin/test/data, then the root directory is still "/" and my working directory is currently /usr/local/bin/test/data
The pwd command prints the working directory. The working directory is the directory you are "in", where operations on files that don't have an absolute path specified will be performed. For instance, if my working directory is /home/username/stuff, then the command echo "test" > test.txt would place the file test.txt in that directory.
In Unix, the parent directory is the directory that contains the current directory. It is represented by the symbol .. (two dots). When navigating the file system, you can use this symbol to move up one level in the directory hierarchy. For example, if you are in /home/user/documents, the parent directory would be /home/user.
An absolute path refers to the path to a file on a computer. For example, on a Unix system, an absolute path begins with a '/' and on a Microsoft Windows machine, it will begin with a drive letter, a ':' and a backslash (eg 'C:\') or a '\\' indicating a path to another computer. A relative path is the path to a file from the current directory. On a unix system this path will begin with a character other than a '/' (any other character could begin a relative path). For example, if one is currently in the directory /home/user42/ and there is a directory named /home/user42/mail/ then the relative path to mail is simply 'mail/'. If there is a directory /home/user41/songs/ then the relative path is '../user41/songs/'. If one is in the directory /home/ then the relative paths are user42/mail/ and user41/songs/, respectively.
The path that specifies the exact address for the file to which you are linking is called an "absolute path." An absolute path provides the complete details from the root directory to the specific file, including all directories and subdirectories. For example, in a Unix-like system, an absolute path might look like /home/user/documents/file.txt. In contrast, a "relative path" would only specify the location in relation to the current directory.
The root directory is /. The home directory is /home/user.
The default home directory is /home/user (where "user" is the username), sometimes shortened to "~".
PWD Although pwd will tell you where you are it won't change back to your home directory. For that, use the 'cd' command without any parameters
"cd" with no directory takes you to your home (login) directory. In a path, ~ (tilde) means your home directory, ~usr means the home directory of user usr. For example, "cp ~/foo ~john" copies file foo from your home directory to john's.
There are several ways to do this. The easiest way is just to type the command 'CD', which automatically puts you in your home directory. Other ways: CD $HOME CD ~ CD ~login-id (use your login-id here) If you know the absolute path name, just use it with the 'CD' command: CD /home/staff/guy1
It is the Home Directory.
Use the 'cd' command without any target; that always puts you in the home directory which becomes by default the working directory.