cd |
Shows your home directory |
cd <folder> |
Change to a specific directory |
cd ~ |
Home directory, e.g. ‘cd ~/folder/’ |
cd / |
Root of drive |
ls |
Shows a listing of all files in the current directory |
ls -C |
Sort files or entries by size |
ls -lt |
List the files sorted by time modified (most recent first) |
ls -l |
Shows a long listing of all files in the current directory. |
ls -a |
Listing including hidden files |
ls -lh |
Long listing with human readable file sizes ( KB, MB, or GB) |
ls -R |
Shows the entire contents of folder recursively |
top |
Displays the active processes. Press q to quit |
q |
Exit |
clear |
Clear the screen |
touch <file> |
Create a new file with no extension |
pwd |
Full path to the working directory |
.. |
Parent directory |
ls -l .. |
Long listing of parent directory |
cd ../../ |
Move 2 levels up |
. |
Current folder |
cat |
The current folder |
rm <file> |
Remove a file |
rm -i <file> |
Remove with confirmation |
rm -r <dir> |
Remove a directory and its contents - Use with caution! |
rm -f <file> |
Force a removal without confirmation |
rm -i <file> |
Will display prompt before removal |
cp <file> <newfile> |
Copy a file to file |
cp <file> <dir> |
Copy a file to a directory |
mv <file> <new filename> |
Move/Rename a file |
mkdir <dir> |
Create new directory named <dir> |
mkdir <dir> <dir2> <dir3> |
Create multiple directories at once |
mkdir -p <dir>/<dir> |
Create nested directories |
rmdir <dir> |
Remove an entire directory ( only works on empty directories ) |
find <dir> -name <“file"> |
Find all files named <file> inside <dir>. Use wildcards (*) to search for partial filenames |