Sitemap
Zi-Yuan Chan

Zi-Yuan Chan

Linux Command Cheat Sheet

A list of basic commands to help you get started

1 min readMar 4, 2014

Give those commands below a try. The best way to learn new things is to try it out. ☺

Note: Additional description on the right. It’s hidden for clarity.

Browsing

Directory Listing: ls -al, ls -alSh, ls -alt

Change Directory: cd Folder, cd ~, cd /, cd ..

Show Current Directory: pwd

CRUD

Display File Content: cat File, tail File, tail -n 50 File

Copy File: cp File File2, cp -r Folder Folder2

Cut & Paste File: mv File NewFile, mv File Folder

Remove File: rm File, rm -rf Folder

Change Permission: chmod 755 File

File Editing

nano File

vi File

Process

Monitor Tool: top (htop)

Get Zi-Yuan Chan’s stories in your inbox

Join Medium for free to get updates from this writer.

Search Process with Specific Keyword: ps -ef | grep keyword

End Process: kill PID, pkill ProgramName

System Attributes

Host Name: hostname

Operating System: uname -a

System Date: date

Network

Check Connected Users: who, who am i

Network Configuration Info: ifconfig

System Variables

List Variables: printenv

Display Variable Value: echo $PATH

Set Variable: export PATH=$PATH:/new/path

Misc

Help (User Maual): man Command, man ls

Command Log: history

Clear Screen: clear

Run Previous Command as root: sudo !!

--

--