LINUX / UNIX ADVANCED COMMANDS
tar
Description: Used to create or extract archiveOptions:
-c To create an archive
-x To extract an archive
Ex:
tar –x file.tar.gz
gzip
Description: Used for compressing filesOptions:
-q Suppress all warnings
-r do recursively
Ex:
gzip -r name
ifconfig
Description: configure network interface parameters.Options:
-a displays information about all available interfaces.
Ex:
ifconfig eth0 up
gunzip
Description: Used to decompress the files created by gzip
Ex: gunzip -r name
mount
Description: Mount a file systemEx: mount
displays the file systems
mount 192.168.2.254:/mnt /mnt/home
umount
Description: unmount file systemsOptions: -f ( forcely unmount )
Ex:
umount /dev/media
ping
Description: send ICMP ECHO_REQUEST to network hostsOptions: -c stop after sending count ECHO_REQUEST
-b Allow pinging a broadcast address
Ex: ping -c 5 192.168.2.254
ssh
Description: used to log in and execute commands on remote machineEx: ssh root@192.168.2.254
scp
Description: Secure copy between systems in networkSyntax:
scp -r <directory name> <destionation>
Ex:
scp -r dir1 192.168.2.254:/root/Desktop
traceroute
Description: tracks the route packets to network host.Ex:
traceroute 192.168.2.254
route
Description: Show or manipulate the routing tablesOptions: -add To add a new route
-del delete a route
Ex:
route add –net 10.0.0.0 netmask 255.255.255.0 gw 192.168.1.1
tcpdump
Description: Used to capture packets on network.
Options: -c n exits after receiving n packets
-D prints a list of available interfaces.
Ex:
tcpdump –c 10
arp
Description: Used to manipulate the system arp cache.
Options: -a [ hostname ] show the entries of specified host.
-d [hostname] remove the entry for specified host
Ex: arp –d 192.168.2.12
netstat
Description: used to show network status.Options:-r displays the contents of routing table
-a shows the state of all sockets
Ex: netstat -r