Command Line Basics Flashcards
What is the command line?
A window where accepted syntax entered in by the developer will have the computer run a certain set of commands.
How do you open the command line on your computer?
Use the search shortcut on your OS to find your respective CLI.
How can you navigate to a particular directory?
‘cd directory-name’
If it’s a directory in a directory you’ll have to type in its respective parent directories.
Where will cd on its own navigate you to?
The home directory.
Where will cd .. navigate you to?
The parent directory.
How do you display the name of the directory you are currently in?
‘pwd’
How do you display the contents of the directory you are currently in?
‘ls’
How do you create a new directory?
‘mkdir directory-name’
How do you create a new file?
‘touch file-name’
How do you destroy a directory or file?
‘rm file-name’ to remove a file
‘rmdir directory-name’ or ‘rm -d directory-name’ to remove a directory (if it’s empty)
‘rm -rf directory-name’ to remove a directory and it’s content
How do you rename a directory or file?
‘git mv old-directory-name new-directory-name’ to rename a directory.
‘git mv old-file-name new-file-name’ to rename a file.