VMWARE Linux Command Prompt Flashcards

1
Q

What does $cd / do?

A

Take you to the root directory

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

What does $cd ~

A

Take you to the home directory

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

what does $pwd do?

A

pwd shows you the current directory your in / route or pathway

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

What does $ls do?

A

lists all the directorys and files in the current directory.

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

$cd ..

A

goes back a directory/goes out a directory

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

What is absolute addressing?

A

Absolute addressing takes you straight to the place you want to go
starting from the root.
e.g.

$cd /lib/books

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

What is relative adressing?

A

Relative addressing takes you to the place you want to go in steps. starting from the current directory for example.
e.g.

$cd ../../lib/books

As you can see this doesn’t start with a / as well because its relative

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

What does $mv file1.txt milo

A

it moves file1.txt into the milo directory

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

What does $mkdir milo

A

Makes a directory called milo

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

What does $rm -r milo

A

deletes the directory called milo
(You have to add a -r if you’re trying to delete a directory)

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

What does $rm file1.txt

A

deletes the file1.txt

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

What does $man mv

A

Shows a manual page of mv/instructions of what it does

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

What does $touch file1.txt do?

A

It creates the file called file1.txt

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

What does $echo funny guy > file1.txt do?

A

puts funny guy into file1.txt

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

What does $cat file1.txt do?

A

It shows the contents of the file1.txt

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

$Ps a

A

Shows all running directory’s or files.

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

What does $bash rage.sh do?

A

bash is the first word before running a script.
for example.
bash rage.sh
If there is any code in the file it will run for example:
cat file1.txt – (This will print the contents of file1.txt when $bash rage.sh is run)

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

What does $mv file1.txt file2.txt do?

A

this changes the name of file1.txt into file2.txt

16
Q

$ps a

A

Shows users running directories and files

17
Q

How do I open a gedit file? and what is it used for?

A

You open a gedit file by doing
gedit rage.sh
This creates a file/script called rage.sh
This could be used to run scripts. The use of it depends on the scripts implemented into the file.

17
Q

What does $cp file1.txt do?

A

copies the file1.txt and replaces the file1.txt if there is a file called file1.txt

17
Q

What usual format of an user input script?

A

echo “Do you like tacos?”
read [input variable] -in this case well do choice
read choice - this would be in line 2, choice is the input variable.
Wow, $choice is an interesting choice.

18
Q

What does $cp -i file1.txt do?

A

copies the file1.txt and replaces the file1.txt but asks if the user wants to replace the file if there is a file called file1.txt

18
Q

What is the format of a while loop that contains string in a script?

A

i=”Rah”
while [ $i == “Rah” ]
do
echo “I will find you”
i= “Found you”
done

19
Q

What is the format of a while loop that contains integers?

A

i= 0
while [ i !lt 9 ]
then
((i++))
done

20
Q

What is the format of an if statement that contains string in a script?

A
21
Q

What is the format of an if statement that contains integers in a script?

A
22
Q

What is a benchmark?

A
23
Q

What are wildcards and what do each characters do?

A

Wildcards are characters that fill in gaps for the user, if inputted.
This is to save time for the user if there’s a specific code or to shorten down the list.

e.g.
* - is for multiple characters
? - single character

24
Q

What would $find P*d search for?

A

anything starting with p and ending with d how many characters are in between p and d. (Inbetween the f and shire btw)

25
Q

What would $find f??dshire search for

A

would search for words containing f and ending with shire along with 2 characters in between them. (Inbetween the f and shire btw)

26
Q

What does $ls -l do?

A

lists the files and directories in a long listing format. (current directory)

27
Q

What does $ls -r do?

A

lists the files and directories in reversing order (current directory)

28
Q

What does $ls -lt do?

A

lists the files in order of modification. (current directory)

29
Q

What does $ls -lS do?

A

lists the files in order of size. (current directory)

30
Q

What does $ls -d do?

A

Lists the directories themselves, not their contents.

31
Q

What does $exit do?

A

Exits the shell.

32
Q

What does $clear do?

A

“clears” the command prompt/shell
but it takes you further down
I’d say clears the shell/command prompt.

33
Q

what does $date do?

A

shows the systems date

34
Q

what does ls -d/etc

A

lists all the files in the etc folder.

35
Q

what does tail -n funny.txt do?

A

it displays the last 10 lines of funny.txt

36
Q

what does head -n funny.txt do?

A

displays the first 10 lines of funny.txt

37
Q

what does stat do?

A

shows the statistics of the files and directories.