1.1 Linux Cheatsheet
1.1 Linux Cheatsheet
pwd
ls
ls -l
ls -lh
ls -a
ls -R
ls /home
ls -a -l / ls -al
ls -r
ls test
ls /test
cd
cd ..
cd ../..
cd /home
touch test.txt
rm test.txt
mkdir test
mkdir -v test
rmdir test
rm -r test
rm *
mv test.txt ..
mv test.txt test2.txt
mv test /home
cp test.txt ..
cp test.txt test2.txt
cp test.txt /home
cp -r test /home
cat test.txt
cat > test.txt
cat 1.txt 2.txt > 3.txt
cat test.txt | grep bird
cat test.txt | grep "bird\|dog"
vim test.txt
nano test.txt
more test.txt
more +2 test.txt
more +"/cat" test.txt
less -p "cat" test.txt
less -N test.txt
echo "TEST"
echo $(( 1+1 ))
head test.txt
head -10 test.txt
tail test.txt
tail -10 test.txt
tail -f /var/log/syslog
sudo COMMAND
sudo su
exit
su user1
su
passwd
sudo passwd user1
usermod -L user1
sudo usermod -U user1
sudo groupadd group1
sudo usermod -G group1 user1
cat /etc/group
sudo groupmod -n group2 group1
sudo groupdel new_group
uname -a
uname -n
hostname
uptime
date
clear
command --help
info command
whatis command
whereis command
whoami
history
history -c
shutdown
shutdown -c
shutdown now
shutdown 11:00
shutdown +10
reboot
halt
poweroff
du
du /etc -h
du -sh
df -h
free -m
top
top -d 5
top -p PID
top -i
htop
ps fax
kill PID
kill -9 PID
ifconfig
ping
ping -c 5
ping -s 100
traceroute
telnet IP_ADD
ssh USER@IP_ADD
host
whois
netstat
wget
curl -O
Description
Show the current directory full path
Show the all files and directories in current path (“dir” in Windows )
Show detailed information like owner, mode, size, change date
Show size as more readable like in KB, MB, GB
Show hidden files
Show also sub files inside of directory
Show specific path’s inside
Same result, different usage
Show files in reverse order
Path in current directory
Full path from root directory
Change Directory
Go back to upper directory
Go back to 2 upper directory (Can be more with ../../../..)
Go to another directory with writing the full path
Create a file
Remove a file
Create a directory
-v option shows details of the process
Remove a directory, if directory has no content
Remove directories and their contents recursively
Remove only all files in current directory, directory is not removed
Show file
Start to show file from 2nd line
Start to show file with a specific letter
Find all specific letter in the file
Open file with line number
Enter content in Terminal (Like prompt in python)
Calculate integers
Install a package
We can add multiple packages
Remove package
Update package index or list
Upgrade all installed packages to latest version
Remove installed packages dependencies