SlideShare a Scribd company logo
1 of 18
Computer Networks (CS C461 / IS C461)
                           Assignments
                             PART A
1)ip:
Name: show / manipulate routing, devices, policy routing and tunnels .
Synopsis:
ip [ OPTIONS ] OBJECT { COMMAND | help }

OBJECT := { link | addr | addrlabel | route | rule | neigh | tunnel | maddr | mroute | monitor }

OPTIONS := { -V[ersion] | -s[tatistics] | -r[esolve] | -f[amily] { inet | inet6 | ipx | dnet | link } | -o[neline] }

Examples:
       ip link show : List network interfaces




       ip link set dev eth0 name eth1 :         Rename interface eth0 to eth1
Computer Networks (CS C461 / IS C461)
                         Assignments
                           PART A

      ip link set dev eth0 up :Bring interface eth0 up (or down)
      ip addr show : List addresses for interfaces




      ip route show :List routing table




      ip route add default via 10.3.10.1:   Set default gateway to 10.3.10.1



2)nc:
NAME: nc — arbitrary TCP and UDP connections and listens.
SYNOPSIS:       nc [-46DdhklnrStUuvzC] [-i interval] [-P proxy_username] [-p source_port]
                [-s source_ip_address] [-T ToS] [-w timeout] [-X proxy_protocol] [-x
               proxy_address[:port]] [hostname] [port[s]]
DESCRIPTION:
  The nc (or netcat) utility is used for just about anything under the sun
  involving TCP or UDP. It can open TCP connections, send UDP packets,
  listen on arbitrary TCP and UDP ports, do port scanning, and deal with
  both IPv4 and IPv6. Unlike telnet(1), nc scripts nicely, and separates
  error messages onto standard error instead of sending them to standard
  output, as telnet(1) does with some.
Computer Networks (CS C461 / IS C461)
                         Assignments
                           PART A
Examples:
    nc host port: where host is the IP address or DNS name of a host to connect to and port is the TCP
      port number to connect to. By default, netcat uses TCP. Unlike telnet, netcat doesn't print
      anything to the screen when a connection is made unless you use the -v command line option.




      To scan ports command used is : nc -z 10.3.10.36 10-100 and to show close ports too include –v:
       nc -vz 10.3.10.36 10-100




3)ssh:
NAME: ssh — OpenSSH SSH client (remote login program).

SYNOPSIS:

         ssh [-1246AaCfgKkMNnqsTtVvXxYy] [-b bind_address] [-c cipher_spec] [-D
           [bind_address:]port] [-e escape_char] [-F configfile] [-I pkcs11]
           [-i identity_file] [-L [bind_address:]port:host:hostport]
           [-l login_name] [-m mac_spec] [-O ctl_cmd] [-o option] [-p port]
           [-R [bind_address:]port:host:hostport] [-S ctl_path] [-W host:port]
           [-w local_tun[:remote_tun]] [user@]hostname [command]
Computer Networks (CS C461 / IS C461)
                          Assignments
                            PART A
DESCRIPTION:

          ssh (SSH client) is a program for logging into a remote machine and for
          executing commands on a remote machine. It is intended to replace rlogin
          and rsh, and provide secure encrypted communications between two
          untrusted hosts over an insecure network. X11 connections and arbitrary
          TCP ports can also be forwarded over the secure channel.

Examples:
      ssh user@hostname




4)scp:
NAME: scp — secure copy (remote file copy program).

SYNOPSIS:

scp [-1246BCpqrv] [-c cipher] [-F ssh_config] [-i identity_file]

[-l limit] [-o ssh_option] [-P port] [-S program]

[[user@]host1:]file1 ... [[user@]host2:]file
Computer Networks (CS C461 / IS C461)
                          Assignments
                            PART A
DESCRIPTION:

scp copies files between hosts on a network. It uses ssh(1) for data

transfer, and uses the same authentication and provides the same security

 as ssh(1). Unlike rcp(1), scp will ask for passwords or passphrases if

they are needed for authentication.

 File names may contain a user and host specification to indicate that the

file is to be copied to/from that host. Local file names can be made

explicit using absolute or relative pathnames to avoid scp treating file

names containing ‘:’ as host specifiers. Copies between two remote hosts

are also permitted.

Examples:

      scp sampletextfile.txt your_username@remotehost.edu:/some/remote/directory




      scp your_username@remotehost.edu:samplefile.txt /some/local/directory
Computer Networks (CS C461 / IS C461)
                        Assignments
                          PART A
    5)arp:
    NAME: arp - manipulate the system ARP cache.
    SYNOPSIS:
       arp [-vn] [-H type] [-i if] [-a] [hostname]

        arp [-v] [-i if] -d hostname [pub]

        arp [-v] [-H type] [-i if] -s hostname hw_addr [temp]

        arp [-v] [-H type] [-i if] -s hostname hw_addr [netmask nm] pub

        arp [-v] [-H type] [-i if] -Ds hostname ifname [netmask nm] pub

       arp [-vnD] [-H type] [-i if] -f [filename]
    DESCRIPTION:
       Arp manipulates or displays the kernel's IPv4 network neighbour cache.
       It can add entries to the table, delete one or display the current con‐
       tent.

        ARP stands for Address Resolution Protocol, which is used to find the
        media access control address of a network neighbour for a given IPv4
        Address.

    Examples:
   arp -a




   arp –a ip
