HARDWARE AND OPERATING SYSTEMS
PRACTICE SET ANSWERS FULL SOLUTION
◉ # character.
Answer: indicates that the current user is the root user.
◉ $ character.
Answer: indicates that the current user is a normal user.
◉ $PATH environment variable.
Answer: contains the set of directories that are searched when you
type an executable file at the shell prompt.
The shell does not look in the current working directory for the
executable file.
To see the list of directories, type echo $PATH at the shell prompt.
To add a directory to a path, type PATH=$PATH:[directory_path] and
then type export PATH.
◉ Type the filename at the shell prompt. (run an executable).
Answer: Resides in a directory that is included in the $PATH
environment variable
,◉ Type ./ followed by the filename. (run an executable).
Answer: Resides in the current working directory and the current
directory is not included within the path environment variable
◉ Type the full path to the executable file. (run an executable).
Answer: Does not reside in the current working directory and its
directory is not included within the path environment variable
◉ file names and paths.
Answer: are case sensitive
◉ Linux shell history of commands.
Answer: The commands are stored as a history queue within the
hidden .bash_history file in your home directory.
Press the Up and Down keys to scroll through your previously typed
commands.You can edit the command or re-run it as is by pressing
Enter.
◉ Type history.
Answer: to display the commands stored in the history queue.
◉ Type history -c.
, Answer: to clear the history queue.
◉ Tab.
Answer: The commands are stored in the .bash_history file in your
home directory.
After typing the beginning of a command, file, or directory, press Tab
to complete it.
If pressing Tab does not fully complete the command, file, or
directory, press Tab again.If there is no matching command, file, or
directory name, your command entry will not change.If there is
more than one matching command, file, or directory name, a list of
all matches will be displayed to help you resolve your command
entry.
◉ pwd.
Answer: Shows the present working directory.
◉ whoami.
Answer: Displays the current username.
◉ uname.
Answer: Prints system information. The uname command has the
following options: