DEV Community

Md Mehedi Hasan
Md Mehedi Hasan

Posted on

Linux Command Cheat Sheet

🔗 Networking Commands

Command Description
ssh username@ip-address Login into a remote Linux machine using SSH
ping hostname or ping ip Analyze network and host connections
dir Display files in the current directory of a remote computer
cd dirname Change directory to dirname on a remote computer
put file Upload file from local to remote computer
get file Download file from remote to local computer
quit Logout from the remote connection

⚙️ Process Management Commands

Command Description
bg Send a process to the background
fg Bring a stopped process to the foreground
top Display details on all active processes
ps Show the status of processes running for a user
ps PID Display the status of a specific process
pidof process Get the Process ID (PID) of a process
kill PID Terminate a process
nice Start a process with a specified priority
renice Change the priority of an already running process
df Show free hard disk space
free Display available RAM memory

✍️ VI Editing Commands

Command Description
i Insert at cursor (goes into insert mode)
a Write after the cursor (goes into insert mode)
A Write at the end of the line (goes into insert mode)
ESC Terminate insert mode
u Undo the last change
U Undo all changes to the entire line
o Open a new line (goes into insert mode)
dd Delete the current line
3dd Delete 3 lines
D Delete contents of the line after the cursor
C Delete contents of the line after the cursor and insert new text (end with ESC)
dw Delete a word
4dw Delete 4 words
cw Change a word
x Delete the character at the cursor
r Replace the character
R Overwrite characters from the cursor onward
s Substitute one character under the cursor and continue to insert
S Substitute the entire line and begin inserting at the start of the line
~ Toggle the case of the character at the cursor

Top comments (1)

Collapse
 
moopet profile image
Ben Sinclair •

put, get, and quit aren't standard shell commands.

cd changes directory, but in your current shell, which may or may not be on a remote computer. Same with dir, which is not used much outside legacy FTP sessions; people generally want ls for this.