Computer Networks (CS C461 / IS C461)
                      Assignments
                        PART A

   Delete an ARP entry: arp -d




    6)rarp:
    NAME: rarp - manipulate the system RARP table
    SYNOPSIS:
         rarp [-V] [--version] [-h] [--help]
         rarp -a
         rarp [-v] -d hostname ...
         rarp [-v] [-t type] -s hostname hw_addr
     DESCRIPTION:
      Arp manipulates or displays the kernel's IPv4 network neighbour cache.
      It can add entries to the table, delete one or display the current con‐
      tent.
      ARP stands for Address Resolution Protocol, which is used to find the
      media access control address of a network neighbour for a given IPv4
      Address.

    Examples:
   rarp –a
    aniket@ubuntu:~$ rarp -a
    This kernel does not support RARP.
Computer Networks (CS C461 / IS C461)
                       Assignments
                         PART A
    7)route:
    NAME: route - show / manipulate the IP routing table.
    SYNOPSIS:
       route [-CFvnee]

       route [-v] [-A family] add [-net|-host] target [netmask Nm] [gw Gw]
           [metric N] [mss M] [window W] [irtt I] [reject] [mod] [dyn]
           [reinstate] [[dev] If]

       route [-v] [-A family] del [-net|-host] target [gw Gw] [netmask Nm]
           [metric N] [[dev] If]

       route [-V] [--version] [-h] [--help]
     DESCRIPTION:
       Route manipulates the kernel's IP routing tables. Its primary use is
       to set up static routes to specific hosts or networks via an interface
       after it has been configured with the ifconfig(8) program.

       When the add or del options are used, route modifies the routing
       tables. Without these options, route displays the current contents of
       the routing tables.
    Examples:
   route
Computer Networks (CS C461 / IS C461)
                      Assignments
                        PART A

   route add default gw 10.3.10.1 eth0




    8)netstat:
    NAME: netstat - Print network connections, routing tables, interface statistics, masquerade
    connections, and multicast memberships.
    SYNOPSIS:
        netstat [address_family_options] [--tcp|-t] [--udp|-u] [--raw|-w] [--listening|-l] [--all|-a]
    [--numeric|-n] [--numeric-hosts] [--numeric-ports]
        [--numeric-users] [--symbolic|-N] [--extend|-e[--extend|-e]] [--timers|-o] [--program|-p] [--
    verbose|-v] [--continuous|-c]

       netstat {--route|-r} [address_family_options] [--extend|-e[--extend|-e]] [--verbose|-v] [--
    numeric|-n] [--numeric-hosts] [--numeric-ports] [--numeric-users]
       [--continuous|-c]

       netstat {--interfaces|-i} [--all|-a] [--extend|-e[--extend|-e]] [--verbose|-v] [--program|-p] [--
    numeric|-n] [--numeric-hosts] [--numeric-ports] [--numeric-
       users] [--continuous|-c]

        netstat {--groups|-g} [--numeric|-n] [--numeric-hosts] [--numeric-ports] [--numeric-users] [--
    continuous|-c]

       netstat {--masquerade|-M} [--extend|-e] [--numeric|-n] [--numeric-hosts] [--numeric-ports] [--
    numeric-users] [--continuous|-c]

        netstat {--statistics|-s} [--tcp|-t] [--udp|-u] [--raw|-w]

        netstat {--version|-V}

        netstat {--help|-h}
Computer Networks (CS C461 / IS C461)
                      Assignments
                        PART A
    DESCRIPTION:
       Netstat prints information about the Linux networking subsystem.

    Examples:

   List All Ports (both listening and non listening ports : netstat -a (-u if for udp ports)




   show statistics for all ports using netstat –s
Computer Networks (CS C461 / IS C461)
                      Assignments
                        PART A



   Display the kernel routing information using netstat –r




   Show the list of network interfaces: netstat -i




    9)ifup:
    NAME: ifup - bring a network interface up.
    SYNOPSIS:
       ifup [-nv] [--no-act] [--verbose] [-i FILE|--interfaces=FILE] [--allow
       CLASS] -a|IFACE...
       ifup -h|--help
       ifup -V|--version
    DESCRIPTION:
       The ifup and ifdown commands may be used to configure (or, respec‐
       tively, deconfigure) network interfaces based on interface definitions
       in the file /etc/network/interfaces.
