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

Linux Command Line Cheatsheet

This document is a Linux Command Line Cheatsheet specifically for Ubuntu, providing essential commands for file system navigation, file and directory manipulation, text processing, user and permission management, process management, and system operations. Each command is accompanied by a brief description and an example of its usage. It serves as a quick reference guide for users to efficiently use the command line interface.

Uploaded by

fikoyik295
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)
23 views2 pages

Linux Command Line Cheatsheet

This document is a Linux Command Line Cheatsheet specifically for Ubuntu, providing essential commands for file system navigation, file and directory manipulation, text processing, user and permission management, process management, and system operations. Each command is accompanied by a brief description and an example of its usage. It serves as a quick reference guide for users to efficiently use the command line interface.

Uploaded by

fikoyik295
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

Linux Command Line Cheatsheet -- Ubuntu Edition

File System Navigation


Command Description Example
pwd Show current directory pwd
cd dir Change directory cd /usr/bin
cd Go to home dir cd
cd - Previous directory cd -
ls List contents ls -l /etc
ls -a Show hidden files ls -a

File & Directory Manipulation


Command Description Example
cp src dst Copy file cp file.txt /tmp/
mv src dst Move or rename mv a.txt b.txt
rm file Delete file rm file.txt
rm -r dir Remove directory rm -r old_dir
mkdir dir Create directory mkdir testdir
ln -s target link Symbolic link ln -s /etc/passwd link

Text Processing
Command Description Example
cat file Print file contents cat notes.txt
head First 10 lines head data.csv
tail Last 10 lines tail -n 20 logfile.log
cut Extract fields cut -d':' -f1 /etc/passwd
sort Sort lines sort names.txt
uniq Remove duplicates sort a.txt | uniq
wc Count lines/words wc -l file.txt
grep Search pattern grep "hello" file.txt
tr Translate characters tr 'a-z' 'A-Z' < file.txt
sed Stream edit sed 's/old/new/' file.txt
awk Pattern scanning awk '{print $1}' file.txt

User & Permission Management


Command Description Example
id Show user info id
chmod Change permissions chmod u+x script.sh
chown Change owner chown user file.txt
chgrp Change group chgrp staff file.txt
umask Show/set default perms umask 022
sudo Run as root sudo apt update
passwd Change password passwd

Process Management
Linux Command Line Cheatsheet -- Ubuntu Edition

Command Description Example


ps Show processes ps aux
top Process viewer top
jobs Background jobs jobs
bg Background job bg %1
fg Foreground job fg %1
kill PID Stop by PID kill 1234
killall Stop by name killall firefox

System & Session


Command Description Example
exit Exit shell exit
shutdown Shutdown sudo shutdown -h now
reboot Reboot sudo reboot
halt Halt system sudo halt
poweroff Power off sudo poweroff

You might also like