Friday, 16 February 2018

basic commands of router

To change user mode to privilege mode
Router> en or enable

To change enable mode to configuration mode
Router# conf t or configure terminal

To change configuration mode to interface mode
Router(config)# int f0/0 or interface fastethernet 0/0
Router(config-if)# exit
Router(config)# 
            Or
Router(config-if)#end

To change configuration mode to line interactive mode
Router(config)#line c 0

To check the running configuration of router (RAM)
Router# sh run or show running-config

To check the saved configuration of router (NVRAM)
Router#sh start or show startup-config

To check flash
Router#sh flash

To check interface status of router
Router#sh ip int brief

To check date & time of router
Router#sh clock

To set date & time of router
Router#clock set 10:21:00 Jan 3 2014

To check the hardware, software versions & router run time
Router#sh ver

To check login details
Router#sh users or sh line

To check router routing table
Router#sh ip route

To set hostname on router
Router#conf t
Router(config)#hostname R1

To remove hostname
R1(config)#no hostname

To run enable mode command on configuration mode
Router(config)#do sh ip int brief

To set login message on router
Router(config)#banner motd  "welcome to cisco world"

To set time zone of router
Router(config)#clock timezone GMT 23
Router(config)#exit

To save configuration
Router#write
            Or
Router#copy run start


Saturday, 21 October 2017

Basic Linux Commands


To check server uptime
[root@ducat Desktop]#uptime
To check which users has logged in on you server and there terminals
[root@ducat Desktop]#who
           Or
[root@ducat Desktop]#w
To check login details of the users
[root@ducat Desktop]#lastlog 
To check the linux operating system
[root@ducat Desktop]#cat /etc/redhat-release
To check the kernel of operating system
[root@ducat Desktop]#uname
                     uname –s    (only for kernel name)
                     uname –m    (machine architecture)
                                                  uname –a    (for complete details)
                     uname –n    (for computer name)
                     uname –v    (kernel version)
                                                  uname –r    (kernel release)
                     uname –i
                     uname –o    (OS name)
To check computer name
[root@ducat Desktop]#hostname
      Or
[root@ducat Desktop]#hostnamectl    (only for rhel 7 or centos 7)
To change computer name
[root@ducat Desktop]#hostnamectl set-hostname “redhatserver”
To check date and time of system
[root@ducat Desktop]#date
                  Or
[root@ducat Desktop]#timedatectl    (only for rhel7 or centos 7)
To change date and time of system
[root@ducat Desktop]#date 020114252014
                  Or
[root@ducat Desktop]#timedatectl set-time “2017-07-18 10:32:00”
To change timezone
[root@ducat Desktop]#timedatectl set-timezone “Asia/Kolkata”
To check available timezone
[root@ducat Desktop]#timedatectl list-timezones
To check the calendar of current month
[root@ducat Desktop]#cal
                        cal -3      (last, current and next month)
                        cal 2014    (year)
                        cal 5 2014  (specific month of the year)
To print hardware details
[root@ducat Desktop]#lspci
To print cpu details
[root@ducat Desktop]#lscpu
To check the directory structure
[root@ducat Desktop]#dir
      Or
[root@ducat Desktop]#ls
[root@ducat Desktop]#ls –l or ll (for complete details)
[root@ducat Desktop]#ls –lh   (size in human readable formate)
[root@ducat Desktop]#ls –la   (print hiden files and folders)
To check the working directory
[root@ducat Desktop]#pwd
To create a directory
[root@ducat Desktop]#mkdir
To create directory tree
[root@ducat Desktop]#mkdir –p /test/{a/{ab,ab1,ab2},b,c}
To change working directory
[root@ducat Desktop]#cd directory path
                     cd    (switch into home directory)
                                                  cd ..       (Execute parent directory)
To remove directour
[root@ducat Desktop]#rmdir directory name
To create empty file
[root@ducat Desktop]#touch file name
To check the contents of file
[root@ducat Desktop]#cat file name                     
To rename file
[root@ducat Desktop]#mv koko.txt koko1.txt
To copy file
[root@ducat Desktop]#cp koko1.txt /kuldeep/1/a
To show the directory tree
[root@ducat Desktop]#tree /kuldeep/
To move file
[root@ducat Desktop]#mv koko1.txt /kuldeep/2
To delete directory
[root@ducat Desktop]#rm -rf /kuldeep1?
To delete all directories starts with kul keyword
[root@ducat Desktop]#rm -rf /kul*
To show the history
[root@ducat Desktop]#history
To print last number of commands
[root@ducat Desktop]#history 5
To check the login user name
[root@ducat Desktop]#whoami


Saturday, 16 September 2017

conditional execution of commands in linux

if the first command is executed successfully then execute the second command in linux
example
       if the kuldeep folder is present at your working directory then this will create test.txt file in this folder.
[root@localhost~]#ls -ld kuldeep && touch kuldeep/test.txt

if the first command does not execute successfully then execute the second command in linux
example
      if the kuldeep folder is not present at your working directory then this will create it
 [root@localhost~]#ls -ld kuldeep || mkdir kuldeep

pls put your comments and suggestion.

how to set time for internet use

this will allow internet access for a particular time interval. R4(config)#int f0/0 R4(config-if)#ip nat inside R4(config-...