Computer Networks (CS C461 / IS C461)
                      Assignments
                        PART A


    10)ifdown:
    NAME: take a network interface down
    SYNOPSIS:
           ifdown [-nv] [--no-act] [--verbose] [-i FILE|--interfaces=FILE]
            [--allow CLASS] -a|IFACE...
    DESCRIPTION:
       The ifup and ifdown commands may be used to configure (or, respec‐
       tively, deconfigure) network interfaces based on interface definitions
       in the file /etc/network/interfaces.
    Examples(ifup and ifdown examples are provided together):
   sudo ifup lo/ sudo ifdown lo




    11)iwconfig:
    NAME: iwconfig - configure a wireless network
    SYNOPSIS:
       iwconfig [interface]
       iwconfig interface [essid X] [nwid N] [mode M] [freq F]
                  [channel C][sens S ][ap A ][nick NN ]
                  [rate R] [rts RT] [frag FT] [txpower T]
                  [enc E] [key K] [power P] [retry R]
                  [modu M] [commit]
       iwconfig --help
       iwconfig –version
Computer Networks (CS C461 / IS C461)
                      Assignments
                        PART A

    DESCRIPTION:
       Iwconfig is similar to ifconfig(8), but is dedicated to the wireless
       interfaces. It is used to set the parameters of the network interface
       which are specific to the wireless operation (for example : the fre‐
       quency). Iwconfig may also be used to display those parameters, and
       the wireless statistics (extracted from /proc/net/wireless).

       All these parameters and statistics are device dependent. Each driver
       will provide only some of them depending on hardware support, and the
       range of values may change

    Examples:
   iwconfig(output is given for both with and without wireless connections)
Computer Networks (CS C461 / IS C461)
                      Assignments
                        PART A

    12)iwspy:
    NAME: iwspy - Get wireless statistics from specific nodes.
    SYNOPSIS:
       iwspy [interface]
       iwspy interface [+] DNSNAME | IPADDR | HWADDR [...]
       iwspy interface off
       iwspy interface setthr low high
       iwspy interface getthr
       DESCRIPTION:
       Iwspy is used to set a list of addresses to monitor in a wireless net‐
       work interface and to read back quality of link information for each of
       those. This information is the same as the one available in
       /proc/net/wireless : quality of the link, signal strength and noise
       level.

        This information is updated each time a new packet is received, so each
        address of the list adds some overhead in the driver.

        Note that this functionality works only for nodes part of the current
        wireless cell, you can not monitor Access Points you are not associated
        with (you can use Scanning for that) and nodes in other cells. In Man‐
        aged mode, in most case packets are relayed by the Access Point, in
        this case you will get the signal strength of the Access Point. For
        those reasons this functionality is mostly useful in Ad-Hoc and Master
        mode.

    Examples:
   sudo iwspy eth0
    Output:
    aniket@ubuntu:~$ sudo iwspy eth0
    eth0 Interface doesn't support wireless statistic collection
Computer Networks (CS C461 / IS C461)
                  Assignments
                    PART A
13)iwlist:
NAME: iwlist - Get more detailed wireless information from a wireless inter‐
    Face.
SYNOPSIS:
    iwlist [interface] scanning
    iwlist [interface] frequency
    iwlist [interface] rate
    iwlist [interface] keys
    iwlist [interface] power
    iwlist [interface] txpower
    iwlist [interface] retry
    iwlist [interface] event
    iwlist [interface] auth
    iwlist [interface] wpakeys
    iwlist [interface] genie
    iwlist [interface] modulation
    iwlist --help
    iwlist –version
  DESCRIPTION:
    Iwlist is used to display some additional information from a wireless
    network interface that is not displayed by iwconfig(8). The main argu‐
    ment is used to select a category of information, iwlist displays in
    detailed form all information related to this category, including
    information already shown by iwconfig(8).
Computer Networks (CS C461 / IS C461)
                      Assignments
                        PART A
    Examples:
   iwlist wlan0 scan




    14)tracepath:
    NAME: tracepath, tracepath6 - traces path to a network host discovering MTU
       along this path.
    SYNOPSIS:
       tracepath [-n] [-b] [-l pktlen] destination [port]
    DESCRIPTION:
       It traces path to destination discovering MTU along this path. It uses
       UDP port port or some random port. It is similar to traceroute, only
       does not require superuser privileges and has no fancy options.

        tracepath6 is good replacement for traceroute6 and classic example of
        application of Linux error queues. The situation with IPv4 is worse,
        because commercial IP routers do not return enough information in icmp
        error messages. Probably, it will change, when they will be updated.
        For now it uses Van Jacobson's trick, sweeping a range of UDP ports to
        maintain trace history.
Computer Networks (CS C461 / IS C461)
                      Assignments
                        PART A

    Examples:
   tracepath localhost




   tracepath -b localhost(-b resolves ip address)




   tracepath from localhost(of bits mail server)
