Essentials of Linux Flashcards

How to use BASH Shell and the CLI. Learning common Linux commands, and about Man pages. (35 cards)

1
Q

What command is used to redirect standard output to a file?

A

sort file1 > sort.out

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

How can you redirect both standard output and error to the same file?

A

ls /etc/ |& ls.out

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What command formats and displays the contents of a text file?

A

pr

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What does the command ‘tr’ do?

A

translates input provided

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Fill in the blank: The default behavior of a shell is to take input from the _______.

A

keyboard

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What command is used to append output to an existing file?

A

date | tee -a /tmp/ll.out

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What character is used to represent a pipe in Bash?

A

|

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What is the default number of commands stored in the Bash history?

A

1000

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

True or False: The command ‘whoami’ displays the username of the user who executes the command.

A

True

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What do you use to disable the special meaning of certain characters?

A

Masking

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What is the primary command prompt for root users?

A

#

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What command would you use to change directories?

A

cd

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What does the command ‘pwd’ stand for?

A

print working directory

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What is the purpose of the ‘export’ command?

A

to set environment variables

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Fill in the blank: The command ‘cut’ extracts selected _______ of data from a row.

A

columns

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What is the difference between local and environment variables?

A

Local variables are private to the shell; environment variables are available to child processes.

17
Q

What shell is known as the most widely used and is the default for all users including root?

A

Bourne Again Shell (BASH)

18
Q

What does the command ‘uname’ display?

A

basic information about the OS

19
Q

What is the purpose of the command ‘cal’?

A

displays calendar for the current month

20
Q

Fill in the blank: The command ‘which’ displays the _______ path of the command that will be executed.

21
Q

What is tilde substitution in Bash?

A

Expands to the user’s home directory or other related directories.

22
Q

How do you create a shortcut for a lengthy command in Bash?

A

Using command aliasing

23
Q

What command is used to send a broadcast message to all logged-in users?

24
Q

What does the command ‘hwclock’ do?

A

shows date/time based on system’s hardware clock

25
What is the command to see a short description of commands?
whatis
26
What command is used to view the manual pages for a command?
man
27
What is the purpose of the 'tee' command?
sends output to two destinations at the same time
28
What are the three special characters used for masking in Bash?
* ' "
29
True or False: The command 'clear' wipes the terminal screen.
True
30
What is the command history file in Bash?
$HOME/.bash_history
31
What command can be used to log out from the session?
exit or Ctrl+d
32
Fill in the blank: The command 'date' displays the system _______.
date/time
33
What character matches exactly one character in Bash?
?
34
What are meta characters in Bash?
Special characters that have a specific meaning.
35
What does the command 'id' display?
user identification information