Published on

Published in: Education, Technology
  • Be the first to comment

  • Be the first to like this

No Downloads
Total views
On SlideShare
From Embeds
Number of Embeds
Embeds 0
No embeds

No notes for slide


  1. 1. LINUX
  2. 2. WHAT IS LINUX? <ul><li>Linux is a free Unix-type operating system originally created by Linus Torvalds with the assistance of developers around the world. </li></ul><ul><li>Linux was developed under the GNU General Public License. </li></ul><ul><li>The source code for Linux is freely available to everyone, </li></ul>
  3. 3. HOW TO INSTALL LINUX? <ul><li>PREREQISITES :- </li></ul><ul><li>A running Ubuntu 8.04 or any ubuntu version installation. </li></ul><ul><li>A USB device (stick, pen-drive, USB hard disk) that has already been formatted with FAT32 and has enough free space to hold your Ubuntu installation image. </li></ul><ul><li>A Ubuntu CD image downloaded from the Ubuntu servers or mirrors (*.iso file). </li></ul>
  4. 4. INSTALLING LINUX (Contd...) STEP 1 : On the root directory of your USB device, create a folder “install” Copy the installer kernel and the initramdisk into this folder (Download source below.You need the files “vmlinux” and “initrd.gz”). Download source for the installer kernel and initramdisk STEP 2 : Note: You need to have the installer that fits the architecture of your Ubuntu version you want to install. In other words, you need a amd64 installer if you want to install an amd64 Ubuntu .iso image and the i386 installer for an i386 iso.
  5. 5. INSTALLING LINUX(Contd...) STEP 3 : From the installation iso image you downloaded, copy the folder “isolinux” to the root directory of your USB device (right-click on the .iso file, choose “extract here”). Rename “isolinux” into “syslinux”. Go inside the directroy “syslinux”. There, rename the file “isolinux.cfg” into “syslinux.cfg”. STEP 4 : Make the stick bootable: Use fdisk to set the boot flag, Install syslinux using the following command sudo aptitude install syslinux
  6. 6. INSTALLING LINUX (contd..) Now use syslinux to install a boot sector on your USB device sudo syslinux /dev/sdbX where sdbX is the device name and number of your USB device, check with “sudo mount”. A file called “ldlinux.sys” will be created in the root direcotry of the USB device.
  7. 7. INSTALLING LINUX (contd..) STEP 5 : Copy the Ubuntu CD image in the root directory of your USB device (Contents of USB you can see as follows).If you are using i386 you need to copy the complete .iso image in to the root directory of your USB device.
  8. 8. LINUX COMMANDS <ul><li>COMMANDS :- </li></ul><ul><li>Useradd – useradd creates a new user with specified options like username, home dir, group details, password, etc ... </li></ul><ul><li>Example : </li></ul><ul><li># useradd usr1 -- Add new user usr1 with default settings. </li></ul><ul><li># useradd usr1 -d /home2/usr1 -- Create the new user's home dir in /home2 </li></ul>
  9. 9. LINUX COMMANDS <ul><li>Userdel - Delete a user account and related file. </li></ul><ul><li>The userdel command modifies the system account files, deleting all entries that refer to login. userdel will not allow you to remove an account if the user is currently logged in. You must kill any running. </li></ul><ul><li>Example: </li></ul><ul><li># userdel usr1 -- Remove the usr1 account entry details. Home Dir will not be removed. processes which belong to an account that you are deleting </li></ul>
  10. 10. LINUX COMMANDS <ul><li>Groupadd - The groupadd command creates a new group account using the values specified on the command line and the default values from the system. </li></ul><ul><li>Example: </li></ul><ul><li># groupadd newgrp -- Create a new group </li></ul>
  11. 11. LINUX COMMANDS <ul><li>Groupmod -- The groupmod command modifies the system account files to reflect the changes that are specified on the command line. </li></ul><ul><li>Example: </li></ul><ul><li># groupmod -g 600 mygrp -- Change the mygrp Group ID to 600. </li></ul>
  12. 12. LINUX COMMANDS <ul><li>groupdel -- Delete a group </li></ul><ul><li>The groupdel command modifies the system account files, deleting all entries that refer to group. </li></ul><ul><li>Example: </li></ul><ul><li># groupdel mygrp -- Remove all entries about the mygrp. </li></ul>
  13. 13. LINUX COMMANDS <ul><li>chown -- CHange file OWNer and Group </li></ul><ul><li>`chown' changes the user and/or group ownership of each given file to the specified user and/or group. </li></ul><ul><li>Examples : </li></ul><ul><li>$ chown usr1 file1 -- Make usr1 as the owner of the file1. No change in the group. </li></ul>
  14. 14. LINUX COMMANDS <ul><li>chgrp -- CHange the GRouP ownership </li></ul><ul><li>`chgrp' changes the group ownership of each given file(s) to the specified group (group name or a numeric group id). </li></ul><ul><li>Examples : </li></ul><ul><li>$ chgrp grp1 file1 -- Change the group ownership to grp1. No change in the user ownership. </li></ul>
  15. 15. LINUX COMMANDS <ul><li>tac -- Concatenate and Print files in reverse order. </li></ul><ul><li>`tac' copies each file to standard output, reversing the records (lines by default) in each separately. It is doing the reverse function of the CAT command (TAC). </li></ul><ul><li>$ tac myfile -- Print the file (Line by Line) in reverse order. </li></ul><ul><li>Example : </li></ul><ul><li>$ tac myfile -- Print the file (Line by Line) in reverse order. </li></ul>
  16. 16. LINUX COMMANDS <ul><li>uname - Display system informations </li></ul><ul><li>Display system informations like OS Type, Kernel Version, Arch, Host Name etc., It will collect all this info from the /proc/sys/kernel/ {ostype, hostname, osrelease, version, domainname}. </li></ul><ul><li>Example : </li></ul><ul><li>$ uname -- Kernel Name </li></ul>
  17. 17. LINUX COMMANDS <ul><li>tree - List contents of dirs in a TREE-like format. </li></ul><ul><li>Tree is a recursive directory listing program that produces a listing of files in different formats according to the options. </li></ul><ul><li>Example : </li></ul><ul><li>$ tree -- Recursive listing of Dirs and files. </li></ul>
  18. 18. LINUX COMMANDS <ul><li>who -- show WHO is logged on. </li></ul><ul><li>`who' prints the info (login name, terminal line, login time, and remote hostname or X display) about each user currently logged on. `who' uses /var/run/utmp file to know about the current users. </li></ul><ul><li>Example : </li></ul><ul><li>$ who -- Show who are all logged on. </li></ul>
  19. 19. LINUX COMMANDS <ul><li>id - Print real & effective UIDs and GIDs </li></ul><ul><li>It prints the user's info like user id, group id, user name, etc., </li></ul><ul><li>Example : </li></ul><ul><li>$ id -- Print UID, GID, Groups. </li></ul>
  20. 20. LINUX COMMANDS <ul><li>dmesg - Print or Control the kernel ring buffer. </li></ul><ul><li>dmesg is used to examine or control the kernel ring buffer. The program helps users to print out their boot-up messages. </li></ul><ul><li>Example : </li></ul><ul><li>$ dmesg -- Print the kernel boot-up messages. </li></ul>
  21. 21. LINUX COMMANDS <ul><li>passwd - Update a user's authentication tokens(s). </li></ul><ul><li>Passwd is used to update a user's authentication tokens, like password, lifetime, etc.. Passwd is configured to work through the Linux-PAM API. </li></ul><ul><li>Example : </li></ul><ul><li>$ passwd -- Ask new passwd for your account. </li></ul>
  22. 22. LINUX COMMANDS <ul><li>lspci -- List all PCI device information. </li></ul><ul><li>$ lspci -- List all PCI device details in short form. </li></ul><ul><li>$ lspci -- List all PCI device details in short form. </li></ul>
  23. 23. LINUX COMMANDS <ul><li>lsusb -- List all USB devices. </li></ul><ul><li>lsusb is a utility for displaying information about all USB buses in the system and all devices connected to them. </li></ul><ul><li>Example : </li></ul><ul><li>$ lsusb -- List all USB device details in short form. </li></ul>
  24. 24. LINUX COMMANDS <ul><li>kill -- Sends a signal to processes. </li></ul><ul><li>The command kill sends the specified signal to the specified process or process group. If no signal is specified, the TERM signal is sent. Signals are used for inter process communications. Two kill commands are available. One is built-in SHELL (default) and 2nd is in /usr/bin/kill. </li></ul><ul><li>Example : </li></ul><ul><li>$ kill -l -- Print a list of signal names with numbers. </li></ul>
  25. 25. LINUX COMMANDS <ul><li>Usermod - The usermod command modifies the system account files to reflect thechanges that are specified, like Home dir, password, etc. on thecommand line. </li></ul><ul><li>Example: </li></ul><ul><li># usermod -d /home2/usr1 usr1 -- Create the new home Dir for usr1 in /home2 & Move old Dir contents to this Dir. </li></ul>
  26. 26. LINUX COMMANDS <ul><li>more -- File perusal filter for viewing. </li></ul><ul><li>Perusal means the act of reading, especially of reading through or with care. More is a filter for paging through text one screenful at a time. Press `q' to Quit. </li></ul><ul><li>Example : </li></ul><ul><li>$ more myfile1 myfile2 -- Show myfile 1 and 2 page by page. </li></ul>
  27. 27. LINUX COMMANDS <ul><li>smod -- Show the status of loaded Linux Kernel Modules. </li></ul><ul><li>Linux Kernel is a monolithic kernel with dynamic module loading </li></ul><ul><li>capability after booting. So a kernel module can be statically linked or dynamically loaded into the Kernel. lsmod will list the currently loaded kernel modules info from /proc/modules file. </li></ul><ul><li>Example : </li></ul><ul><li>$ lsmod </li></ul>
  28. 28. LINUX COMMANDS <ul><li>eject -- Eject the removable media. </li></ul><ul><li>Eject allows removable media (like CD-ROM, Floppy, Tape, JAZ, ZIP) to be ejected under software control. The command can also control some multi-disc CD-ROM changers, the auto-eject feature supported by some devices, and close the disc tray of some CD-ROM drives. </li></ul><ul><li>Example : </li></ul><ul><li>$ eject -- Eject the default device, mostly CD. </li></ul>
  29. 29. LINUX COMMANDS <ul><li>ldd -- Print shared Library Dependencies. </li></ul><ul><li>Most of the programs/libraries are linked to shared libraries, like libc, etc. If a particular shared library, needed by a program, is not present in the system, then that program will not run. ldd command is used to print the shared libraries required by each program or shared library specified on the command line. </li></ul><ul><li>Example : </li></ul><ul><li>$ ldd /bin/ls -- Print all shared libs needed for the ls command. </li></ul>
  30. 30. LINUX COMMANDS <ul><li>su -- Run a shell with Substitute User. </li></ul><ul><li>`su' allows one user to temporarily become another user. It runs a command with the Real & Effective user id, group id and supplemental groups of a given user. If user not given, it will login as root. </li></ul><ul><li>Example : </li></ul><ul><li>$ su -- Run a new shell with root user. </li></ul>
  31. 31. LINUX COMMANDS <ul><li>jobs -- Lists the active jobs. </li></ul><ul><li>jobs is bash build-in command, which is used to list the actives jobs in the current shell. </li></ul><ul><li>Example : </li></ul><ul><li>$ sleep 60 & -- Just run this command 5 times. Create dummy active jobs for testing. </li></ul>
  32. 32. LINUX COMMANDS <ul><li>wall -- Send a message to everybody's terminal. </li></ul><ul><li>Wall sends a message to everybody logged. The length of the message is limited to 20 lines. You MAY need root permission, on some system, to run this command. This command is used to pass the some critical information to all. </li></ul><ul><li>Example : </li></ul><ul><li># wall &quot;Welcome&quot; -- Send the string &quot;Welcome&quot; to all. </li></ul>
  33. 33. LINUX COMMANDS <ul><li>ping -- send ICMP ECHO_REQUEST to network hosts. </li></ul><ul><li>Packet InterNet Groper uses the ICMP protocol's mandatory </li></ul><ul><li>ECHO_REQUEST datagram to elicit an ICMP ECHO_RESPONSE from a host or gateway to find whether it is alive or not. </li></ul><ul><li>Example : </li></ul><ul><li>$ ping localhost -- Resolve the IP for localhost and Ping it. </li></ul>
  34. 34. LINUX COMMANDS <ul><li>whereis -- Locate the bin, src & man page for a file. </li></ul><ul><li>'whereis' locates source/binary and manuals sections for specified files. whereis will attempts to locate the desired program in a list of standard Linux places, which is hard-coded in it. </li></ul><ul><li>Example : </li></ul><ul><li>$ whereis ls -- Display the bin, src(if avail) and man page locations. </li></ul>
  35. 35. LINUX COMMANDS <ul><li>tar – Create / Add / Extract Tape ARchives files. </li></ul><ul><li>tar is an archiving program designed to store and extract files from an archive file known as a tar file. A tar file may be made on a tape drive, however, it is also common to write a tar file to a normal file. </li></ul><ul><li>Normally &quot;.tar&quot; file is not a compressed files, it is actually a collection of files within a single file. &quot;.tar.gz&quot;/ &quot;.tgz&quot; is collection of files in compressed mode. </li></ul><ul><li>Example : </li></ul><ul><li>$ tar -cf myfile.tar mydir -- Create new tar file. </li></ul>
  36. 36. LINUX COMMANDS <ul><li>lprm -- Cancel print jobs. </li></ul><ul><li>lprm cancels print jobs that have been queued for printing. If no arguments are supplied, the current job on the default printer is canceled. You can specify one or more job ID numbers to cancel those jobs, or use the - option to cancel all jobs. </li></ul><ul><li>Example : </li></ul><ul><li>$ lprm -- Cancel the current job on default printer. </li></ul>
  37. 37. LINUX COMMANDS <ul><li>hostid - Print the numeric id for the host. </li></ul><ul><li>It will print a 32-bit hexadecimal numerical identifier for the host machine. Certain product registration procedures use this number to brand a particular user license. The 32-bit quantity happens to be closely related to the system's IP address, but that isn't always the case. </li></ul><ul><li>If your IP address is then your hostid is A8C09B0E. </li></ul><ul><li>A8 -- 168 </li></ul><ul><li>C0 -- 192 </li></ul><ul><li>9B -- 155 </li></ul><ul><li>0E -- 14 </li></ul><ul><li>Example : </li></ul><ul><li>$ hostid -- Print the hostid of the current host. </li></ul>
  38. 38. LINUX COMMANDS <ul><li>cksum -- Computes a CRC (Cyclic Redundancy Check) checksum. </li></ul><ul><li>`cksum' prints the CRC checksum for each file along with the number of bytes in the file. The CRC algorithm is specified by the POSIX Std. It is not compatible with the BSD or System V `sum' algorithms. </li></ul><ul><li>Example </li></ul><ul><li>$ cksum file -- Prints the Checksum, No of Bytes and filename. </li></ul>
  39. 39. LINUX COMMANDS <ul><li>factor -- Print prime factors. </li></ul><ul><li>Print the prime factors of each number. The algorithm, it uses, is not very sophisticated. So, for some inputs `factor' runs for a long time. </li></ul><ul><li>Example </li></ul><ul><li>$ factor 25 -- Print prime factors </li></ul>
  40. 40. LINUX COMMANDS <ul><li>lsdev - Display information about installed hardware. </li></ul><ul><li>lsdev gathers information about your computer's installed hardware from the interrupts, ioports and dma files in the /proc directory, thus giving you a quick overview of which hardware uses what I/O addresses and what IRQ and DMA channels. This program only shows the kernel's idea of what hardware is present, not what's actually physically available in the system. </li></ul><ul><li>Example : </li></ul><ul><li>$ lsdev </li></ul>
  41. 41. LINUX COMMANDS <ul><li>colrm -- Remove columns from a file. </li></ul><ul><li>colrm removes selected columns from the input. Input is taken from STDIN and Output is sent to STDOUT. Column numbering starts with 1. </li></ul><ul><li>Example : </li></ul><ul><li>$ ls -l | colrm 35 -- Remove all columns after the 34th column. </li></ul>
  42. 42. LINUX COMMANDS <ul><li>printenv - Print All/Part of Environment. </li></ul><ul><li>`printenv' prints environment variables with its Name and Value. </li></ul><ul><li>Example : </li></ul><ul><li>$ printenv -- Print all Env variables and its value. </li></ul>
  43. 43. LINUX COMMANDS <ul><li>nohup -- Run a command even after HangUP (logout). </li></ul><ul><li>`nohup' runs the given COMMAND with hangup signals ignored, so that the command can continue running in the background after you log out. `nohup' does not run the command in the background. We have do it by ending command line with an `&'. </li></ul><ul><li>Example : </li></ul><ul><li>$ cat > myscript </li></ul><ul><li>sleep 60 </li></ul><ul><li>echo a </li></ul><ul><li>date </li></ul><ul><li>Press Ctrl+D to save and exit. </li></ul><ul><li>$ chmod 555 myscript -- Add execute permission. </li></ul>
  44. 44. LINUX COMMANDS <ul><li>updatedb -- Update the locate DateBase. </li></ul><ul><li>locate command is doing the quick search by using the database created by this updatedb command. Normally this command is run by cron at some periodic interval to keep the DB upto date. </li></ul><ul><li>Example : </li></ul><ul><li># updatedb -u -- Create DB starting at / (root). </li></ul>
  45. 45. LINUX COMMANDS <ul><li>bg -- Place a job in BackGround. </li></ul><ul><li>Normally user can run a job in background, by adding & at end of the </li></ul><ul><li>command (ex: sleep 10 &). </li></ul><ul><li>bg is a shell command. It is used to move a job from foreground to the background, as if it had been started with `&'. If JOB is not present, the shell's notion of the current job is used. </li></ul><ul><li>Example : </li></ul><ul><li>$ sleep 100 -- Start a dummy job in foreground. </li></ul><ul><li>Press Ctrl+z to stop the current job. </li></ul>