Computer Networks (CS C461 / IS C461)
                      Assignments
                        PART A
    15)dhclient:
    NAME: dhclient - Dynamic Host Configuration Protocol Client.
    SYNOPSIS:
       dhclient [ -p port ] [ -d ] [ -e VAR=value ] [ -q ] [ -1 ] [ -r ] [ -x
       ] [ -lf lease-file ] [ -pf pid-file ] [ -cf config-file ] [ -sf
       script-file ] [ -s server ] [ -g relay ] [ -n ] [ -nw ] [ -w ] [ if0 [
       ...ifN ] ]
    DESCRIPTION:
       The Internet Systems Consortium DHCP Client, dhclient, provides a means
       for configuring one or more network interfaces using the Dynamic Host
       Configuration Protocol, BOOTP protocol, or if these protocols fail, by
       statically assigning an address.

    Examples:
   sudo dhclient eth0

More Related Content

What's hot

Unit 1 sepm process models
Unit 1 sepm process modelsUnit 1 sepm process models
Unit 1 sepm process modelsKanchanPatil34
 
Computer Graphics Notes
Computer Graphics NotesComputer Graphics Notes
Computer Graphics NotesGurpreet singh
 
Introduction to computer graphics
Introduction to computer graphicsIntroduction to computer graphics
Introduction to computer graphicsKamal Acharya
 
Introduction to MATLAB
Introduction to MATLABIntroduction to MATLAB
Introduction to MATLABRavikiran A
 
Unit-IV Windowing and Clipping.pdf
Unit-IV Windowing and Clipping.pdfUnit-IV Windowing and Clipping.pdf
Unit-IV Windowing and Clipping.pdfAmol Gaikwad
 
Bresenham's line algorithm
Bresenham's line algorithmBresenham's line algorithm
Bresenham's line algorithmPooja Dixit
 
Computer system architecture
Computer system architectureComputer system architecture
Computer system architecturevenkateswarlu G
 
Simple Calendar Application using C
Simple Calendar Application using CSimple Calendar Application using C
Simple Calendar Application using Ccodewithc
 
Top Down Parsing, Predictive Parsing
Top Down Parsing, Predictive ParsingTop Down Parsing, Predictive Parsing
Top Down Parsing, Predictive ParsingTanzeela_Hussain
 
Introduction to Dynamic Programming, Principle of Optimality
Introduction to Dynamic Programming, Principle of OptimalityIntroduction to Dynamic Programming, Principle of Optimality
Introduction to Dynamic Programming, Principle of OptimalityBhavin Darji
 
Architecture design in software engineering
Architecture design in software engineeringArchitecture design in software engineering
Architecture design in software engineeringPreeti Mishra
 
Applications Of Computer Graphics
Applications Of Computer GraphicsApplications Of Computer Graphics
Applications Of Computer GraphicsMuhammad Amjad Rana
 
Composite transformation
Composite transformationComposite transformation
Composite transformationPooja Dixit
 
Coal 1 - introduction to assembly programming in Assembly Programming
Coal 1 - introduction to assembly programming in Assembly ProgrammingCoal 1 - introduction to assembly programming in Assembly Programming
Coal 1 - introduction to assembly programming in Assembly ProgrammingMuhammad Taqi Hassan Bukhari
 

What's hot (20)

Unit 1 sepm process models
Unit 1 sepm process modelsUnit 1 sepm process models
Unit 1 sepm process models
 
Computer Graphics Notes
Computer Graphics NotesComputer Graphics Notes
Computer Graphics Notes
 
Software Engineering Practice
Software Engineering PracticeSoftware Engineering Practice
Software Engineering Practice
 
Introduction to computer graphics
Introduction to computer graphicsIntroduction to computer graphics
Introduction to computer graphics
 
Introduction to MATLAB
Introduction to MATLABIntroduction to MATLAB
Introduction to MATLAB
 
Introduction to problem solving in C
Introduction to problem solving in CIntroduction to problem solving in C
Introduction to problem solving in C
 
Unit-IV Windowing and Clipping.pdf
Unit-IV Windowing and Clipping.pdfUnit-IV Windowing and Clipping.pdf
Unit-IV Windowing and Clipping.pdf
 
Bresenham's line algorithm
Bresenham's line algorithmBresenham's line algorithm
Bresenham's line algorithm
 
Computer system architecture
Computer system architectureComputer system architecture
Computer system architecture
 
Software process
Software processSoftware process
Software process
 
Simple Calendar Application using C
Simple Calendar Application using CSimple Calendar Application using C
Simple Calendar Application using C
 
scilab
scilabscilab
scilab
 
Top Down Parsing, Predictive Parsing
Top Down Parsing, Predictive ParsingTop Down Parsing, Predictive Parsing
Top Down Parsing, Predictive Parsing
 
Introduction to Dynamic Programming, Principle of Optimality
Introduction to Dynamic Programming, Principle of OptimalityIntroduction to Dynamic Programming, Principle of Optimality
Introduction to Dynamic Programming, Principle of Optimality
 
Architecture design in software engineering
Architecture design in software engineeringArchitecture design in software engineering
Architecture design in software engineering
 
Applications Of Computer Graphics
Applications Of Computer GraphicsApplications Of Computer Graphics
Applications Of Computer Graphics
 
