Chapter 3 Flashcards

1
Q

touch

A

command to create new empty files
touch fileName1 fileName2 fileName3

primary purpose of touch is to change the file’s time stamp and date stamp

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

rm

A

(remove) command to delete files or directories

rm fileName* to remove all files starting with fileName

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

rm -i

A

display a warning prompt before deleting a file or directory

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

rm -r

A

when deleting a directory, recursively deletes its files and subdirectories

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

mkdir

A

make directory command

mkdir directoryName

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

mkdir -v

A

display a verification message after directory creation

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

mkdir -p

A

mkdir –p (parent) option can be used to create parent directories while creating lower level directories.
* You can create multiple levels of directories including all the directories in a pathname simultaneously.
* For example, mkdir –p grandparent/parent/child

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

rmdir

A

remove an empty directory

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

cp

A

copy command to copy a file
requires two arguments
1. source file or directory (multiples are ok)
2. target file or directory

cp /the/copyFile /destination/toCopy

if toCopy is a subdirectory then copyFile will be saved in that subdirectory. If toCopy is not a subdirectory copyFile will be saved under the name toCopy.

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

cp -b

A

makes a backup of the destination file if the copy will overwrite a file

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

cp -i

A

provides a warning when you are about to overwrite a file

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

cp -u

A

specifies to only overwrite if the file you are copying is newer than the one you are overwriting

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

cp -r

A

recursive: referring to itself and its own contents. recursive search includes all subdirectories in a directory and their contents

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

cat

A

concatenate
display the contents of one or more text files on the terminal

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

tac

A

tac is cat spelled backwards. displays contents of files in reverse order

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

head

A

displays the first ten lines of a file

17
Q

tail

A

displays the last ten lines of a file

18
Q

more

A

displays text files page-by-page
spacebar key goes to next page
enter key goes to next line
b to go backward
f to go forward

19
Q

less

A

same as more but allows you to use arrow keys to scroll up and down the contents of file
b to go backward
f to go forward
gn goes to n line
q to quit

20
Q

strings command

A

searches for and displays text characters in a binary file.

strings /location/file

21
Q

cat -n

A

display the line number of each line in the file in addition to the contents