Command Line (CLI) Flashcards

1
Q

What does the CLI stand for?

A

Command Line Interface

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

What is the Command Line used for?

A

The most common use of the command line is what’s called “system administration” or, basically, managing computers and servers.

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

What is cd?

A

Change Directory

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

What is ls?

A

List files and directories in current directory.

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

What is the pwd command?

A

Display the path of the current directory.

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

What command is used to create a file?

A

touch

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

How do you know when you are in the “root” directory?

A

/

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

What command is the one to find out which flags a command uses and what they mean?

A

man tar

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

___ stands for your home directory

A

~

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

How would you create a directory named practice?

A

mkdir practice

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

If you wanted to rename example.txt to example1.txt how would you do it in the command line?

A

mv example.txt example1.txt

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q
$ # Rename example.txt to example1.txt
$ (fill in the command here)
$ ls
example1.txt
$ # Make another directory named tmp
$ (fill in command here)
$ # Move example1.txt to the new "tmp" directory
$ (fill in command here)
$ ls tmp
example1.txt
$ ls
tmp
$ # Move it back and rename it
$ (fill in command here)
$ ls
example2.txt tmp
A
$ # Rename example.txt to example1.txt
$ mv example.txt example1.txt
$ ls
example1.txt
$ # Make another directory
$ mkdir tmp
$ # Move example1.txt to the new "tmp" directory
$ mv example1.txt tmp
$ ls tmp
example1.txt
$ ls
tmp
$ # Move it back and rename it
$ mv tmp/example1.txt example2.txt
$ ls
example2.txt tmp
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What is the difference between:

/home/ubuntu & home/ubuntu

A

/home/ubuntu This path specifies a folder called ubuntu that lives in a directory called home, which is itself in the root directory.

home/ubuntu This path specifies a completely different folder. This path means there’s a folder called ubuntu that lives in a directory called home, which is itself in the current directory.

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

What command can we use to remove a file or directory?

A

rm

an example is: rm example.txt

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

Create a directory in your home directory called “cli-tmp”.

A

mkdir ~/cli-tmp

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

Create a nested set of directories in your home directory: cli-tmp > parents > children > grandchildren (hint: use the -p flag to do it all at once)

A

mkdir -p ~/cli-tmp/parents/children/grandchildren

17
Q

Navigate to children

A

cd ~/cli-tmp/parents/children

18
Q

Move the file named “bob” to the grandchildren directory.

A

mv bob grandchilderen