lecture1 introduction to computer graphics(Computer graphics tutorials)
lecture1 introduction to computer graphics(Computer graphics tutorials)lecture1 introduction to computer graphics(Computer graphics tutorials)
lecture1 introduction to computer graphics(Computer graphics tutorials)
 
Composite transformation
Composite transformationComposite transformation
Composite transformation
 
Modelling and simulation
Modelling and simulationModelling and simulation
Modelling and simulation
 
Coal 1 - introduction to assembly programming in Assembly Programming
Coal 1 - introduction to assembly programming in Assembly ProgrammingCoal 1 - introduction to assembly programming in Assembly Programming
Coal 1 - introduction to assembly programming in Assembly Programming
 

Similar to Basic linux commands

Arp Dan Ipconfig Syntax
Arp Dan Ipconfig  SyntaxArp Dan Ipconfig  Syntax
Arp Dan Ipconfig Syntaxguestcc37e8c
 
Introduction to tcpdump
Introduction to tcpdumpIntroduction to tcpdump
Introduction to tcpdumpLev Walkin
 
Lession3 Routing
Lession3 RoutingLession3 Routing
Lession3 Routingleminhvuong
 
Command.pptx presentation
Command.pptx presentationCommand.pptx presentation
Command.pptx presentationAkshay193557
 
11 module configuring novell ipx
11  module configuring novell ipx11  module configuring novell ipx
11 module configuring novell ipxAsif
 
8c21da14 1c9c-44ee-8e24-9a1ddd64ca82-150211062639-conversion-gate02
8c21da14 1c9c-44ee-8e24-9a1ddd64ca82-150211062639-conversion-gate028c21da14 1c9c-44ee-8e24-9a1ddd64ca82-150211062639-conversion-gate02
8c21da14 1c9c-44ee-8e24-9a1ddd64ca82-150211062639-conversion-gate02Anand Nandani
 
DEF CON 27 - workshop - HUGO TROVAO and RUSHIKESH NADEDKAR - scapy dojo v1
DEF CON 27 - workshop - HUGO TROVAO and RUSHIKESH NADEDKAR - scapy dojo v1DEF CON 27 - workshop - HUGO TROVAO and RUSHIKESH NADEDKAR - scapy dojo v1
DEF CON 27 - workshop - HUGO TROVAO and RUSHIKESH NADEDKAR - scapy dojo v1Felipe Prado
 
Ciso 4 ospf
Ciso 4 ospfCiso 4 ospf
Ciso 4 ospfmyciokas
 
Cisco asa firewall command line technical guide
Cisco asa firewall command line technical guideCisco asa firewall command line technical guide
Cisco asa firewall command line technical guideMDEMARCOCCIE
 

Similar to Basic linux commands (20)

Arp Dan Ipconfig Syntax
Arp Dan Ipconfig  SyntaxArp Dan Ipconfig  Syntax
Arp Dan Ipconfig Syntax
 
CN 1.docx
CN 1.docxCN 1.docx
CN 1.docx
 
nwlab-ex1.pdf
nwlab-ex1.pdfnwlab-ex1.pdf
nwlab-ex1.pdf
 
Introduction to tcpdump
Introduction to tcpdumpIntroduction to tcpdump
Introduction to tcpdump
 
Computer networks
Computer networksComputer networks
Computer networks
 
Tcpdump
TcpdumpTcpdump
Tcpdump
 
Routing
RoutingRouting
Routing
 
Lession3 Routing
Lession3 RoutingLession3 Routing
Lession3 Routing
 
Command.pptx presentation
Command.pptx presentationCommand.pptx presentation
Command.pptx presentation
 
11 module configuring novell ipx
11  module configuring novell ipx11  module configuring novell ipx
11 module configuring novell ipx
 
Ns2 introduction 2
Ns2 introduction 2Ns2 introduction 2
Ns2 introduction 2
 
8c21da14 1c9c-44ee-8e24-9a1ddd64ca82-150211062639-conversion-gate02
8c21da14 1c9c-44ee-8e24-9a1ddd64ca82-150211062639-conversion-gate028c21da14 1c9c-44ee-8e24-9a1ddd64ca82-150211062639-conversion-gate02
8c21da14 1c9c-44ee-8e24-9a1ddd64ca82-150211062639-conversion-gate02
 
Netcat
NetcatNetcat
Netcat
 
5 - Networking in Red Hat
5 - Networking in Red Hat5 - Networking in Red Hat
5 - Networking in Red Hat
 
Ccna Imp Guide
Ccna Imp GuideCcna Imp Guide
Ccna Imp Guide
 
DEF CON 27 - workshop - HUGO TROVAO and RUSHIKESH NADEDKAR - scapy dojo v1
DEF CON 27 - workshop - HUGO TROVAO and RUSHIKESH NADEDKAR - scapy dojo v1DEF CON 27 - workshop - HUGO TROVAO and RUSHIKESH NADEDKAR - scapy dojo v1
DEF CON 27 - workshop - HUGO TROVAO and RUSHIKESH NADEDKAR - scapy dojo v1
 
