Your SlideShare is downloading. ×
Advance linux presentation_0702011
Upcoming SlideShare
Loading in...5

Thanks for flagging this SlideShare!

Oops! An error has occurred.

Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

Advance linux presentation_0702011


Published on

Published in: Technology
No Downloads
Total Views
On Slideshare
From Embeds
Number of Embeds
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

No notes for slide


  • 1. LINUX TRAINING Open Technology Centre, National Informatics Centre, DIT, MCIT, Govt of INDIA, E-3-A, Rajaji Bhavan, Besant Nagar, Chennai-600090. Open Technology Centre, Chennai 1
  • 2. Operating Systems • A program that acts as an intermediary between a user of a computer and the computer hardware. • Operating systems provide an environment in which a user can execute programs. • A program that controls the execution of application programs.OPERATINGSYSTEM DESIGN Open Technology Centre, Chennai 2
  • 3. OPERATING SYSTEMS SERVICES ● File Mangement ● I/O Management ● Memory Management ● Device Management ● Resource Management ● CPU Management ● Hardware Management Open Technology Centre, Chennai 3
  • 6. LINUX vs Windows Particular Linux WindowsSoftware Cost Free /Low  CostlyEasy Easy Easier More Reliable than Reliability Windows Required further improvementSofware Tools Less Numbers but freely More but CostHardware driver and user Interfaces Few Many More vulnerable to Security Very few attacks viruses/attacksOpen Source Yes NoSupport Less Compare to windows Better Support Open Technology Centre, Chennai 6
  • 7. LINUX ORIGIN• Linux is a “free” Unix-type operating system originally created by “Linus Torvalds” with the assistance of developers around the world.• August 25 1991 “Linus” conceives the idea of Linux and announces the project. Open Technology Centre, Chennai 7
  • 8. INTRODUCTION TO LINUX• Open Source.• Modular Fashion.• Strong Security.• Structured File Systems.• Multi-User, Multi-Tasking Operating System. Open Technology Centre, Chennai 8
  • 9. Why LINUX?Linux, is a free, UNIX-like operating system.Works on any kind of Hardwares ( PC/Workstations/Embedded Systems/Mainframe).Comes with complete development environment includescompilers, toolkits, scripting Languages.Linux provides rich Graphical User Interface (GUI) Support.Strong Security Nature – iptables, file permissions,ownerships. Open Technology Centre, Chennai 9
  • 10. LINUX FLAVOURS Open Technology Centre, Chennai 10
  • 11. Type of Distribution – Community Edition Open Technology Centre, Chennai 11
  • 12. Type of Distribution – Commerical Edition Open Technology Centre, Chennai 12
  • 13. LINUX INSTALLATION • Multiple Operating system • Multiple Partitions within an operating system • Different file system types Open Technology Centre, Chennai 13
  • 14. LINUX BOOT SEQUENCES System Startup BIOS Master Boot Record Stage 1 Boot Loader Stage 2 Boot Loader LILO, GRUB Kernel Linux Init User - Space Open Technology Centre, Chennai 14
  • 15. LINUX BOOT SEQUENCES - Run Levels● A runlevel is a software configuration of the system that allows only a selected group of processes to exist.● Init can run the system in one of six runlevels. 0 - halt 1 - Single user mode 2 - Multiuser, without NFS (The same as 3, if you dont have networking) 3 - Full multiuser mode 4 - unused 5 - X11 6 - Reboot Open Technology Centre, Chennai 15
  • 16. LINUX APPLICATION PACKAGESServer• Database Server – PostgreSQL• Web Server – Apache, Apache Tomcat• Mail Server – Cyrus• Proxy Server – Squid• Firewall – iptables• NTP Server – ntp• DHCP Server - dhcp• N/W information service - NIS• N/W File System - NFS• Windows File Share - Samba• Remote Connection - openSSH Server Open Technology Centre, Chennai 16
  • 17. LINUX APPLICATION PACKAGESDesktop● Office Software – OpenOffice, koffice● Graphics - Gimp/CAD Programmes (QCAD)● Internet Browser – Mozilla, Konqueror● Emulation / Virtual Terminal – SSH● Development – C, C++, Perl , Python & gcc● Editor – Emacs, Vi / Vim● Sound & Video – VLC, Brasero Dics Burner● Mail Client – Evolution● Chat – Empathy Open Technology Centre, Chennai 17
  • 18. LINUX FILE STRUCTURE• In the Linux operating system, all filesystems are contained within one directory hierarchy.• The root directory is the top level directory, and all its subdirectories make up the directory hierarchy.• This differs to other operating systems such as MS-Windows.• All directories are grouped under the root entry "/". Open Technology Centre, Chennai 18
  • 19. LINUX FILE STRUCTURE Open Technology Centre, Chennai 19
  • 20. LINUX FILE STRUCTURE...root - The home directory for the root userhome - Contains the users home directoriesbin - Commands needed during bootupsbin - Like bin but not for normal users.proc - Is a virtual filesystem that exists in the kernels imagination which is memory. Open Technology Centre, Chennai 20
  • 21. LINUX FILE STRUCTURE...usr - Contains all commands, libraries, pages and static files.lib - Unchanging data files for programs and subsystems.local - The place for locally installed software and other files.mnt - Allows to mount the external partion. Open Technology Centre, Chennai 21
  • 22. LINUX FILE STRUCTURE...boot - Files used by the bootstrap loader, LILO Kernel images are often kept here.var - Files in /var are dynamic and are constantly being written to or changed.etc - Configuration files specific to the - Contains device files for interfacing with hardware. Either block or character devices. Open Technology Centre, Chennai 22
  • 23. LINUX CONFIGURATION FILES/etc/crontab - Lists commands and times to run them for the cron deamon./etc/exports - Exporting file systems using NFS service./etc/fstab - Lists ther file systems mounted at boot time Automatically./etc/group - Contains basic group attributes for system Groups./etc/hosts.conf - Specifies the hostnames are resolved. Open Technology Centre, Chennai 23
  • 24. LINUX CONFIGURATION FILES.../etc/hosts - lists hosts for name lookup that are locally Required./etc/inittab - Configuration file for init, controls startup run Levels, determines scripts to start with./etc/passwd - The users database contains username, encrypted password, user default shell.users home directory./etc/profile - Contains the files that are executed at startup time. Open Technology Centre, Chennai 24
  • 25. LINUX CONFIGURATION FILES.../etc/shells - shells file contains a list of login shells on the system./proc/devices - file displays the various character and block devices currently configured./var/log/lastlog - Tells about the last login time on the System./var/log - Contains system log files. Open Technology Centre, Chennai 25
  • 26. LINUX CONFIGURATION FILES.../etc/rc.d/rc0.d - Contains the file that are used to control at run level 0./etc/rc.d/rc1.d - Contains the file that are used to control at run level 1./etc/rc.d/rc2.d - Contains the file that are used to control at run level 2./etc/rc.d/rc3.d - Contains the file that are used to control at run level 3./etc/rc.d/rc4.d - Contains the file that are used to control at run level 4./etc/rc.d/rc5.d - Contains the file that are used to control at run level 5./etc/rc.d/rc6.d - Contains the file that are used to control at run level 6. Open Technology Centre, Chennai 26
  • 27. LINUX KERNELKernel - “ heart of the operating system ”The kernel image isnt so much an executablekernel, but a compressed kernel image.A routine that does some minimal amount ofhardware setup and then decompresses the kernelcontained within the kernel image and places itinto high memory. Open Technology Centre, Chennai 27
  • 28. SHELLS IN LINUXA shell is a program that provides the traditional,text-only user interface for Linux and other Unix-like operating systems. Its primary function is toread commands that are typed into a console.Types of shells: * Bourne shell (sh) - /bin/sh * C shell (csh) - /bin/csh * TC shell (tcsh) - /bin/tcsh * Korn shell (ksh) - /bin/ksh * Bourne Again SHell (bash)- /bin/bash Open Technology Centre, Chennai 28
  • 29. Working in the File System• Viewing the file system• Creating files and Directories• Removing files and Directories• Linking Files• Change Directory• List of Files• Copy or Move files and Directories• Clear Shell Commands• Kernel version• Exit, Shutdown & Reboot Open Technology Centre, Chennai 29
  • 30. Viewing File system...(1)tail - Output the last part of files, print the last part(10 lines by default) of each FILE.Example1. tail /var/log/syslogDisplay the last 10 lines of the file called syslog.2. tail -f /var/log/syslog-f - output appended data as the file grows. Open Technology Centre, Chennai 30
  • 31. Viewing File system...(2)less - lets an admin scroll through configurationand error log files, displaying text files.Ex: 1. less /html/index.htmlmore - Paginates the specified file so it can beread line by line (using Enter key).Use b key tomove back and q to quit.Ex: 2. more /home/html/index.html Open Technology Centre, Chennai 31
  • 32. Viewing File system...(3)cat is to read and redirect the output to anotherfile.Ex: cat /etc/hosts – Prints specified file to the screen.Ex: cat file.a > file.b - cat is redirected using the output redirection operator. Open Technology Centre, Chennai 32
  • 33. Creating File and Directories (1)touch - create a simple empty file Ex : touch file-name touch test.txtvim - using vim editor create a file Ex : vim test.txt creates a empty txt file in the name of test Open Technology Centre, Chennai 33
  • 34. Creating Files and Directories (2)mkdir - Create one or more directories.Ex: 1. mkdir personal Create a directory named personalEx: 2. mkdir -p work/junk/questions Create intervening parent directories if they dont exist Open Technology Centre, Chennai 34
  • 35. Removing Files and Directory (1)rm – Allows the user to remove one or more filesand and directories.Ex: (1) rm /home/index.html – Delete the File index.html (2) rm -rf /home/test/Desktop/testing - Delete the file or directory force-fullyNote: -rf cause unrecoverable deletion, If file is a directory, removethe entire directory and all its contents, including subdirectories. Open Technology Centre, Chennai 35
  • 36. Linking Filesln – used to make link between existing files. Ex: ln -s /home/otc/Desktop/test /mnt/ Open Technology Centre, Chennai 36
  • 37. Change DirectoryChange the current working directory to dirName.Ex: cd /path/to/the/directorycd personal – change the directory into .. - Back to the previous directorycd - switch to the previous previous directory Open Technology Centre, Chennai 37
  • 38. ls - listlsList information about the FILEs (the current directory bydefault). Sort entries alphabetically.Ex : 1. ls - List the contents of a directory. 2. ls -ld - Check the Permissions of the directory. 3. ls -al - List the hidden contents of a directory. Open Technology Centre, Chennai 38
  • 39. cp - copy & mv - movecpcopies files from one location to another within systemEx: (1) cp /home/test/Desktop/test.txt /opt/test.txt.orgimvCommands for moving files are fairly straightforward. To changethe location of a file, use the mv command.Ex: (1) mv /home/test/Desktop/documents.odt /data1 Open Technology Centre, Chennai 39
  • 40. aliasaliasCreate an alias, aliases allow a string to be substituted fora word when it is used as the first word of a simplecommand.SYNTAX: alias [-p] [name[=value] ...] unalias [-a] [name ... ]Ex : 1. alias ls = ls -F - Now issuing the command ls will actually run ls -F Open Technology Centre, Chennai 40
  • 41. Kernel versionunameThis command is helpful when working on differentcomputers which may not be in synch at the OS level.Also, you can print information about those systems.Ex: 1. uname -a - This will print to the screen the Linux Kernel inuse on your system. Open Technology Centre, Chennai 41
  • 42. Clear Shell CommandsclearClears your screen if this is possible. It looks in the environment forthe terminal type and then in the terminfo database to figure outhow to clear the screen.Ex: (1) clear Open Technology Centre, Chennai 42
  • 43. Reboot, Poweroff, Shutdownreboot/halt/poweroff/shutdownhalt or reboot is called when the system is not inrunlevel 0 or 6.Ex: (1) reboot or init 6 – Reboot the system (2) poweroff – poweroff the system (3) shutdown -r 5• - Shutdown the system in 5 minutes and reboot. Open Technology Centre, Chennai 43
  • 44. Exit and Logoutexit● The exit causes normal program terminate.logout● Exit a login shell.● A login shell, is your topmost shell, and is started when you log in.● Terminate a login shell allow to logged out. Open Technology Centre, Chennai 44
  • 45. LINUX GUI● Gnome● KDE Open Technology Centre, Chennai 45
  • 46. LINUX GUIGnome – GNU Network Object Model EnvironmentThe GNOME is a desktop environment, a graphicaluser interface that runs on top of a computeroperating system.The GNOME desktop environment, an intuitive andattractive desktop for users, and the GNOMEdevelopment platform, an extensive framework forbuilding applications that integrate into the rest ofthe desktop. Open Technology Centre, Chennai 46
  • 47. LINUX GUI - GNOME Open Technology Centre, Chennai 47
  • 48. LINUX GUIKDEKDE is the easier Linux GUI for users with Windowsbackground.It is best known for its Plasma Desktop, a desktopenvironment provided as the default workingenvironment on many Linux distributions, such asopenSUSE, Mandriva Linux and Kubuntu. Open Technology Centre, Chennai 48
  • 49. LINUX GUI - KDE Open Technology Centre, Chennai 49
  • 50. ADVANTAGE OF LINUX GUI● It provides user friendly to the novice user.● It invokes multi-GUI environment in Remote.● GUI allows to take full advantages of multi- tasking.● We can do all the CLI operations in GUI mode.● Users are free to choose amoung many of GUIs such as GNOME, KDE.● More Customizable.● Any Problem in GUI, we can Kill GUI & Restart GUI service. Open Technology Centre, Chennai 50
  • 51. Managing File Permissions● Setting File Permissions● Setting File Ownership Open Technology Centre, Chennai 51
  • 52. File Permission (1)In linux user can set file permissions, they areread, write and execute.If the command ls -l is given, a long list of filenames is displayed.The first column in this list details the permissionsapplying to the file.If a permission is missing for a owner, group ofother, it is represented by ex: drwxr-x—x Open Technology Centre, Chennai 52
  • 53. File Permission (2)Read =4Write =2Execute = 1 Open Technology Centre, Chennai 53
  • 54. File Permission (3)chmod changes the permissions of each given fileaccording to MODE.User (rwx) = 4+2+1 = 7Group(rx) = 4+1 = 5World (rx) = 4+1 = 5chmod mode = 755 Open Technology Centre, Chennai 54
  • 55. File Permission (4)Ex: (1) chmod 444 filename - Allow read permission to everyone. (2) chmod 066 filename - Make a file rw by the group and others. (3) chmod 777 filename - Allow everyone to rwx the file. Open Technology Centre, Chennai 55
  • 56. Setting File Ownership (1)Change file owner and/or group. `chown changesthe user and/or group ownership of each given Fileto NewOwner or to the user and group of anexisting reference file.Ex: 1. chown [owner] : [groups] target_file_name 2. chown otc:otc /data1/index.html 3. u – user/owner, g – group/owner, o– all other r – read, w – write, x – execute a - for all; user/owner,group and all other Open Technology Centre, Chennai 56
  • 57. Setting File Ownership (1)Ex: (3) To change the owners permissions of a files or directory chown u+r file.1 chown u+w file.1 chown u+x file.1 chown u-r file.1 chown u-w file.1 chown u-x file.1Ex: (4) To change the groups permissions of a files or directory chown g+r file.1 chown g+w file.1 chown g+x file.1 chown g-r file.1 chown g-w file.1 chown g-x file.1Ex: (5) To change the permissions of a files or directory foreveryone. chown o+r file.1 chown o+w file.1 chown o+x file.1 chown o-r file.1 chown o-w file.1 chown o-x file.1 Open Technology Centre, Chennai 57
  • 58. User Administration● Create user● Delete user● Create Group● Delete Group● Password● Root login Open Technology Centre, Chennai 58
  • 59. User Administration (1)useradd Allows to create new user accounts Ex: (1) useradd testpasswd change the password to the particular user. Ex: (1) passwd username Open Technology Centre, Chennai 59
  • 60. User Administration (2)groupadd Allows the user to create new group using thevalues specified on the command line.Ex: (1) groupadd user-name-to-add groupadd otc Open Technology Centre, Chennai 60
  • 61. User Administration (3)userdel Delete a user account and realted files Ex: userdel user-namegroupdel Delete a group modifies the system files Ex: groupdel group-name Open Technology Centre, Chennai 61
  • 62. User Administration (4)passwd - passwd is a text file, that contains a listof the systems accounts.Often, it also contains the encrypted passwords foreach account.Example:passwd username Enter new UNIX password: ******** Confirm new UNIX password: ******** Open Technology Centre, Chennai 62
  • 63. User Administration (5)sudo or su -sudo (superuser do) allows a system administratorto give certain users (or groups of users) theability to run some (or all) commands as root oranother user while logging the commands andarguments.Ex: 1. sudo -i #Enter the Password - Its use for debian and Ubuntu based linux. 2. su - #Enter the Password - Its use for Redhat, suse, mandriva based linux. Open Technology Centre, Chennai 63
  • 64. File System Management in Linux● Viewing Mounted Filesystem● Viewing Diskspace Usage● Viewing Space by Files● Viewing Partitions● Finding Files Open Technology Centre, Chennai 64
  • 65. Viewing Mounted Filesystem (1)mount● Used to view and mount the intend filesystem● Instruct the kernel to attach the filesystem● Mount allowed to access all devices, partitions, CD-ROMs and other storage devices as files.Ex: (1) mount /dev/sda7 /mnt/ /dev/sda7 – source-directory (hard-disk partition) /mnt – destination-directory or mount pointEx: (2) mount -a – Display Mount all filesystems.Ex: (3) mount -t ext3 /dev/sda6 /diskS Open Technology Centre, Chennai 65
  • 66. Viewing Mounted Filesystem (2)umountreverse process of mounting, i.e unmount thepartition.Ex: (1) umount /mnt /mnt – is the place where mount previously. Open Technology Centre, Chennai 66
  • 67. Filesystem Disk Space Usagedf - Disk Free● Viewing Filesystem usage● Viewing Available disk space. Ex: df -h -h - print sizes in human readable format (e.g., 1K, 234M, 2G) Open Technology Centre, Chennai 67
  • 68. Viewing Diskspace by Filesdu – Disk Usagedu (i.e., disk usage) command reports the sizes ofdirectory trees inclusive of all of their contents andthe sizes of individual files. Ex: (1) du /sbin/file1 (2) du -h /home Open Technology Centre, Chennai 68
  • 69. Viewing Partition Table (1)fdisk – Format Disk● Menu driven approach● Creating & manipulate partition tables.● Partitions are mentioned like /dev/sda Ex: (1) fdisk -ls List the partition tables for the specified devices and Size. Open Technology Centre, Chennai 69
  • 70. Viewing Partition Table (2)cfdiskcfdisk is a curses/slang based program forpartitioning any hard disk drive.Typical values of the device argument areEx: (1) cfdisk /dev/sda Open Technology Centre, Chennai 70
  • 71. Finding Filesgrep (Grand Regular Expression) The grep command searches one or more inputfiles for lines containing a match to a specifiedpattern.Ex: (1) cat /etc/passwd | grep dso This searches for pattern specified. In this case all instances of dso from the /etc/passwd file are printed. Open Technology Centre, Chennai 71
  • 72. Finding Files (1)grep -i “Sample” /home/dsoneil The -i option makes the search in differentto case (e.g.sample or SAMPLE) Open Technology Centre, Chennai 72
  • 73. Finding Files (2)find● Used to locate files on a Unix or Linux system.● Search any set of directories you specify for files that match the supplied search criteria.Ex: (1) find / -name log -print - find the file log in the wholo system and prints it. Open Technology Centre, Chennai 73
  • 74. whowhoShow who is logged into the system. With no options, list thenames of users currently logged in, their terminal, the time theyhave been logged in, and the name of the host from which theyhave logged in. An optional system file (default is /etc/utmp) can besupplied to give additional information.Ex : 1. who -uH Open Technology Centre, Chennai 74
  • 75. whichwhichwhich takes one or more arguments. For each of itsarguments it prints to stdout the full path of theexecutables that would have been executed when thisargument had been entered at the shell prompt.Ex: 1. which -a filename - This will search through all directories inyour current path and find all files named filename Open Technology Centre, Chennai 75
  • 76. Finding Files (3)locate Locate lists files in a database that match apatternEx: (1) locate wordperfect The locate command will locate the file specified and output a directory path. Open Technology Centre, Chennai 76
  • 77. Process Management in Linux● Viewing Running Services and Runlevel● Viewing Running Process● Killing a Running Process Open Technology Centre, Chennai 77
  • 78. Viewing Running Process (1)topProvides an outgoing look at processor activityand update dynamically.Listing of the process based on● CPU usage● Memory usage● Runtime.Can monitor process belongs to the specificprocess id. Open Technology Centre, Chennai 78
  • 79. Viewing Running Process (2) Ex:(1) top -p process-id• Provides the information about process whose pid is as input. Open Technology Centre, Chennai 79
  • 80. Viewing Running Process (3) ps● Enumerates the currently running processes.● Process are identified by its id (pid).● List the Process with its id, state, usage too. Ex: (1) ps au a – lists all process u – select by effective user-id Open Technology Centre, Chennai 80
  • 81. Viewing Running Process (4)We can combine ps with grep to find a process byname.Ex: (1) ps aux | grep soffice● Lists the process whose name is soffice.● List the Process with its id, state, usage too. Open Technology Centre, Chennai 81
  • 82. Kill a Running Process (1)● ps is most often used to obtain the PID.● using pid kill/terminate a unintended process.● if the PID of a program is found to be 1125● combine ps with grep to find a process by name.Ex: kill process-id (1) Kill -9 1125 Open Technology Centre, Chennai 82
  • 83. Network Management in Linux● Viewing Networking Configurations● Viewing Routing Tables● Viewing Network Services and Ports Open Technology Centre, Chennai 83
  • 84. Introduction to NetworkingNetwork commands useful when networking withother computers.Within the network and across the internet,obtaining more information about othercomputers. Open Technology Centre, Chennai 84
  • 85. Basic Networking Commands ➔ ifconfig ➔ ping ➔ telnet ➔ dig ➔ nslookup ➔ traceroute ➔ hostname Open Technology Centre, Chennai 85
  • 86. Viewing Network Configurations (1)ifconfig - used to configure and view networkconfigurations.Ex: (1) ifconfig -a - shows the network interface about themachine. Open Technology Centre, Chennai 86
  • 87. Viewing Network Connections (2)pingSends an ICMP ECHO_REQUEST packet to thespecified host. If the host responds, you get anICMP packet back.Ex: (1) ping (xx - ip address or hostname) Open Technology Centre, Chennai 87
  • 88. Viewing Network Connections (2)telnet - ability to remotely log in and work on anothercomputer.Ex: telnet ip_number port_number (1) telnet 21 also tell whether the port is opened or not. Open Technology Centre, Chennai 88
  • 89. Viewing Network Connections (3)dig Is a DNS lookup utility used to perform DNSlookup and return the output from the internetservers.Ex: dig Open Technology Centre, Chennai 89
  • 90. Viewing Route Informations (1)route Show and manipulate the routing tables. Itmanipulates the IP routing table and set up therouting to the specific hosts in the network. Allows the user to modify the routing tablemanually using add or del options. Open Technology Centre, Chennai 90
  • 91. Viewing Route Informations (2)netstat● Output the network statistics includes routing table tables, interface statistics.● Print the list of open portsEx: (1) netstat -pant - Will display the currently opened ports in the system. Open Technology Centre, Chennai 91
  • 92. Viewing Route Informations (3)traceroute - network diagnostic tool. traceroute displays each host that a packettravels through as it tries to reach its destination.Ex: (1) traceroute - Shows each host will be displayed, along with the response times at each host. Open Technology Centre, Chennai 92
  • 93. Viewing Route Informations (4)nslookupQuery the internet domain name servers forgetting about the various hosts in the network.Ex: nslookup domain name (1) nslookup Open Technology Centre, Chennai 93
  • 94. Shell and Remote Copy● Secure Shell (ssh)● Secure Copy● rsync Open Technology Centre, Chennai 94
  • 95. Secure Shell ssh● Allows logging into remote machine● Provides secure encrypted communications● Must need an identityEx: ssh username@ip-address (1) ssh otc@ Open Technology Centre, Chennai 95
  • 96. Secure Copyscp● scp copies files between hosts on a network.● use ssh for data transfer● provides security as ssh.● scp will ask for passwords for authentication.Ex: (1) scp -r /data1root@ Open Technology Centre, Chennai 96
  • 97. rsync● rsync is focused on synching data from one disk location to another.● rsync remote-update protocol allows rsync to transfer just the differences between two sets of files across the network link.Ex: (1) rsync -avz root@ Open Technology Centre, Chennai 97
  • 98. File Archiving in Linux● File archiving● Creating Compressed Files Open Technology Centre, Chennai 98
  • 99. File Archiving (1)tarThe tar (tape archive) command bundles a bunchof files together and creates an archive.Ex: (1) tar -cvf archives.tar archives/ –c - Create a tar file –v - Verbose Mode –f - File Name Open Technology Centre, Chennai 99
  • 100. File Archiving (2)Ex: (2) tar -tvf archives.tar To view files in tar file.Ex: (3) tar -xvf archives.tar x – Extract the tar contents.Ex: (4) tar -rvf archives.tar testing.txt r – Append files to existing tar file. Open Technology Centre, Chennai 100
  • 101. File Archiving (3)dd● whose primary purpose is the low-level copying.● It can also be used in computer forensics.● Can snapchot magnetic pattern of an entire disk needs to be preserved as a byte-exact copy. Open Technology Centre, Chennai 101
  • 102. File Archiving (4)Hard Disk Clonedd if=/dev/sda of=/dev/sdb of is the distination and if is the source.Partition Clonedd if=/dev/sda1 of=~/disk2.imgBacking up a hard disk partition is much similar tobacking up a whole hard disk. Open Technology Centre, Chennai 102
  • 103. File Archiving (5)Restoring from an Image FileTo restore a partition or a hard disk from an imagefile, just exchange the arguments "if" and "of"For example, restore the whole hard disk from theimage file "disk1.img"Ex (1): dd if=disk2.img of=/dev/sda Open Technology Centre, Chennai 103
  • 104. zipzipThe zip program puts one or more compressed files into asingle zip archive, along with information about the files(name, path, date, time of last modification, protection,and check information to verify file integrity). An entiredirectory structure can be packed into a zip archive with asingle command. Compression ratios of 2:1 to 3:1 arecommon for text files. .Ex: (1) zip -r foo Open Technology Centre, Chennai 104
  • 105. unzipunzipUnzip is to extract into the current directory (andsubdirectories below it) all files from the specified ZIParchive.Ex: (1) unzip foo Open Technology Centre, Chennai 105
  • 106. Misc● Debugging● Time Management Command● Reboot, Poweroff, Shutdown● Shells● Printing● Man● Package Installation Open Technology Centre, Chennai 106
  • 107. Debugging (1)dmesg● Display the system control messages from the kernel ring buffer.● This buffer stores all messages since the last system boot, or the most recent onesEx: (1) dmesg Open Technology Centre, Chennai 107
  • 108. Time Management● hwclock - Set or read the hardware CMOS Clock.● uptime - reports how long the system is running● clock - used to set or get current time.● tset - used to set the users private time Zone.● w – Lists users currently logged into the system. Open Technology Centre, Chennai 108
  • 109. Printing System● CUPS - Common UNIX Printing System●CUPS is a open source printing system developedby Apple Inc.● CUPS is the software use to print fromapplications. Open Technology Centre, Chennai 109
  • 110. Printing System (1)● Access the Web Interface for Printing.● CUPS provides a web interface, that allows you to view print jobs, printers, and the online help, as well as manage your printers.● The CUPS web interface is available on your machine at the following URL:● http://localhost:631 Open Technology Centre, Chennai 110
  • 111. Printing System (2)lprsubmits files for printing, If no files are listed onthe command-line, lpr reads the print file from thestandard input.Ex: (1) lpr /home/html/index.html – This command will print the file index.html to the printer. (2) lprm 12 – This command will cancel pint job 12 in the printer queue. (3) lpq – Show the contents of the print queue. Open Technology Centre, Chennai 111
  • 112. manman is the system’s manual pager. Each pageargument given to man is normally the name of aprogram, utility or function. The manual pageassociated with each of these arguments is thenfound and displayed. A section, if provided, willdirect man to look only in that section of themanual. The default action is to search in all ofthe available sections, following a pre-definedorder and to show only the first page found, evenif page exists in several sections. Open Technology Centre, Chennai 112
  • 113. PACKAGE INSTALLATIONInstall packages from sourceThe installation procedure for software that comesin tar.gz and tar.bz2 packages isnt always thesame, but usually its like this:# tar xvzf package-name.tar.gz# cd package-name# ./configure# make# make install Open Technology Centre, Chennai 113
  • 114. PACKAGE INSTALLATION (2)Install package from ubuntu repository# sudo apt-get update - update ubuntu repository# sudo apt-get install <Package Name># sudo apt-get install apache2 - Install apache webserver from repository Open Technology Centre, Chennai 114
  • 115. PACKAGE INSTALLATION (3)Remove Package# sudo apt-get remove apache2 - remove packages from system# sudo apt-get remove --purge apache - remove packages with configuration files. Open Technology Centre, Chennai 115
  • 116. Server● Apache Webserver● PostgreSQL● OpenSSH Server● DHCP Server● FTP Server Open Technology Centre, Chennai 116
  • 117. APACHE SERVER● Web server● Fully open source● Developed by Apache Software Foundation● Directives that control the configuration of Apache.● Secure Sockets Layer. Open Technology Centre, Chennai 117
  • 118. POSTGRESQL SERVERPostgreSQL is a powerful, open source relational databasesystem.It runs on all major operating systems, including Linux, UNIX (AIX,BSD, HP-UX, SGIIRIX, Mac OS X, Solaris, Tru64), and Windows.PostgreSQL boasts sophisticated features such as Multi-VersionConcurrency Control (MVCC), point in time recovery, tablespaces,asynchronous replication, nested transactions (savepoints).Packages for PostgreSQL come with many Linux distributions, andit can be compiled and installed on almost all varieties of Unix. Open Technology Centre, Chennai 118
  • 119. POSTGRESQL SERVERPostgreSQL consists of a server process that reads and writes theactual database files, and a set of client programs thatcommunicate with the server.All of the PostgreSQL database files are stored under a directorysuch as /var/lib/pgsql or /usr/local/pgsql.The most important is pg_hba.conf, which lists client hosts that areallowed to connect to the server.This module allows an administration to manage databases,tables, fields and records in a PostgreSQL server. Open Technology Centre, Chennai 119
  • 120. OpenSSH ServerSecure Shell or SSH is a network protocol that allowsdata to be exchanged using a secure channel betweentwo networked devices.Ex: 1. ssh user@host 2. ssh -p user@host – connect to host on port as user. 3. ssh-copy-id user@host – add your key to host for user to enable a keyed or passwordless login. Open Technology Centre, Chennai 120
  • 121. DHCP SERVER● DHCP - Dynamic Host Configuration Protocol.● Provides advanced IP address allocation and management for TCP/IP LAN computing environments.● This protocol saves the system administrator much time having to manually configure each host workstation manually, and to maintain large databases storing IP assignment details. Open Technology Centre, Chennai 121
  • 122. FTP SERVER● FTP (File Transfer Protocol) is the simplest and most secure way to exchange files over the Internet.● The most common use for FTP is to download files from the Internet.FTP Types: ● Active ● Passive ● Asynchronous Open Technology Centre, Chennai 122
  • 123. Q/A SESSION Open Technology Centre, Chennai 123
  • 124. Thank you Open Technology Centre, Chennai 124