Command Line (CLI) Flashcards
What does the CLI stand for?
Command Line Interface
What is the Command Line used for?
The most common use of the command line is what’s called “system administration” or, basically, managing computers and servers.
What is cd?
Change Directory
What is ls?
List files and directories in current directory.
What is the pwd command?
Display the path of the current directory.
What command is used to create a file?
touch
How do you know when you are in the “root” directory?
/
What command is the one to find out which flags a command uses and what they mean?
man tar
___ stands for your home directory
~
How would you create a directory named practice?
mkdir practice
If you wanted to rename example.txt to example1.txt how would you do it in the command line?
mv example.txt example1.txt
$ # 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
$ # 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
What is the difference between:
/home/ubuntu & home/ubuntu
/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.
What command can we use to remove a file or directory?
rm
an example is: rm example.txt
Create a directory in your home directory called “cli-tmp”.
mkdir ~/cli-tmp