Session 2 Flashcards

1
Q
Which of the following is the most popular command line shell used in most Linux distributions today?
  A. C shell (csh)
  B. Korn (ksh)
  C. Bash (GNU Bourne Again Shell)
  D. Z Shell (zsh)
A

C. Bash (GNU Bourne Again Shell) (Your Answer)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q
Which keyboard character tells a user that they are in basic user text mode in the Bash shell command prompt?
  A. #
  B. $
  C. &
  D. @
A

B. $ (Your Answer)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q
If you are working in a Linux command line shell and you would want to see which directory you are currently working.  What command could you type to see this?
  A. pwd
  B. ls
  C. touch
  D. echo
A

A. pwd (Your Answer)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q
If you are working in a shell command line and wanted to see a more detailed view of your directories, which parameter option could you add to the ls command to accomplish this?
  A. ls -a
  B. ls
  C. ls -z
  D. ls -l
A

D. ls -l

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q
If you are working in a shell command line and were in your Documents directory and wanted to switch views to your Downloads directly, what could you type to accomplish this?
  A. Downloads
  B. ls Downloads
  C. cd Downloads
  D. dc Downloads
A

C. cd Downloads

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q
If you are working in a shell command line and needed to see a list of all the hidden files in your directories what ls parameters could you use to do this?
  A. ls -al
  B. ls -l
  C. ls show all
  D. ls -all
A

A. ls -al

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

Which of the following is a shortcut for the ls -al command in a shell prompt?
A. aa
B. ls ls
C. ll (note: these are two lower case L;s)
D. There is no shortcut to accomplish this.

A

C. ll (note: these are two lower case L;s)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q
A(n) \_\_\_\_\_ variable is one that is active to any command or program that is run at the shell command
  A. present
  B. environment
  C. encased
  D. active
A

B. environment

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q
If you were working in a shell command prompt and wanted to go back to a previous command you used a few minutes ago, what keyboard character would allow you to do this?
  A. Down arrow key
  B. h
  C. Up arrow key
  D. Ctrl + Alt + Del
A

C. Up arrow key

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q
If you were working in a shell command prompt and needed to see all of the information regarding your PC, what parameter could you use with the uname command to accomplish this task?
  A. uname -a
  B. uname -l
  C. uname -h
  D. uname -r
A

A. uname -a

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q
If you were working in a shell command prompt and wanted to redirect your output stream to a file instead of just having it show up in your shell command prompt on the screen, what keyboard character is the most command to accomplish this
  A. $
  B. >
  C. <
  D. @
A

B. >

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q
If you were working in a shell command prompt and wanted to save a list of all the directories in your Linux system to a text file called output.txt, which of the following commands is the best one to accomplish this?
  A. ls < output.txt
  B. ls output.txt
  C. cat output.txt
  D. ls > output.txt
A

D. ls > output.txt

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q
Sending the output of one command to the input of another command is known as \_\_\_\_ in Linux.
  A. piping
  B. picking
  C. pipelining
  D. popping
A

A. piping

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q
If you were working in a shell command prompt and wanted to see a list of all the currently running processes on your Linux PC, what command could you use to accomplish this?
  A. sp
  B. whereami
  C. ps
  D. proc
A

C. ps

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q
Which Linux piping command will search a file and will return any matching terms?
  A. group
  B. grep
  C. awk
  D. echo
A

B. grep

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

If you were working in a shell command prompt and wanted to show the output of two text files called output1.txt and output2.txt at the same time, which command could you use to accomplish this?
A. cat output1 output2
B. show output1 output2
C. grep output1 output2
D. This cannot be accomplished from a Linux shell command line prompt.

A

A. cat output1 output2

17
Q
If you were working in a shell command prompt and sorted a file called numbers.txt that showed the following (see image below), but wanted to have it show in reverse order with the 9 at the top and the 1 at the bottom, which parameter could you use with sort command to do this? 
  A. sort -r
  B. sort -b
  C. sort -o
  D. sort -R
A

A. sort -r

18
Q
If you wanted to view a file (or portions of a file) from a Linux command line prompt, which commands would allow you to do this? (choose three)
  A. cat (Your Answer)
  B. touch (Your Answer)
  C. tail
  D. head
  E. echo
  F. grep (Your Answer)
A

A, C, D

19
Q
If you are in a Linux command line shell and wanted to see how many words, lines, or characters were in a file called numbers.txt, which command could you use to accomplish this?
  A. cw numbers.txt
  B. word txt.
  C. wc numbers.txt
  D. cat numbers.txt
A

C. wc numbers.txt

20
Q
If you were in a Linux command line shell and needed to search for a file in both your directories and subdirectories and the ls command does not accomplish this task for you, which of the following commands could you use instead?
  A. find
  B. echo
  C. touch
  D. search
A

A. find

21
Q
Which Linux command will allow you to copy files and directories?
  A. touch
  B. copy
  C. cp
  D. touch
A

C. cp

22
Q
If you were in a Linux shell command line and wanted to move a directory or file, which command could you use to do this?
  A. cp
  B. move
  C. redirect
  D. mv
A

D. mv

23
Q
Which Linux command will allow you to delete an empty directory?
  A. rmdir
  B. remove
  C. mv
  D. rm
A

A. rmdir

24
Q
Which Linux command line prompt will allow you to update the date a file was last accessed?
  A. echo
  B. touch
  C. cat
  D. update
A

B. touch

25
Q
If you run a program using the Linux shell command, does it run in by default in the foreground or background?
  A. Background
  B. Foreground
  C. Both A and B are correct.
  D. Neither A or B are correct.
A

A. Background