Linux Commands Flashcards
ls
List the contents of the directory you want
alias
Let’s you define temporary aliases in your shell session
Replace a word with a series of commands
unalias
Remove alias
pwd
print working directory
Ex: /home/john/Documents
cd
Change directory
cd ..
Move up a level
cd -
Return to previous directory
cp
Copy files and folder
Just add source and destination
Ex:
cp file_to_copy.txt new_file.txt
rm
Remove files and directories
cp -r
Copy entire directories
In Linux, files end with forward slash
rm -r
Delete empty dorectory
rm -rf
Remove directory with content
mv
Move or rename files and directories
Move:
mv source_file destination_folder/
Rename:
mv old_file_name.txt new_file_name.txt
mkdir
Create folders
mkdir -p
Create subdirectories
Ex:
mkdir -p movies/2004/
man
Displays manual page of any other command
Ex:
man mkdir
touch
Create new empty file
Ex:
touch new_file_name
chmod
Change the file permissions or mode
chmod +r
read
chmod +w
Write
chmod +x
Execute