Day-'13&'14 - Networking Commands

Network Configuration Command:
Ifconfig - (Interface Configuration)
used to display/configure the IP interfaces, Used to see IP address, mac address of system.
* ifconfig is replaced with ip addr command
hostname - To display the hostname of the system
The host name is set and maintained in etc/hostname
hostnamectl - used to change the hostname of the present system we use hostnamectl ommand
for modern linux distributions we use this command
→ hostnamectl set-hostname ‘the new name’
ping - Used to check the network connectivity between 2 systems/machines
It uses internet control protocol
ping<ipaddress/domain jps>
traceroute ipaddress
port no’s : sshd 22(default port)
tomcat 2020
jenkins 8080
nexus 8081
telnet - telnet <ipaddress><port>
curl -v telnet://ipaddress:port(ssh)
netstat -tunlp
checking, what process are listening, which port is running
ss -tunlp
To know which process is accepting which port.
nslookup/dig - For checking the ip address of any domain
eg: nslookup www.google.com
wget - used to download files, softwares from http
we can also use curl command for downloading
wget’url’
url→ what we want to download
wget -o name.zip ‘url’ - To change the name and download
awk -
It is a scripting language itself.
If we give patterns, it search for the pattern and give output wherever that pattern is present
syntax:
awk ‘pattern {action}’filename.txt
→ awk ‘{print}’ awk.txt
It prints all the content of the awk file
→ awk ‘{print $2}’ awk.txt
It displays 2nd column of the file
→awk ‘{print $2,$3}’ awk.txt
It displays 2nd and 3rd columns of the file
→ awk ‘{print NR}’ awk.txt
It displays the line no to the file
→ awk ‘\sandhya\{print}’ awk.txt
It displays the text sandhya where ever is there
→ awk ‘\sweety/{print $2}’ awk.file
It displays the text where ever sweety is there in the 2nd column
→awk ‘\sweety/{print NR,$2}’ awk.file
It displays the text where ever sweety is there in the 2nd column, and gives the line no
awk ‘NR==2,NR==3{print NR,$0}’ awk.file
It displays 2 and 3 rows of the text
awk ‘‘$3>24{print NR,$0}’ awk.file
It executes with a condition in column 3 it displays the lines where the text is greater than 24
→ awk ‘{print}’ awk.txt | sort
It sorts and displays the text
cp→ cp is used to copy the file/directory within the same server
scp- (secure copy)
It is used to copy the files/directories securely between 2 servers
syntax:
scp <sourcefile/directory>username@ipaddress:/destination>
crontab - used to schedule the jobs to run automatically at a specified time/date
* * * * *
min, hours, day, month, day of week
30 2 * * * → 2:30
Subscribe to my newsletter
Read articles from Sandhya Kalikiri directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by
