Linux 103 - Chapter 1 Flashcards

1
Q

In Bash, inserting 1>&2 after a command redirects

A

Standard output to standard error

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

What characters can be combined with a separator string in order to read from the current input source until the separator string, which is on a separate line and without any trailing spaces, is reached?

A

<

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

What command will print to standard out only the lines that do not begin with # in the file foobar?

A

/bin/grep -v ^# foobar

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

Which command sets the Bash variable named TEST with the content FOO?

A

TEST=”FOO”

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

When given the following command line.

echo “foo bar” | tee bar | cat

What output is created?

A

foo bar

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

Give two examples of valid stream redirection operators within Bash? (Two answers)

A

< ;&raquo_space;

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

Which command shows the definition of a given shell command?

A

type

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

Which shell built-in command can be used to create a shortcut or pseudonym for a longer command in a shell such as Bash?

A

alias

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

Which command line redirection character instructs the shell to read from the current input source until a specific word, on a separate line and without and trailing spaces, is reached?

A

<

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

Which file, located in the user home directory, is used to store the Bash history?

A

.bash_history

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

Which shell redirection will write standard output and standard error output to a file named filename?

A

> filename 2>&1

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

Which Bash environment variable defines in which file the user history is stored when exiting a Bash process? (Specify ONLY the variable name.)

A

HISTFILE

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