Ciso 4 ospf
Ciso 4 ospfCiso 4 ospf
Ciso 4 ospf
 
Linux networking
Linux networkingLinux networking
Linux networking
 
Cisco asa firewall command line technical guide
Cisco asa firewall command line technical guideCisco asa firewall command line technical guide
Cisco asa firewall command line technical guide
 
Tcpdump
TcpdumpTcpdump
Tcpdump
 

Recently uploaded

Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionDilum Bandara
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsMiki Katsuragi
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Manik S Magar
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 

Recently uploaded (20)

Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An Introduction
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering Tips
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 

Basic linux commands

  • 1. Computer Networks (CS C461 / IS C461) Assignments PART A 1)ip: Name: show / manipulate routing, devices, policy routing and tunnels . Synopsis: ip [ OPTIONS ] OBJECT { COMMAND | help } OBJECT := { link | addr | addrlabel | route | rule | neigh | tunnel | maddr | mroute | monitor } OPTIONS := { -V[ersion] | -s[tatistics] | -r[esolve] | -f[amily] { inet | inet6 | ipx | dnet | link } | -o[neline] } Examples:  ip link show : List network interfaces  ip link set dev eth0 name eth1 : Rename interface eth0 to eth1
  • 2. Computer Networks (CS C461 / IS C461) Assignments PART A  ip link set dev eth0 up :Bring interface eth0 up (or down)  ip addr show : List addresses for interfaces  ip route show :List routing table  ip route add default via 10.3.10.1: Set default gateway to 10.3.10.1 2)nc: NAME: nc — arbitrary TCP and UDP connections and listens. SYNOPSIS: nc [-46DdhklnrStUuvzC] [-i interval] [-P proxy_username] [-p source_port] [-s source_ip_address] [-T ToS] [-w timeout] [-X proxy_protocol] [-x proxy_address[:port]] [hostname] [port[s]] DESCRIPTION: The nc (or netcat) utility is used for just about anything under the sun involving TCP or UDP. It can open TCP connections, send UDP packets, listen on arbitrary TCP and UDP ports, do port scanning, and deal with both IPv4 and IPv6. Unlike telnet(1), nc scripts nicely, and separates error messages onto standard error instead of sending them to standard output, as telnet(1) does with some.
  • 3. Computer Networks (CS C461 / IS C461) Assignments PART A Examples:  nc host port: where host is the IP address or DNS name of a host to connect to and port is the TCP port number to connect to. By default, netcat uses TCP. Unlike telnet, netcat doesn't print anything to the screen when a connection is made unless you use the -v command line option.  To scan ports command used is : nc -z 10.3.10.36 10-100 and to show close ports too include –v: nc -vz 10.3.10.36 10-100 3)ssh: NAME: ssh — OpenSSH SSH client (remote login program). SYNOPSIS: ssh [-1246AaCfgKkMNnqsTtVvXxYy] [-b bind_address] [-c cipher_spec] [-D [bind_address:]port] [-e escape_char] [-F configfile] [-I pkcs11] [-i identity_file] [-L [bind_address:]port:host:hostport] [-l login_name] [-m mac_spec] [-O ctl_cmd] [-o option] [-p port] [-R [bind_address:]port:host:hostport] [-S ctl_path] [-W host:port] [-w local_tun[:remote_tun]] [user@]hostname [command]
  • 4. Computer Networks (CS C461 / IS C461) Assignments PART A DESCRIPTION: ssh (SSH client) is a program for logging into a remote machine and for executing commands on a remote machine. It is intended to replace rlogin and rsh, and provide secure encrypted communications between two untrusted hosts over an insecure network. X11 connections and arbitrary TCP ports can also be forwarded over the secure channel. Examples:  ssh user@hostname 4)scp: NAME: scp — secure copy (remote file copy program). SYNOPSIS: scp [-1246BCpqrv] [-c cipher] [-F ssh_config] [-i identity_file] [-l limit] [-o ssh_option] [-P port] [-S program] [[user@]host1:]file1 ... [[user@]host2:]file
  • 5. Computer Networks (CS C461 / IS C461) Assignments PART A DESCRIPTION: scp copies files between hosts on a network. It uses ssh(1) for data transfer, and uses the same authentication and provides the same security as ssh(1). Unlike rcp(1), scp will ask for passwords or passphrases if they are needed for authentication. File names may contain a user and host specification to indicate that the file is to be copied to/from that host. Local file names can be made explicit using absolute or relative pathnames to avoid scp treating file names containing ‘:’ as host specifiers. Copies between two remote hosts are also permitted. Examples:  scp sampletextfile.txt your_username@remotehost.edu:/some/remote/directory  scp your_username@remotehost.edu:samplefile.txt /some/local/directory
  • 6. Computer Networks (CS C461 / IS C461) Assignments PART A 5)arp: NAME: arp - manipulate the system ARP cache. SYNOPSIS: arp [-vn] [-H type] [-i if] [-a] [hostname] arp [-v] [-i if] -d hostname [pub] arp [-v] [-H type] [-i if] -s hostname hw_addr [temp] arp [-v] [-H type] [-i if] -s hostname hw_addr [netmask nm] pub arp [-v] [-H type] [-i if] -Ds hostname ifname [netmask nm] pub arp [-vnD] [-H type] [-i if] -f [filename] DESCRIPTION: Arp manipulates or displays the kernel's IPv4 network neighbour cache. It can add entries to the table, delete one or display the current con‐ tent. ARP stands for Address Resolution Protocol, which is used to find the media access control address of a network neighbour for a given IPv4 Address. Examples:  arp -a  arp –a ip
  • 7. Computer Networks (CS C461 / IS C461) Assignments PART A  Delete an ARP entry: arp -d 6)rarp: NAME: rarp - manipulate the system RARP table SYNOPSIS: rarp [-V] [--version] [-h] [--help] rarp -a rarp [-v] -d hostname ... rarp [-v] [-t type] -s hostname hw_addr DESCRIPTION: Arp manipulates or displays the kernel's IPv4 network neighbour cache. It can add entries to the table, delete one or display the current con‐ tent. ARP stands for Address Resolution Protocol, which is used to find the media access control address of a network neighbour for a given IPv4 Address. Examples:  rarp –a aniket@ubuntu:~$ rarp -a This kernel does not support RARP.
  • 8. Computer Networks (CS C461 / IS C461) Assignments PART A 7)route: NAME: route - show / manipulate the IP routing table. SYNOPSIS: route [-CFvnee] route [-v] [-A family] add [-net|-host] target [netmask Nm] [gw Gw] [metric N] [mss M] [window W] [irtt I] [reject] [mod] [dyn] [reinstate] [[dev] If] route [-v] [-A family] del [-net|-host] target [gw Gw] [netmask Nm] [metric N] [[dev] If] route [-V] [--version] [-h] [--help] DESCRIPTION: Route manipulates the kernel's IP routing tables. Its primary use is to set up static routes to specific hosts or networks via an interface after it has been configured with the ifconfig(8) program. When the add or del options are used, route modifies the routing tables. Without these options, route displays the current contents of the routing tables. Examples:  route
  • 9. Computer Networks (CS C461 / IS C461) Assignments PART A  route add default gw 10.3.10.1 eth0 8)netstat: NAME: netstat - Print network connections, routing tables, interface statistics, masquerade connections, and multicast memberships. SYNOPSIS: netstat [address_family_options] [--tcp|-t] [--udp|-u] [--raw|-w] [--listening|-l] [--all|-a] [--numeric|-n] [--numeric-hosts] [--numeric-ports] [--numeric-users] [--symbolic|-N] [--extend|-e[--extend|-e]] [--timers|-o] [--program|-p] [-- verbose|-v] [--continuous|-c] netstat {--route|-r} [address_family_options] [--extend|-e[--extend|-e]] [--verbose|-v] [-- numeric|-n] [--numeric-hosts] [--numeric-ports] [--numeric-users] [--continuous|-c] netstat {--interfaces|-i} [--all|-a] [--extend|-e[--extend|-e]] [--verbose|-v] [--program|-p] [-- numeric|-n] [--numeric-hosts] [--numeric-ports] [--numeric- users] [--continuous|-c] netstat {--groups|-g} [--numeric|-n] [--numeric-hosts] [--numeric-ports] [--numeric-users] [-- continuous|-c] netstat {--masquerade|-M} [--extend|-e] [--numeric|-n] [--numeric-hosts] [--numeric-ports] [-- numeric-users] [--continuous|-c] netstat {--statistics|-s} [--tcp|-t] [--udp|-u] [--raw|-w] netstat {--version|-V} netstat {--help|-h}
  • 10. Computer Networks (CS C461 / IS C461) Assignments PART A DESCRIPTION: Netstat prints information about the Linux networking subsystem. Examples:  List All Ports (both listening and non listening ports : netstat -a (-u if for udp ports)  show statistics for all ports using netstat –s
  • 11. Computer Networks (CS C461 / IS C461) Assignments PART A  Display the kernel routing information using netstat –r  Show the list of network interfaces: netstat -i 9)ifup: NAME: ifup - bring a network interface up. SYNOPSIS: ifup [-nv] [--no-act] [--verbose] [-i FILE|--interfaces=FILE] [--allow CLASS] -a|IFACE... ifup -h|--help ifup -V|--version DESCRIPTION: The ifup and ifdown commands may be used to configure (or, respec‐ tively, deconfigure) network interfaces based on interface definitions in the file /etc/network/interfaces.
  • 12. Computer Networks (CS C461 / IS C461) Assignments PART A 10)ifdown: NAME: take a network interface down SYNOPSIS: ifdown [-nv] [--no-act] [--verbose] [-i FILE|--interfaces=FILE] [--allow CLASS] -a|IFACE... DESCRIPTION: The ifup and ifdown commands may be used to configure (or, respec‐ tively, deconfigure) network interfaces based on interface definitions in the file /etc/network/interfaces. Examples(ifup and ifdown examples are provided together):  sudo ifup lo/ sudo ifdown lo 11)iwconfig: NAME: iwconfig - configure a wireless network SYNOPSIS: iwconfig [interface] iwconfig interface [essid X] [nwid N] [mode M] [freq F] [channel C][sens S ][ap A ][nick NN ] [rate R] [rts RT] [frag FT] [txpower T] [enc E] [key K] [power P] [retry R] [modu M] [commit] iwconfig --help iwconfig –version
  • 13. Computer Networks (CS C461 / IS C461) Assignments PART A DESCRIPTION: Iwconfig is similar to ifconfig(8), but is dedicated to the wireless interfaces. It is used to set the parameters of the network interface which are specific to the wireless operation (for example : the fre‐ quency). Iwconfig may also be used to display those parameters, and the wireless statistics (extracted from /proc/net/wireless). All these parameters and statistics are device dependent. Each driver will provide only some of them depending on hardware support, and the range of values may change Examples:  iwconfig(output is given for both with and without wireless connections)
  • 14. Computer Networks (CS C461 / IS C461) Assignments PART A 12)iwspy: NAME: iwspy - Get wireless statistics from specific nodes. SYNOPSIS: iwspy [interface] iwspy interface [+] DNSNAME | IPADDR | HWADDR [...] iwspy interface off iwspy interface setthr low high iwspy interface getthr DESCRIPTION: Iwspy is used to set a list of addresses to monitor in a wireless net‐ work interface and to read back quality of link information for each of those. This information is the same as the one available in /proc/net/wireless : quality of the link, signal strength and noise level. This information is updated each time a new packet is received, so each address of the list adds some overhead in the driver. Note that this functionality works only for nodes part of the current wireless cell, you can not monitor Access Points you are not associated with (you can use Scanning for that) and nodes in other cells. In Man‐ aged mode, in most case packets are relayed by the Access Point, in this case you will get the signal strength of the Access Point. For those reasons this functionality is mostly useful in Ad-Hoc and Master mode. Examples:  sudo iwspy eth0 Output: aniket@ubuntu:~$ sudo iwspy eth0 eth0 Interface doesn't support wireless statistic collection
  • 15. Computer Networks (CS C461 / IS C461) Assignments PART A 13)iwlist: NAME: iwlist - Get more detailed wireless information from a wireless inter‐ Face. SYNOPSIS: iwlist [interface] scanning iwlist [interface] frequency iwlist [interface] rate iwlist [interface] keys iwlist [interface] power iwlist [interface] txpower iwlist [interface] retry iwlist [interface] event iwlist [interface] auth iwlist [interface] wpakeys iwlist [interface] genie iwlist [interface] modulation iwlist --help iwlist –version DESCRIPTION: Iwlist is used to display some additional information from a wireless network interface that is not displayed by iwconfig(8). The main argu‐ ment is used to select a category of information, iwlist displays in detailed form all information related to this category, including information already shown by iwconfig(8).
  • 16. Computer Networks (CS C461 / IS C461) Assignments PART A Examples:  iwlist wlan0 scan 14)tracepath: NAME: tracepath, tracepath6 - traces path to a network host discovering MTU along this path. SYNOPSIS: tracepath [-n] [-b] [-l pktlen] destination [port] DESCRIPTION: It traces path to destination discovering MTU along this path. It uses UDP port port or some random port. It is similar to traceroute, only does not require superuser privileges and has no fancy options. tracepath6 is good replacement for traceroute6 and classic example of application of Linux error queues. The situation with IPv4 is worse, because commercial IP routers do not return enough information in icmp error messages. Probably, it will change, when they will be updated. For now it uses Van Jacobson's trick, sweeping a range of UDP ports to maintain trace history.
  • 17. Computer Networks (CS C461 / IS C461) Assignments PART A Examples:  tracepath localhost  tracepath -b localhost(-b resolves ip address)  tracepath from localhost(of bits mail server)
  • 18. Computer Networks (CS C461 / IS C461) Assignments PART A 15)dhclient: NAME: dhclient - Dynamic Host Configuration Protocol Client. SYNOPSIS: dhclient [ -p port ] [ -d ] [ -e VAR=value ] [ -q ] [ -1 ] [ -r ] [ -x ] [ -lf lease-file ] [ -pf pid-file ] [ -cf config-file ] [ -sf script-file ] [ -s server ] [ -g relay ] [ -n ] [ -nw ] [ -w ] [ if0 [ ...ifN ] ] DESCRIPTION: The Internet Systems Consortium DHCP Client, dhclient, provides a means for configuring one or more network interfaces using the Dynamic Host Configuration Protocol, BOOTP protocol, or if these protocols fail, by statically assigning an address. Examples:  sudo dhclient eth0