bash - bash38-end Flashcards

1
Q

/dev/null

A

The permanently empty file

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

touch «filepath»

A

Create an empty file at «filepath», or update its modification time

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

date

A

Print the current date and time

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

file «filepath»

A

Print the type of file at «filepath»

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

command 2> «filepath»

A

Run «command», sending stderr to «filepath»

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

command &> «filepath»

A

Run «command», sending stdout and stderr to «filepath»

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

kill -9 «pid»

A

Kill the process with ID «pid»

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

make «target»

A

Build the target «target» using the Makefile in the current directory

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

history

A

Print the command history

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

«name»=«value»

A

Set the shell variable «name» to «value»

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

A

Shell quotation that expands variables and interprets some special characters

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

…’

A

Shell quotation that interprets everything literally

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

...

A

Shell quotation that runs the command inside and substitute its output

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

USER

A

The shell environment variable set to the name of the current user

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

HOME

A

The shell environment variable set to the home directory of the current user

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

PATH

A

The shell environment variable set to the directories to search for commands

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

SHELL

A

The shell environment variable set to the path of the current shell

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

PWD

A

The shell environment variable set to the current working directory

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

source «filepath»

A

Execute the commands in «filepath» in the current shell (as if they were typed)

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

$?

A

The exit status of the last command

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

cmd1 ; cmd2

A

Run cmd1, then run cmd2

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

cmd1 && cmd2

A

Run cmd1, then run cmd2 only if cmd1 succeeded

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

cmd1 || cmd2

A

Run cmd1, then run cmd2 only if cmd1 failed

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

[[ «condition» ]]

A

Test if «condition» is true

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

$(…)

A

Run the command inside and return its output

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

$((…))

A

Evaluate the arithmetic expression inside

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

$«name»

A

Substitute the value of the shell variable «name»

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

(cmd)

A

Run cmd in a subshell

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

“current working directory”

A

The directory the shell uses as a reference point for relative paths.

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

home directory

A

What you call the directory where that user’s files typically reside.

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

pwd

A

The command that prints the shell’s current working directory

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

ls

A

The command that prints the contents (files and directories) in the current working directory.

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

ls «dirpath»

A

The command that prints the contents of the named directory, «dirpath».

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

ls –a

A

The command to print directory contents including hidden files

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

ls –l

A

The command to print directory contents in a long, more descriptive format

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

.

A

The hidden directory that refers to the directory itself

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

..

A

The hidden directory that refers to a directory’s parent directory

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

man «command»

A

The command to show the “manual page” for «command»

39
Q

mkdir «dirpath»

A

The command to create a new directory, «dirpath»

40
Q

cd «dirpath»

A

The command to change the current working directory to «dirpath»

41
Q

~

A

The user’s home directory

42
Q

cp «frompath» «topath»

A

The command to make a copy of «frompath» as «topath»

43
Q

cp «frompath» «dirpath»

A

The command to make a copy of a file, «frompath», in another directory, «dirpath»

44
Q

mv «frompath» «topath»

A

The command to rename (and possibly move) «frompath» as «topath»

45
Q

mv «frompath» «dirpath»

A

The command to move a file, «frompath», to another directory, «dirpath»

46
Q

rm «filepath»

A

The command to delete file, «filepath»

47
Q

rm -r «dirpath»

A

The command to delete a directory, «dirpath», and all its contents.

48
Q

cat «filepath»

A

The command to print the contents of «filepath»

49
Q

head «filepath»

A

The command to print the first 10 lines of «filepath»

50
Q

tail «filepath»

A

The command to print the last 10 lines of «filepath»

51
Q

more «filepath»

A

The command to print contents of «filepath», one screen at a time.

52
Q

grep «word» «filepath»

A

Print the lines in «filepath» that contain «word»

53
Q

wc «filepath»

A

Print the number of lines, words, and characters in «filepath»

54
Q

sort «filepath»

A

Print the lines of «filepath» sorted in alphabetical order

55
Q

«command» > «topath»

A

The redirection that causes the stdout of «command» to be stored in the file «topath»

56
Q

«command» < «frompath»

A

The redirection that causes the stdin of «command» to come from the file «frompath»

57
Q

«command»&raquo_space; «topath»

A

The redirection that causes the stdout of «command» to be appended to the file «topath»

58
Q

«fromcommand» | «tocommand»

A

The redirection that causes the stdout of «command» to be the stdin of the command «tocommand»

59
Q

stdin

A

The name of the input stream

60
Q

stdout

A

The name of the output stream

61
Q

stderr

A

The name of the error stream

62
Q

absolute path

A

A path the is fully specified from the root directory down.

63
Q

relative path

A

A path that is relative to the current working directory.

64
Q

/

A

The root directory OR the character to separate directories in a path.

65
Q

“current working directory”

A

The directory the shell uses as a reference point for relative paths.

66
Q

home directory

A

The directory where that user’s files typically reside.

67
Q

pwd

A

The command that prints the shell’s current working directory

68
Q

ls

A

The command that prints the contents (files and directories) in the current working directory.

69
Q

ls «directorypath»

A

The command that prints the contents of the named directory.

70
Q

ls –a

A

The command to print directory contents including hidden files

71
Q

ls –l

A

The command to print directory contents in a long, more descriptive format

72
Q

.

A

The hidden directory that refers to the directory itself.

73
Q

..

A

The hidden directory that refers to a directory’s parent directory.

74
Q

man «command»

A

The command “manual page” for a given command

75
Q

cd «directorypath»

A

The command to change the current working directory to «pathname»

76
Q

~

A

The user’s home directory

77
Q

cp «fromfilepath» «tofilepath»

A

The command to make a copy of «fromfile» as «tofile»

78
Q

cp «fromfilepath» «directorypath»

A

The command to make a copy of a file in another directory

79
Q

mv «fromfilepath» «tofilepath»

A

The command to rename (and possibly move) «fromfilepath» as «tofilepath»

80
Q

mv «fromfilepath» «directorypathpath»

A

The command to move a file to another directory

81
Q

rm «filepath»

A

The command to delete file(s).

82
Q

rm -r «directorypath»

A

The command to delete a directory and all its contents.

83
Q

rmdir «directorypath»

A

The command to delete an empty directory

84
Q

cat «filepath»

A

The command to print the contents of the named file

85
Q

head «filepath»

A

The command to print the first 10 lines of the named file

86
Q

tail «filepath»

A

The command to print the last 10 lines of the named file

87
Q

more «filepath»

A

The command to print the named file, one screen at a time.

88
Q

grep «word» «filepath»

A

Print the lines in a file that contain «word»

89
Q

wc «filepath»

A

Print the number of lines, words, and characters in the named file.

90
Q

echo «command line»

A

Print the «command line»

91
Q

sort –n «filepath»

A

Print the lines of the file sorted in numeric order

92
Q

sort «filepath»

A

Print the lines of the file sorted in alphabetical order

93
Q

mkdir «directorypath»

A

The command to create a new directory.