Linux Commands Flashcards
pwd
Finds the path of the current working directory.
cd
Used to navigate through files and directories.
cd ..
Go to the parent directory.
cd-
Move to the previous directory.
ls
View contents of the current directory.
ls -R
List contents of current directory and sub-folders.
ls -a
List contents of the current directory and show hidden files.
ls -al
List contents of the current directory with detailed information like permissions, size, owner, ect.
cat
Lists the contents of a file on the standard output (sdout).
cp
Copy, copies files from the current directory to a different directory. Format cp ‘file’ ‘new directory’
mv
Move, used to move the directory of files, can also be used to rename files.
mkdir
Make a directory, used to make a new directory.
rmdir
Remove directory, only allows removal of empty directories.
rm
Removes files.
rm -r
Removes a directory and all the files within.
touch
Create a blank new file.
locate
Used to find a file, like a search bar in windows file explorer.
locate -i
Used to find a file however is case sensitive.
find
Used to find files and directories, can be used to find files within a given directory.
grep
Let’s you search through all text in a file.
sudo
Super-user do, perform an action with root permission.
df
Gives a report on the systems disk space usage.
du
Used to show how much space a file or directory takes up on a disk however will show block numbers rather than usual size, -h argument shows size unit.
head
Used to view the first 10 lines of any text file.