Git Bash Flashcards
How do you see the current directory?
pwd
How do you change directories?
cd
How do you see every file in the current directory?
ls
How do you clear the terminal?
clear
What does pwd do?
It tells you the current directory.
What does cd do?
It changes directories.
What does ls do?
It shows every file in the current directory.
What does clear do?
It clears the terminal.
How do you see the contents of the home directory?
ls ~
What does ls ~ do?
It shows the contents of the home directory.
How do you go one directory back?
../
How do you list all the files in long format?
ls -l.
What does ls -l do?
It lists all the files in a long format.
How do you see all files in a directory, including hidden ones?
ls -a
What does ls -a do?
It shows all files in the current directory, including hidden ones.
How do you sort a directory by size?
ls -lS
What does ls -lS do?
It sorts the directory by size.
How do you list all the files with the .txt extension in the Documents folder?
ls /Documents/*txt
What does ls /Documents/*txt do?
It lists all the files with the .txt extension in the Documents folder.
How do you save a text file with the ls output?
> out.txt
What does > out.txt do?
It saves a text file with the ls output.
How do you list out all the directories?
ls -d */
What does ls -d */ do?
It lists out all the directories.
What does the cd command do on its own?
It brings you to the current home directory.