A-Z Linux commands
There are Countless number of commands in linux.In this article,we will introduce you a list of most frequently used Linux Commands with their examples for easy learning.For Basic Refer this link COMMANDS
[five_sixth]
A:-
- adduser/addgroup
To add a new user,you have to follow “useradd” or “adduser” with ‘Username’.The ‘Username’ is a user login name,this is used by user to login into the system.
useradd user
2.alias
The bellow command will create an alias called home for /home/tecmint/public_html directory.whenever you type home in the prompt,it will put you in the home/folder/public_html
alias home='home/folder/public_html
3.anacron command
In contrast,cron allows job to run as often as every minute while anacron will remember the job(if system is down)and execute it when system is up.
4.apropos command
It is used to search the man page files in OS.It is particularly useul when searching for commands without knowing their exact names.
5.aptitude command
It is a Powerful text-based interface to Linux package management system.It can be used to install,remove,or upgrade software packages on a system.
sudo aptitude update
6.arch command
arch ia a simple cmd for displaying about machine architecture or hardware name(like uname -m)
7.arp command
It displays the kernel’s ipv4 network.ARP stands for Address Resolution Protocol,which is used to find the address of a network neighbor for a given IPV4 address.
8.at command
It is used to schedule task to run in a future time.It si alternative to cron and anacron.howerver it runs a task once at a given future time without editing any config files.
For example,to shutdown the system at 22.50 today,run:
sudo echo "shutdown -h now" | at -m 22:50
9.atq command
atq command is used to view jobs in at command queue:
$ atq
10.atrm command
It is used to remove/delete jobs from command queue:
$ atrm 2
B:-
1.batch Command
It is also used to schedule task to run a future time,similar to the “at command”
2.Basename Command
It helps to print the name os the file of directories in the absolute path
3.bc Command
bc ia a simple CLI calculator language which can be used:
echo 10.05 + 10.00 | bc
4.bg Command
It is used to send the process to the background.
tar -czf home.tar.gz.bgjobs
5.bzip2 Command
It is used to compress or decompress files
bzip2 -z filename #compress
C:-
1.cal command
Cal cmd print a calendar on the standard output
cal
2.cat command
It is used to view contents of a file and display it on standard output
cat file.txt
3.chgrp command
It is used to change the group ownership of a file.provide the new group name as its first argument and the name of the file as the second argument like this
chgrp xxx user.txt
4.chmod command
It is used to change/update file access permissions like this
chmod +x sysinfo.sh
5.chown command
chown cmd changed/updates the user and group ownership of a file like:
chown -R www-data:www-data /var/www/html
6.clear command
Clear cmd lets you clear the terminal screen,simply type
clear
7.cmp command
It performs a byte-by-byte comparison of two files like this
cmp file1 file2
8.comm command
It is used to compare two sorted files line by line as shown below
comm file1 file2
9.cp command
It is used for copying files and directories from one location to another
cp /home/../file1 /home/../personal/
D:-
1.date command
It displays/set the system date and time like
date date --set="8 JUN 2027 12:00:00"
2.df command
IT is used to show file system disk space usage a follows
df -h
3.diff command
It is used to compare two files line by line.
diff file1 file 2
4.dir command
It works like Linux ls command.It list the content of a directory
dir
5.dmidecode command
It is a tool for retrieving hardware information of any linux system
sudo demidecode --type system
6.du command
It is used to show disk space usage of files present in the directory as well as its sub-directories as follows
du /home/xxxx
E:-
1.echo command
This command prints a text of line provided to it.
echo "This is VPS"
2.eject command
It is used to eject removable media such ad DVD/CD ROM or floppy disk from the system
eject /dev/cdrom
3.env command
It is list all the current environment variables and used to set them as well.
env
4.exit command
It is used to exit a shell like so
exit
5.expr command
It is used to an calculate an expression as shown below
expr 20+30
F:-
1.factor command
It is used to show the prime factors of a number
factor 10
2.find command
It is used to search files in a directory as well as its sub-directoried. It searches for files by attributes such as permission,users,groups,file-type,date,size .
find /home/vps -nme vps.txt
3.free command
IT shows the system memory usage including swap space.”-h” options to display output in the human friendly format.
free -h
G:-
1.grep command
This command searches for special pattern in a file and displays in output lines containing that pattern as follows
grep 'vps' *.txt
2.group command
It displays all the names of groups a user is a part of like this
groups
3.gzip command
It is helps to compress a file,replaces it with one having a .gz extension as shown below
gzip *.txt cat file1 filw2 | gzip>*.gz
4.gunzip command
It expands or restore file compressed with gzip command like
gunzip *.gz
H:-
1.head command
It is used to show first lines(10 lines by default)of the specified file or stdin to the screen
ps -eo pid,ppid,cmd,%mem,%cpu --sort=-%mem | head
2.histroy command
It is used to getinfo about command executed by a user
history
3.hostname command
It is used to print or set system hostname in linux
hostname hostname NEW_HOSTNAME
4.hostnameectl command
It is used to print or modify the system hostname and related settings
hostnamectl sudo hostnamectl set-hostname NEW_HOSTNAME
5.hwclock
It is used to probe for the hardware present in a linux system like
sudo hwclock sudo hwclock --set --date 8/06/2017
6.hwinfo command
hwinfo
I:-
1.id command
It shows user and group information for the current ise name as shown below
id user
2.ifconfig command
It s used to configure a linux system network interfaces.It is used to configure,view and control network interfaces
$ ifconfig $ sudo ifconfig eth0 up $ sudo ifconfig eth0 down $ sudo ifconfig eth0 172.16.25.125
3.ionice command
It is used to set or view process I/O scheduling class and priority of the specified process
$ ionice -c 3 rm /var/logs/syslog
4.iostat command
iostat
5.ip comand
$ sudo ip addr add 192.168.56.10 dev eth1
6.ip tables
$ sudo iptables -L -n -v
7.iw command
$ iw list
8.iwlist command
$ iwlist wlp1s0 scanning
K:-
1.kill command
It is used ti kill a process using PID(Process ID) by sending a signal to it.
kill -15 pid
2.killall command
It is used to kill process by its name
killall firefox
3.kmod command
It is used to list all currently loaded modules.
kmod list
L:-
1.last command
It display a listing of last logged users.
last
2.locate command
It is used to find a file by name
locate file1 dir1
3.login command
It is used to create a new session with the system.
sodo login
4.ls command
It is used to list contents of directory.
ls -l file1
5.lshw command
It is used to get detailed information of hardware configuration of the machine.
sudo lshw
6.lscpu command
It is used to dislpay system’s CPU architecture information like cpu,threads,cores.
lscpu
M:-
1.man command
It is used to view the manual pages for commands/programs like
man du man df
2.mkdir command’more command
It is used to create single or more directories.
mkdir dirname
3.mv command
It is useful to move a file from one location to another.
mv file.sh file1.sh
N:-
1.nano command
It is a popular,free and friendly text editor for linux.
nano file.txt
2.nproc command
It shows the number of prcessing units present to the current process.
nproc
O:-
- openssl command
It will create an archive of all the files in the current directory and encrypt the contents of the archive file.
$ tar -czf - * | openssl enc -e -aes256 -out backup.tar.gz
P:-
1.passwd command
passwd command is used to create and update passwords for user accounts.Note that normal system users may only change the password of their own account, while root may modify the password for any account.
passwd vps
2.pidof command
pidof displays the process ID of a running program/command.
pidof init
3.ping command
ping command is used to determine connectivity between hosts on a network
ping google.com
4.pwd command
pwd command displays the name of current/working directory as below.
pwd
R:-
1.reboot command
reboot command reboot a system as follows
reboot
2.rename command
rename command is used to rename many files at once. If you have a collection of files with “.html” extension and you want to rename all of them with “.php” extension, you can type the command below.
$ rename 's/\.html$/\.php/' *.html
3.rm command
rm command is used to remove files or directories
$ rm file1 $ rm -rf my-files
4.rmdir command
rmdir command helps to delete/remove empty directories
$ rmdir /backup/all
S:-
1.shutdown command
It schedules a time for the system to be powered down.
shutdown --poweroff
2.sleep command
It is used to delay for specified amount of time
$ check.sh; sleep 5; sudo apt update
3.split command
It is used to split the large file in to small file
4.stat command
It is used to show a file or file system status like this
stat file1
T:-
1.tac command
This command concatenates and displays files in reverse.Its simply prints each file to standard output,showing last line first.
tac file.txt
2.tail command
It is used to display the last(default 10 lines)line of each file to standard output
3.talk command
It is used to talk to another system/network user.
$ talk person [name]
4.tar command
It is for archiving file in linux
$ tar -czf home.tar.gz .
5.time command
Its runs programs system resource usage
$ time wc /etc/hosts
6.touch command
It is used to create a file.
touch file.txt
U:-
1.uname command
It display system information such us OS,Hostname,Kernel name,releases and etc.
uname
2.uniq command
It displays repeated lines from standard input.
3.uptime command
It shows how long the system has been running
uptime
4.users command
It shows the usernames of the users logged into the current host like
users
V:-
vim/vi command
It is used to edit all kind of plain text and program files.
vim file
W:-
w command
It display the system uptime,load avf and information about the users currently on the machine like
w
wall command
It is used to send/displays a messages to all the users on the system as follows
wall "Hai all"
watch command
It is used to watch changes to a file/directory.
watch -d ls -l
wc command
It is used to display newline,word,and byte counts for each file specified.
wc filename
wget command
It is used to download files from the web.
wget http://wordpress.org/latest.tar.gz
which command
It display the absolute path of files
which who
who command
It shows the information about the user.
who
whereis command
It helps up locate the binary,source and manual files for commands
X:-
- xargs command
It is useful utility for reading items from the standard input.
Y:-
- yes command
It is uesd to display a string repeatedly until when terminated or killed using “cntrl+C”as follows
$ yes "This is-Learn
2.youtube-dl command
It is light weight command line programe t download videos
$ youtube-dl --list-formats https://www.youtube.com/watch?v=iR
Z:-
1.zcmp/zdiff command
It is used to compare compressed files as shown below.
$ zcmp domain-list.txt.zip basic_passwords.txt.zip $ zdiff domain-list.txt.zip basic_passwords.txt.zip
2.zip command
It is silmple and easy to use utility used to package and compress files
"tar cvzf *.tar.gz dirname/"
3.zz command
This offers quick access to files and directories in linux.
zz
[/five_sixth]On this Page
A | B | C |
D | E | F |
G | H | I |
K | L | M |
N | O | P |
R | S | T |
U | V | W |
X | Y | Z |