Show Menu
Cheatography

CentOS Commands Cheat Sheet (DRAFT) by

This is a draft cheat sheet. It is a work in progress and is not finished yet.

Directory Operations

pwd
Print Working Directory
cd dir
Change Directory to dir
mkdir name
Make Directory in current Directory
mkdir -p
Make new nested direct­ories
rmdir
Remove directory
rm -rf
Remove directory and content (forced)
cp -R
Copies one directory and its files to another directory
tree
Shows the subdir­ect­ories

Accessing Consoles

tty
terminal that you connect to
who
who is currently logged

Listing Files

ls
List files and direct­ories
ls -a
List files and direct­ories including hidden
ls -aF
List files and direct­ories including hidden and file types
ls /etc
List files and direct­ories of the server's config­uration directory
ls -l
List files and direct­ories showing more details
ls -lrt
List files and direct­ories with the last modified at the end
ls -lh
List files and direct­ories in a more readable format
ls -ld
Lists the file directory file type
ls -lR
Lists files and direct­ories Recursevly
ls -1
Lists files and direct­ories 1 per line
ls -m
Lists files and direct­ories comma separated

File Types

lsblk
Lists the block devices on the system
 

Working with Files

cp
copy commands
cat
reads the contents
cp -i
copy with intera­ctive mode command
mv
move or rename command
rm
remove command

Working with LInks