0% found this document useful (0 votes)
2 views2 pages

Linux Commands

This document is a cheat sheet for common Linux commands, organized into categories such as File and Directory Management, File Viewing and Editing, User and Permissions, Networking, Process and System Info, Archiving and Compression, and Miscellaneous. Each command is listed with a brief description of its function. It serves as a quick reference for users to efficiently navigate and manage their Linux systems.

Uploaded by

okaykoo728
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views2 pages

Linux Commands

This document is a cheat sheet for common Linux commands, organized into categories such as File and Directory Management, File Viewing and Editing, User and Permissions, Networking, Process and System Info, Archiving and Compression, and Miscellaneous. Each command is listed with a brief description of its function. It serves as a quick reference for users to efficiently navigate and manage their Linux systems.

Uploaded by

okaykoo728
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Common Linux Commands Cheat Sheet

File and Directory Management

ls List directory contents

cd [dir] Change current directory

pwd Print working directory

mkdir [dir] Create a new directory

rmdir [dir] Remove an empty directory

rm [file] Remove a file

rm -r [dir] Remove a directory and contents recursively

cp [src] [dest] Copy files or directories

mv [src] [dest] Move or rename files/directories

touch [file] Create an empty file

find [dir] -name [file] Search for a file/directory

File Viewing and Editing

cat [file] View file content

less [file] View file with paging

head [file] View first 10 lines

tail [file] View last 10 lines

nano [file] Open file in Nano editor

vim [file] Open file in Vim editor

echo "text" Output text to terminal

echo "text" > file Write to file (overwrite)

echo "text" >> file Append to file

User and Permissions

whoami Show current user

id Display user ID and group

chmod [mode] [file] Change file permissions

chown [user]:[group] [file] Change file owner

sudo [command] Run command as root

passwd Change password

adduser [user] Add new user


Common Linux Commands Cheat Sheet

deluser [user] Delete user

Networking

ifconfig / ip a Show network interfaces

ping [host] Send ICMP packets

netstat -tuln Show open ports

curl [url] Fetch content from URL

wget [url] Download file from URL

scp [src] [user@host]:[dest] Secure copy between hosts

ssh [user@host] Connect via SSH

Process and System Info

top Show live process usage

ps aux List running processes

kill [PID] Kill process by PID

df -h Show disk space usage

free -h Show memory usage

uname -a System info

Archiving and Compression

tar -czf file.tar.gz dir/ Create gzipped archive

tar -xzf file.tar.gz Extract gzipped archive

zip file.zip files Create zip archive

unzip file.zip Extract zip archive

Miscellaneous

history Show command history

alias ll='ls -l' Create a shortcut command

date Show current date and time

clear Clear terminal

reboot Reboot system

shutdown now Shut down immediately

You might also like