VMWARE Linux Command Prompt Flashcards
What does $cd / do?
Take you to the root directory
What does $cd ~
Take you to the home directory
what does $pwd do?
pwd shows you the current directory your in / route or pathway
What does $ls do?
lists all the directorys and files in the current directory.
$cd ..
goes back a directory/goes out a directory
What is absolute addressing?
Absolute addressing takes you straight to the place you want to go
starting from the root.
e.g.
$cd /lib/books
What is relative adressing?
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
What does $mv file1.txt milo
it moves file1.txt into the milo directory
What does $mkdir milo
Makes a directory called milo
What does $rm -r milo
deletes the directory called milo
(You have to add a -r if you’re trying to delete a directory)
What does $rm file1.txt
deletes the file1.txt
What does $man mv
Shows a manual page of mv/instructions of what it does
What does $touch file1.txt do?
It creates the file called file1.txt
What does $echo funny guy > file1.txt do?
puts funny guy into file1.txt
What does $cat file1.txt do?
It shows the contents of the file1.txt
$Ps a
Shows all running directory’s or files.
What does $bash rage.sh do?
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)
What does $mv file1.txt file2.txt do?
this changes the name of file1.txt into file2.txt
$ps a
Shows users running directories and files
How do I open a gedit file? and what is it used for?
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.
What does $cp file1.txt do?
copies the file1.txt and replaces the file1.txt if there is a file called file1.txt
What usual format of an user input script?
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.
What does $cp -i file1.txt do?
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
What is the format of a while loop that contains string in a script?
i=”Rah”
while [ $i == “Rah” ]
do
echo “I will find you”
i= “Found you”
done