CSC 352 bash commands Flashcards

1
Q

absolute path

A

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

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

relative path

A

A path that is relative to the current working directory.

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

/

A

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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
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
5
Q

home directory

A

The directory where that user’s files typically reside.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
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
7
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
8
Q

ls

A

The command that prints the contents of the named directory .

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
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
10
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
11
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
12
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
13
Q

man

A

The command “manual page” for a given command

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

mkdir

A

The command to create a new directory

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

cd

A

The command to change the current working directory to

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

~

A

The user’s home directory

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

cp

A

The command to make a copy of as

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

cp

A

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

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

mv

A

The command to rename (and possibly move) as

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

mv

A

The command to move a file to another directory

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

rm

A

The command to delete file(s)

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

rm -r

A

The command to delete a directory and all its contents.

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

rmdir

A

The command to delete an empty directory

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

cat

A

The command to print the contents of the named file

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

head

A

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

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

tail

A

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

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

more

A

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

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

grep

A

Print the lines in a file that contain

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

wc

A

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

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

echo

A

Print the

31
Q

sort –n

A

Print the lines of sorted in numeric order

32
Q

sort

A

Print the lines of sorted in alphabetical order

33
Q

>

A

The redirection that causes the stdout of to be stored in the file

34
Q

<

A

The redirection that causes the stdin of to come from the file

35
Q

> >

A

The redirection that causes the stdout of to be appended to the file

36
Q

|

A

The redirection that causes the stdout of to be the stdin of the command

37
Q

stdin

A

The name of the input stream

38
Q

stdout

A

The name of the output stream

39
Q

stderr

A

The name of the error stream

40
Q

char x;

A

How to declare variable x as a character.

41
Q

int x;

A

How to declare variable x as an integer.

42
Q

char *p;

A

How to declare variable p as a pointer to a character.

43
Q

int *p;

A

How to declare variable p as a pointer to an integer.

44
Q

int z[10];

A

How to declare variable z as an array of 10 integers.

45
Q

char z[10];

A

How to declare variable z as an array of 10 characters.

46
Q

*p

A

How to dereference the pointer p, to refer to the value held at the address held in p.

47
Q

/dev/null

A

The permanently empty file

48
Q

touch

A

Create an empty file at , or update its modification time

49
Q

date

A

Print the current date and time

50
Q

file

A

Print the type of file at

51
Q

command 2>

A

Run , sending stderr to

52
Q

command &>

A

Run , sending stdout and stderr to

53
Q

kill -9

A

Kill the process with ID

54
Q

make

A

Build the target using the Makefile in the current directory

55
Q

history

A

Print the command history

56
Q

=

A

Set the shell variable to

57
Q

“…”

A

Shell quotation that expands variables and interprets some special characters

58
Q

…’

A

Shell quotation that interprets everything literally

59
Q

...

A

Shell quotation that runs the command inside and substitute its output

60
Q

USER

A

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

61
Q

HOME

A

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

62
Q

PATH

A

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

63
Q

SHELL

A

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

64
Q

PWD

A

The shell environment variable set to the current working directory

65
Q

source

A

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

66
Q

$?

A

The exit status of the last command

67
Q

cmd1 ; cmd2

A

Run cmd1, then run cmd2

68
Q

cmd1 && cmd2

A

Run cmd1, then run cmd2 only if cmd1 succeeded

69
Q

cmd1 || cmd2

A

Run cmd1, then run cmd2 only if cmd1 failed

70
Q

[[ ]]

A

Test if is true

71
Q

$(…)

A

Run the command inside and return its output

72
Q

$((…))

A

Evaluate the arithmetic expression inside

73
Q

$

A

Substitute the value of the shell variable

74
Q

(cmd)

A

Run cmd in a subshell