Tuesday, 28 June 2016

ADVANCED COMMANDS

LINUX / UNIX ADVANCED COMMANDS

tar

Description: Used to create or extract archive

  Options:
               -c     To create an archive
               -x     To extract an archive
Ex:
              tar –x file.tar.gz

gzip

DescriptionUsed for compressing files

Options:
               -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 system

Ex: mount
            displays the file systems
            mount 192.168.2.254:/mnt /mnt/home

umount

Description: unmount file systems

Options:     -f   (  forcely unmount )

Ex:
           umount /dev/media

ping

Description: send ICMP ECHO_REQUEST to network hosts

Options: -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 machine

Ex: ssh root@192.168.2.254

scp

Description: Secure copy between systems in network

Syntax:
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 tables
Options: -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