
Using Linux command on a regular basis? Today we’ll look at 50+ Linux commands you must know! The commands listed below are some of the most useful and most frequently used Linux commands. Let’s get right into it!
root@ubuntu:~
# cd <directory path>
root@ubuntu:~
# mkdir <folder name>
root@ubuntu:~
# cp <source> <destination>
root@ubuntu:~
# mv <source> <destination
root@ubuntu:~
# rm <file name>
root@ubuntu:~
# rm -r <folder/directory name>
root@ubuntu:~
# ln -s <source path> <link name>
root@ubuntu:~
# cat <file name>
root@ubuntu:~
# echo <Text to print on terminal>
root@ubuntu:~
# cat /boot/grub/grub.cfg | less
root@ubuntu:~
# man <command>
root@ubuntu:~
# uname -a
#Compress
root@ubuntu:~
# tar -cvf <archive name> <files seperated by space>
#Extract
root@ubuntu:~
# tar -xvf <archive name>
root@ubuntu:~
# zip <archive name> <file names separated by space>
root@ubuntu:~
# unzip <archive name>
root@ubuntu:~
# <Any command with output> | grep "<string to find>"
root@ubuntu:~
# head <file name>
root@ubuntu:~
# tail <file name>
root@ubuntu:~
# diff <file 1> <file 2>
root@ubuntu:~
# cmp <file 1> <file 2>
root@ubuntu:~
# comm <file 1> <file2>
root@ubuntu:~
# export <variable name>=<value>
root@ubuntu:~ -->>
ssh
username@
hostname
root@ubuntu:~ -->> service
ssh
status
root@ubuntu:~ -->> service
ssh
stop
root@ubuntu:~ -->> service
ssh
start
root@ubuntu:~ -->>
ps
root@ubuntu:~ -->>
kill
<process ID>
root@ubuntu:~ -->> killall <process name>
root@ubuntu:~ -->>
mount
/dev/cdrom
/mnt
root@ubuntu:~ -->>
df
-h
root@ubuntu:~ -->>
chmod
+x loop.sh
root@ubuntu:~ -->>
chmod
root:root loop.sh
root@ubuntu:~ -->>
ifconfig
root@ubuntu:~ -->>
traceroute
<destination address>
root@ubuntu:~ -->> wget <link to file>
OR
root@ubuntu:~ -->> wget -c <link to file>
root@ubuntu:~
# iptables -A INPUT -p tcp -m tcp --dport 80 -j ACCEPT
root@ubuntu:~
# ufw allow 80
non-root-user@ubuntu:~
# sudo <command you want to run>
Password:
root@ubuntu:~
# cal
root@ubuntu:~
# cal May 2019
root@ubuntu:~
# alias lsl="ls -l"
OR
root@ubuntu:~
# alias rmd="rm -r"
root@ubuntu:~
# dd if = /dev/sdb of = /dev/sda
root@ubuntu:~
# whereis sudo
sudo
:
/usr/bin/sudo
/usr/lib/sudo
/usr/share/man/man8/sudo
.8.gz
root@ubuntu:~
# whatis sudo
sudo
(8) - execute a
command
as another user
root@ubuntu:~
# useradd JournalDev -d /home/JD
root@ubuntu:~# usermod JournalDev -a -G sudo, audio, mysql
root@ubuntu:~# passwd
New password: