Module 3 Flashcards

1
Q

Which line will be displayed with the following command?

$ grep “^I” file1

  • I went to
  • How I wished
  • Jack and I
  • 208-496-1100
A

I went to

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

Find the match.

  • Home directory
  • Current directory
  • Parent directory
  • The root directory
A

Home directory ~

Current directory .

Parent directory ..

The root directory /

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

Identify the relative path names. (Select two)

  • ../../bin
  • /bin
  • Download
  • /root
A

../../bin

Download

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

Which command was entered at ____________________? (Select two)

[user1@localhost gdm]$ pwd

/etc/gdm

[user1@localhost gdm]$ ____________________

[user1@localhost share]$ pwd

/usr/share

  • cd ../../root/usr/share
  • cd ../../usr/share
  • cd ../usr/share
  • cd /usr/share
A

cd ../../usr/share

cd /usr/share

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

Which statement describes the regular expressions? (Select two)

  • Interpreted by the shell
  • Interpreted by text tool programs such as grep
  • Finds matches within text files
  • Finds matches in filenames
A

Interpreted by text tool programs such as grep

Finds matches within text files

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

Which statement is true for the regular expression metacharacter ‘?’ ?

  • Matches 0 or more occurrences of the previous character
  • Matches 0 or 1 occurrences of the previous character
  • Matches 1 or more occurrences of the previous character
  • Matches 1 occurrences of the previous character
A

Matches 0 or 1 occurrences of the previous character

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

What command was given for the following output?

[root@localhost dev]# __________

tty6 tty60 tty61 tty62 tty63

  • ls tty6?
  • ls tty6*
  • ls tty6[0-3]
  • ls tty6[0123]
A

ls tty6*

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

Which command is NOT used to display the content of a text file?

  • cat
  • dog
  • head
  • tail
A

dog

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

Which command was given for the output below?

A

ls -a

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

Which one is NOT a popular text editor on Linux?

  • vi
  • Emacs
  • Python
  • nano
A

Python

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

Which command would a user type on the command line to find out the current directory in the directory tree?

  • pd
  • cd
  • where
  • pwd
A

pwd

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

A user typed in the command pwd and saw the output: /home/jim/sales/pending. How could that user navigate to the /home/jim directory?

  • cd ..
  • cd /jim
  • cd ../..
  • cd ./.
A

cd ../..

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

Linux has only one root directory per directory tree.

  • True
  • False
A

True

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

The less command offers less functionality than the more command.

  • True
  • False
A

False

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

A user types the command head /poems/mary. What will be displayed on the terminal screen?

  • the first line of the file mary
  • the header for the file mary
  • the first 20 lines of the file mary
  • the last 10 lines of the file mary
  • the first 10 lines of the file mary
A

the first 10 lines of the file mary

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

Using wildcard metacharacters, how can you indicate a character that is not an a or b or c or d?

  • [^abcd]
  • not [a-d]
  • [!a-d]
  • !a-d
A

[!a-d]

17
Q

If “resume” is the name of a file in the home directory off the root of the filesystem and your present working directory is home, what is the relative name for the file named resume?

  • /home/resume
  • /resume
  • resume
  • \home\resume
A

resume

18
Q

What will the following wildcard regular expression return: file[a-c]?

  • filea-c
  • ilea, filec
  • filea, fileb, filec
  • fileabc
A

filea, fileb, filec

19
Q

Which of the following is an absolute pathname in Linux?

  • Home/resume
  • C:\myfolder\resume
  • resume
  • /home/resume
  • C:home/resume
A

/home/resume

20
Q

How can you specify a text pattern that must be at the beginning of a line of text using a regular expression?

  • Precede the string with a /
  • Follow the string with a \
  • Precede the string with a $
  • Precede the string with a ^
A

Precede the string with a ^