Page 139 - DCAP106_OPERATING_SYSTEM_TOOLS
P. 139

Operating System Tools




                    Notes          z z  ping: send ICMP ECHO_REQUEST to network hosts, you will get back ICMP packet if
                                       the host responds.  We use this command if there is a doubt whether the computer  is
                                       connected or not.

                                   z z  $ ping IP or host name.
                                   z z  hostname  : This command is used  to show or set  the system’s host name.
                                   z z  dnsdomainname : This command is used to show the system’s DNS domain name.
                                   z z  netstat:  This  command  displays  the status of ports i.e. which ports are open, closed,
                                       waiting for connections. It displays the contents of /proc/net file.

                                   z z  ifconfig: This command is used to configure a network interface, or to display their current
                                       configuration. It is also useful to get the information regarding IP address, Subnet Mask,
                                       set remote IP address, Netmask etc.
                                   z z  ifup : This command is used  to bring a network interface up.
                                   z z  ifdown : This command is used to take a network interface down.

                                   8.1.5 Achieve Commands

                                   Let us suppose that you want to install a package from its source code. You observed that the
                                   source  code  of  the  package  is  archived  in  a  file  xxx.tar.  In  this  condition,  the  command-line
                                   utility ‘tar’ proves to be a critical resource for you. The ‘tar’ is perhaps the most popular Linux
                                   backup utility. If the ‘tar’ file is compressed with the compression utility like ‘bzip’ or ‘gzip’,
                                   the resulting file is the famous ‘tarballs’ which is a common way to deliver software installation
                                   archives.

                                   tar: It is an archiving program which is designed to store and extract files from an archive known
                                   as a tarfile.
                                   Options:

                                   -c : create a new archive
                                   -r : append files to the end of an archive
                                   -t : list the contents of an archive
                                   -u : only append files that are newer than copy in archive
                                   -x : extract files from an archive
                                   -C : change to directory Dir

                                   -j : filter archive through bzip2,  use  to  decompress  .bz2  files
                                   -v : verbosely list files processed
                                   -f : use  archive  file
                                   -z : filter the archive through gzip


                                          Examples:
                                   tar  -xvf  test.tar    (extract foo.tar to the current location)
                                   tar -xvzf  test.tar.gz  (extract gzipped test.tar.gz)

                                   tar  -cvf test.tar    foo/ (compress the contents of foo folder to foo.tar)






          132                              LOVELY PROFESSIONAL UNIVERSITY
   134   135   136   137   138   139   140   141   142   143   144