Essentials of Linux Flashcards
How to use BASH Shell and the CLI. Learning common Linux commands, and about Man pages.
What command is used to redirect standard output to a file?
sort file1 > sort.out
How can you redirect both standard output and error to the same file?
ls /etc/ |& ls.out
What command formats and displays the contents of a text file?
pr
What does the command ‘tr’ do?
translates input provided
Fill in the blank: The default behavior of a shell is to take input from the _______.
keyboard
What command is used to append output to an existing file?
date | tee -a /tmp/ll.out
What character is used to represent a pipe in Bash?
|
What is the default number of commands stored in the Bash history?
1000
True or False: The command ‘whoami’ displays the username of the user who executes the command.
True
What do you use to disable the special meaning of certain characters?
Masking
What is the primary command prompt for root users?
#
What command would you use to change directories?
cd
What does the command ‘pwd’ stand for?
print working directory
What is the purpose of the ‘export’ command?
to set environment variables
Fill in the blank: The command ‘cut’ extracts selected _______ of data from a row.
columns
What is the difference between local and environment variables?
Local variables are private to the shell; environment variables are available to child processes.
What shell is known as the most widely used and is the default for all users including root?
Bourne Again Shell (BASH)
What does the command ‘uname’ display?
basic information about the OS
What is the purpose of the command ‘cal’?
displays calendar for the current month
Fill in the blank: The command ‘which’ displays the _______ path of the command that will be executed.
absolute
What is tilde substitution in Bash?
Expands to the user’s home directory or other related directories.
How do you create a shortcut for a lengthy command in Bash?
Using command aliasing
What command is used to send a broadcast message to all logged-in users?
wall
What does the command ‘hwclock’ do?
shows date/time based on system’s hardware clock
What is the command to see a short description of commands?
whatis
What command is used to view the manual pages for a command?
man
What is the purpose of the ‘tee’ command?
sends output to two destinations at the same time
What are the three special characters used for masking in Bash?
- ’ “
True or False: The command ‘clear’ wipes the terminal screen.
True
What is the command history file in Bash?
$HOME/.bash_history
What command can be used to log out from the session?
exit or Ctrl+d
Fill in the blank: The command ‘date’ displays the system _______.
date/time
What character matches exactly one character in Bash?
?
What are meta characters in Bash?
Special characters that have a specific meaning.
What does the command ‘id’ display?
user identification information