Command Line Basics Flashcards

1
Q

What is the command line?

A

A window where accepted syntax entered in by the developer will have the computer run a certain set of commands.

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

How do you open the command line on your computer?

A

Use the search shortcut on your OS to find your respective CLI.

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

How can you navigate to a particular directory?

A

‘cd directory-name’

If it’s a directory in a directory you’ll have to type in its respective parent directories.

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

Where will cd on its own navigate you to?

A

The home directory.

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

Where will cd .. navigate you to?

A

The parent directory.

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

How do you display the name of the directory you are currently in?

A

‘pwd’

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

How do you display the contents of the directory you are currently in?

A

‘ls’

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

How do you create a new directory?

A

‘mkdir directory-name’

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

How do you create a new file?

A

‘touch file-name’

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

How do you destroy a directory or file?

A

‘rm file-name’ to remove a file

‘rmdir directory-name’ or ‘rm -d directory-name’ to remove a directory (if it’s empty)

‘rm -rf directory-name’ to remove a directory and it’s content

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

How do you rename a directory or file?

A

‘git mv old-directory-name new-directory-name’ to rename a directory.

‘git mv old-file-name new-file-name’ to rename a file.

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