Basics Flashcards

1
Q

what is ‘pwd’?

A

Means “Print Working Directory” shows the current path you are in

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

‘hostname’?

A

Gives the name of the session hosting computer (usually your computer).

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

‘mkdir’?

A

Make directory: “mkdir temp”

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

how do you work with directories with spaces?

A

Add quotes around the name of the directory. I.e., MKDIR “new dir”

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

How do you create a long path nested directories with MKDIR in a single command?

A

MKDIR -p dir1/dir2/dir3/dir4/etc. -p means PATH

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

“cd”?

A

Change directory

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

“ls”?

A

List Directory

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

“RMdir”? And how to do with content inside?

A

Remove directory. Add -r to remove the directory and “recursively” remove all content as well.

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

“touch”?

A

Create a file

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

“cp”?

A

Copy a file or directory. CP a.txt b.txt When copying directories with stuff in it, must use the recursive flag -r to recursively copy contents as well

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

“mv”?

A

For “moving” files. But what it really does is rename the file. It’s moving the contents of a file to a new file name and deleting the old file. MV 1.txt 2.txt OR, you can move the file to a different directory name intact: MV 1.txt docs/ This also works for directories as well

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

“less” / “More” difference?

A

Both are to view a file. Less is to view in a single stream where you can page up and down. Need to hit “Q” to exit. More is to view it one page at a type linearly.

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

“cat”?

A

Short for concatenate. Use to stream a file or any concatenation of files. CAT A.txt B.txt C.txt

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

what does . mean?

A

Current directory

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

“rm”

A

Remove (delete) file or directory. Use -r to recursively delete all contents of a directory you are removing

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

which?

A

tells you where a program exists