Execute the hostname command again twice in the terminal, once with the option -s
and again with the option --short
. This will display the short version of the hostname.
hostname -s
hostname --short
Your output should be similar to the following:
The pwd
command is used to display your current "location" or current "working" directory. Type the following command to display the working directory:
pwd
Your output should be similar to the following:
The current directory in the example above is /home/sysadmin
. This is also referred to as yourhome directory, a special place where you have control of files and other users normally have no access. By default, this directory is named the same as your username and is located underneath the /home
directory.
As you can see from the output of the command (/home/sysadmin
) Linux uses the forward slash (/
) to separate directories to make what is called a path. The initial forward slash represents the top level directory, known as the root directory. More information regarding files, directories and paths will be presented in later labs.
The tilde (~) character that you see in your prompt is also indicating what the current directory is. This character is a "shortcut" way to represent your home.
FYI: pwd
stands for "print working directory". While it doesn't actually "print" in modern versions, older UNIX machines didn't have monitors and output of commands went to a printer, hence the funny name of pwd
.
Keyword:
- Explore Bash features
- Use shell variables
- Understand how to use globbing
- Be able to make use of quoting