Chapter 2 - Access the Command Line Flashcards

1
Q

Shell

A

The interpreter that executes commands that are typed as string

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

Prompt

A

The visual cue that indicates that an interactive shell is waiting for the user to type a command

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

Command

A

The name of a program to run

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

Option

A

The part of the command line that adjusts the behavior of a command

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

Argument

A

The part of the command line that specifies the target that the command should operate on

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

Physical Console

A

The hardware display & keyboard to interact w/ a system

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

Virtual Console

A

One of multiple logical consoles that can each support an independent login session

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

Terminal

A

An interface that provides a display for output & a keyboard for input to a shell session

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

“tail -n 5 /var/log/messages”

A

Displays the last five lines of the /var/log/messages file

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

Semicolon ;

A

Separates commands on the same line

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

“passwd”

A

Used to change a user’s password

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

“file”

A

Displays the file type

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

Pressing Tab

A

Completes commands, file names, & options

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

“!number”

A

Re-executes a specific command in the history list

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

Ctrl+A

A

Jumps to the beginning of the command line

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

“history”

A

Displays the list of previously executed commands

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

Esc+

A

Copies the last argument or previous commands

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

Contains persistent, system-specific configuration data

A

/etc

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

is the top of the system’s file-system hierarchy

A

/

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

contains user home directories

A

/home

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

contains files to boot the system

A

/boot

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

contains system files to access hardware

A

/dev

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

is the administrative superuser’s home directory

A

/root

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

contains regular commands & utilities

A

/usr/bin

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

contains non-persistent process runtime data

A

/run

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

contains installed software programs & libraries

A

/usr

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

a world-writable space for temporary files

A

/tmp

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

system-specific variable data should persist b/t boots

A

/var

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

displays the full path name of the current working directory for that shell

A

“pwd”

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

lists directory contents for the specified directory, or, if no directory is given, for the current working directory

A

“ls”

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

change your shell’s current working directory

A

“cd”

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

changes to the previous directory, where the user was previously to the current directory

A

“cd -“

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

uses the hidden directory to move up one level to the parent directory w/o needing to know the exact parent name

A

“cd ..”

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

specifies the current directory on commands where the current location is either the source or destination argument

A

“cd .”

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

displayed when your current working directory is your home directory

A

”~”

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

updates the time stamp of a file to the current date & time w/o otherwise modifying it

A

“touch”

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

long listing format

A

“ls -l”

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

all files, including hidden files

A

ls -a”

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

recursive, to include the contents of all subdirectories

A

“ls -R”

40
Q

refers to the current directory

A

”.”

41
Q

refers to the parent directory

A

”..”

42
Q

Which command returns to your current home directory, assuming that the current working directory is /tmp & your home directory is /home/user?

A

“cd”

43
Q

Which command displays the absolute path name of the current location?

A

“pwd”

44
Q

Which command returns you to the working directory before the current working directory?

A

“cd -“

45
Q

Which command changes the working directory up two levels from the current location?

A

“cd ../..”

46
Q

Which command lists files in the current location, with a long format, & including hidden files?

A

“ls -al”

47
Q

Which command creates an empty file called “helloworld.py” in the “user” home directory, assuming that your current directory is “/home”?

A

“touch ~/helloworld.py”

48
Q

Which command changes the working directory to the parent of the current location?

A

“cd ..”

49
Q

Which command changes the working directory to “/tmp” if the current working directory is ‘/home/student?

A

“cd ../../temp”

50
Q

What shows subdirectories?

A

”/”

51
Q

Displays the full path name of the current working directory for that shell

o Helps to determine the syntax to reach files by using relative path names

A

“pwd”

52
Q

lists directory contents for the specified directory, or, if no directory is given, for the current working directory

A

“ls”

53
Q

change your shell’s current working directory

A

“cd”

54
Q

changes to the previous directory, where the user was previously to the current directory

A

“cd -“

55
Q

uses the hidden directory to move up one level to the parent directory w/o needing to know the exact parent name

A

“cd ..”

56
Q

specifies the current directory on commands where the current location is either the source or destination argument

A

“cd .”

57
Q

displayed when your current working directory is your home directory

A

”~”

58
Q

updates the time stamp of a file to the current date & time w/o otherwise modifying it

A

“touch”

59
Q

Long listing format

A

“ls -l”

60
Q

All files, including hidden files

A

“ls -a”

61
Q

recursive, to include the contents of all subdirectories

A

“ls -R”

62
Q

refers to the current directory

A

One dot (.)

63
Q

refers to the parent directory

A

Two dots (..)

64
Q

creates one or more directories or subdirectories

A

“mkdir”

65
Q

creates any missing parent directories for the requested destination

A

“mkdir -p” (parent)

66
Q

copies a file, & creates a file either in the current directory or in a different specified directory

A

“cp”

67
Q

copies directories & their contents

A

“cp -r”

68
Q

moves files from one location to another

A

“mv”

69
Q

displays a detailed output of the command operations

A

“mv -v”

70
Q

removes files, does NOT remove directories

A

“rm”

71
Q

enables the “rm” command to remove directories & their contents

A

“rm -r”

72
Q

interactively prompt for confirmation before deleting

A

“rm -i”

73
Q

determines whether 2 files are hard linked

A

“ls -i”

74
Q

can determine whether a file has multiple hard links; lists the inode number

A

“ls -i”

75
Q

lists the directories that are on different file systems

A

“df”

76
Q

creates a symbolic link, aka “soft link”

A

“ln -s”

77
Q

indicates that the file is a symbolic link & not a regular file

A

“l”

78
Q

updates current working directory by using the name of the symbolic link rather than the name of the actual directory

A

“cd”

79
Q
A
80
Q

Which command returns to your current home directory, assuming that the current working directory is /tmp & your home directory is /home/user?

A

“cd”

81
Q

Which command displays the absolute path name of the current location

A

“pwd”

82
Q

Which command returns you to the working directory before the current working directory?

A

“cd -“

83
Q

Which command changes the working directory up two levels from the current location?

A

“cd ../..”

84
Q

Which command lists files in the current location, with a long format, & including hidden files?

A

“ls -al”

85
Q

Which command creates an empty file called “helloworld.py” in the “user” home directory, assuming that your current directory is “/home”?

A

“touch ~/helloworld.py

86
Q

Which command changes the working directory to the parent of the current location?

A

“cd ..”

87
Q

Which command changes the working directory to “/tmp” if the current working directory is ‘/home/student?

A

“cd ../../temp”

88
Q

Which pattern matches only file names that end with “b”?

A

“*b”

89
Q

Which pattern matches only file names that begin with “b”?

A

“b*”

90
Q

Which pattern matches only file names where the first character is not “b”?

A

“[!b]*”

91
Q

Which pattern matches all file names that contain a “b”?

A

b

92
Q

Which pattern matches only file names that contain a number?

A

[[:digit:]]

93
Q

Which pattern matches only file names that begin w/ an uppercase letter?

A

“[[:upper:]]*”

94
Q

Which pattern matches only file names w/ at least 3 characters?

A

“???*”

95
Q

can nest command expansions inside each other

A

“$(command)”

96
Q

stops all shell expansion

A

Single quotation mark (‘)

97
Q

stops most shell expansion

A

Double quotation mark (“)