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
What is the format of a while loop that contains integers?
i= 0 while [ i !lt 9 ] then ((i++)) done
20
What is the format of an if statement that contains string in a script?
21
What is the format of an if statement that contains integers in a script?
22
What is a benchmark?
23
What are wildcards and what do each characters do?
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
What would $find P*d search for?
anything starting with p and ending with d how many characters are in between p and d. (Inbetween the f and shire btw)
25
What would $find f??dshire search for
would search for words containing f and ending with shire along with 2 characters in between them. (Inbetween the f and shire btw)
26
What does $ls -l do?
lists the files and directories in a long listing format. (current directory)
27
What does $ls -r do?
lists the files and directories in reversing order (current directory)
28
What does $ls -lt do?
lists the files in order of modification. (current directory)
29
What does $ls -lS do?
lists the files in order of size. (current directory)
30
What does $ls -d do?
Lists the directories themselves, not their contents.
31
What does $exit do?
Exits the shell.
32
What does $clear do?
"clears" the command prompt/shell but it takes you further down I'd say clears the shell/command prompt.
33
what does $date do?
shows the systems date
34
what does ls -d/etc
lists all the files in the etc folder.
35
what does tail -n funny.txt do?
it displays the last 10 lines of funny.txt
36
what does head -n funny.txt do?
displays the first 10 lines of funny.txt
37
what does stat do?
shows the statistics of the files and directories.