Review Flashcards

1
Q

“absolute path”

A

A path the 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

“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
5
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
6
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
7
Q

ls «directorypath»

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
8
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
9
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
10
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
11
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
12
Q

man «command»

A

The command “manual page” for a given command

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

mkdir «directorypath»

A

The command to create a new directory.

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

cd «directorypath»

A

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

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

~

A

The user’s home directory

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

cp «fromfilepath» «tofilepath»

A

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

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

cp «fromfilepath» «directorypath»

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
18
Q

mv «fromfilepath» «tofilepath»

A

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

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

mv «fromfilepath» «directorypath»

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
20
Q

rm «filepath»

A

The command to delete file(s).

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

rm -r «directorypath»

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
22
Q

rmdir «directorypath»

A

The command to delete an empty directory

23
Q

cat «filepath»

A

The command to print the contents of the named file

24
Q

head «filepath»

A

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

25
Q

tail «filepath»

A

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

26
Q

more «filepath»

A

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

27
Q

grep «word» «filepath»

A

Print the lines in a file that contain «word»

28
Q

wc «filepath»

A

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

29
Q

echo «command line»

A

Print the «command line»

30
Q

sort -n «filepath»

A

Print the lines of the file sorted in numeric order

31
Q

sort «filepath»

A

Print the lines of the file sorted in alphabetical order

32
Q

“current working directory”

A

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

33
Q

ls «dirpath»

A

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

34
Q

mkdir «dirpath»

A

The command to create a new directory, «dirpath»

35
Q

cd «dirpath»

A

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

36
Q

cp «frompath» «topath»

A

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

37
Q

cp «frompath» «dirpath»

A

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

38
Q

mv «frompath» «topath»

A

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

39
Q

mv «frompath» «dirpath»

A

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

40
Q

rm -r «dirpath»

A

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

41
Q

«command» > «topath»

A

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

42
Q

«command» < «frompath»

A

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

43
Q

«command»&raquo_space; «topath»

A

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

44
Q

«fromcommand» | «tocommand»

A

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

45
Q

“stdin”

A

The name of the input stream

46
Q

“stdout”

A

The name of the output stream

47
Q

“stderr”

A

The name of the error stream

48
Q

char x;

A

How to declare variable x as a character.

49
Q

int x;

A

How to declare variable x as an integer.

50
Q

char *p;

A

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

51
Q

int *p;

A

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

52
Q

int z[10];

A

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

53
Q

char z[10];

A

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

54
Q

*p

A

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