A Linux commands cheatsheet is a quick reference guide for users to easily access and utilize various Linux commands. It includes a list of commonly used commands along with examples and explanations of their usage. This resource can be helpful for both beginners learning the Linux command line and experienced users looking to improve their efficiency and productivity. It can be used as a quick reference for daily tasks, troubleshooting, and system administration.
-
ls
- List files and directories in a directory.ls /home
-
cd
- Change the current working directory.cd /home/documents
-
mkdir
- Create a new directory.mkdir new_directory
-
rmdir
- Remove an empty directory.rmdir old_directory
-
rm
- Remove files or directories.rm file.txt
-
touch
- Create a new file or update the timestamp of an existing file.touch new_file.txt
-
cp
- Copy files or directories.cp file.txt /home/documents/
-
mv
- Move or rename files or directories.mv file.txt /home/documents/
-
pwd
- Print the current working directory.pwd
-
cat
- Display the contents of a file.cat file.txt
-
less
- Display the contents of a file one page at a time.less file.txt
-
head
- Display the first few lines of a file.head file.txt
-
tail
- Display the last few lines of a file.tail file.txt
-
grep
- Search for a string in a file or output.grep "search_string" file.txt
-
find
- Search for files in a directory.find / -name "file.txt"
-
man
- Display the manual for a command.man ls
-
chmod
- Change file permissions.chmod 755 file.txt
-
chown
- Change file ownership.chown user:group file.txt
-
su
- Switch to another user.su root
-
sudo
- Run a command as the superuser.sudo apt-get update
-
passwd
- Change the password for a user.passwd
-
df
- Display filesystem usage.df -h
-
du
- Display disk usage for a directory.du -sh /
-
free
- Display memory usage.free -m
-
ps
- Display process information.ps aux
-
kill
- Send a signal to a process.kill -9 1234
-
top
- Display real-time process information.top
-
htop
- A more user-friendly version of top.htop
-
systemctl
- Control system services.systemctl start apache2
-
apt-get
- Package manager for Debian-based systems.apt-get update
-
yum
- Package manager for Red Hat-based systems.yum update
-
wget
- Download files from the internet.wget https://example.com/file.zip
-
curl
- Transfer data from or to a server using various protocols.curl https://example.com
-
ping
- Test the connectivity to a host.ping example.com
-
traceroute
- Trace the route to a host.traceroute example.com
-
ssh
- Securely connect to a remote host.ssh user@example.com
-
scp
- Securely copy files to or from a remote host.scp file.txt user@example.com:/path/to/file
-
tar
- Create or extract files from a tar archive.tar -xvf file.tar
-
gzip
- Compress or decompress files.gzip file.txt
-
gunzip
- Decompress files compressed with gzip.gunzip file.txt.gz
-
bzip2
- Compress or decompress files.bzip2 file.txt
-
bunzip2
- Decompress files compressed with bzip2.bunzip2 file.txt.bz2
-
uname
- Display system information.uname -a
-
date
- Display the current date and time.date
-
cal
- Display a calendar.cal
-
time
- Measure the running time of a command.time ls /
-
history
- Display the command history.history
-
alias
- Create a shortcut for a command.alias ll='ls -l'
-
bash
- Start the Bash shell.bash
-
exit
- Exit the current shell.exit
Top comments (0)