Successfully reported this slideshow.

Linux lesson

2,306 views

Published on

This is the presentation For introducing lesson for a XI std student as per the Tamil Nadu Government Syllabus

  • Hi,

    This is an excellent presentation. We would like to invite you host a course on www.ivarsity.net on Linux.

    Do let us know

    Regards
    Bala
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here

Linux lesson

  1. 1. LINUX An Operating system
  2. 2. Topics to be covered <ul><li>History of linux </li></ul><ul><li>Logging in/ Logging out of Linux </li></ul><ul><li>The Linux File system </li></ul><ul><li>Types of users </li></ul><ul><li>Directory commands </li></ul><ul><li>File commands </li></ul><ul><li>File systems : Mount and unmount </li></ul><ul><li>VI Editor </li></ul>
  3. 3. Contd <ul><li>Shell script </li></ul><ul><li>Variables </li></ul><ul><li>Expressions </li></ul><ul><li>Command substitution </li></ul><ul><li>Features of Linux </li></ul>
  4. 4. History of Linux <ul><li>Linus Torvalds – founder </li></ul><ul><ul><li>Student of Helsinki University @ Finland </li></ul></ul><ul><ul><li>Had a Project to be done according to norms of university </li></ul></ul><ul><ul><li>Using Minix Students did project </li></ul></ul><ul><ul><ul><li>Minix – version of unix prepared by Prof.Andrew S.Tannenbaum. </li></ul></ul></ul><ul><ul><ul><li>Unix – An operating system - created mainly by the efforts of Ken Thompson. </li></ul></ul></ul><ul><ul><li>Linus was very much attracted by the elegance and effectiveness of its parent Unix </li></ul></ul>
  5. 5. History of Linux continued <ul><li>Linus Torvalds decided to develop an effective PC version of Unix for Minix users. </li></ul><ul><li>Named it as Linux [his first name + the last letter of Unix/Minix] </li></ul><ul><li>Released the version 0.11 in the year 1991. </li></ul><ul><li>Linux was widely distributed over the Internet. </li></ul><ul><li>In the subsequent years, refined the new operating system, Linux and added some features found in standard Unix systems. </li></ul><ul><li>Interested programmers all over the world contributed something to the improvement of Linux. </li></ul><ul><li>So it has got a distinctive advantage over the other Operating Systems. </li></ul>
  6. 6. History continued… Linux Vs Other OS <ul><li>The Linux code was available to one and all. </li></ul><ul><li>Anybody could fix the errors, under friendly atmosphere without any constraint. All these produced useful code. </li></ul><ul><li>Linux has all the utilities needed for the the Internet. </li></ul><ul><li>In its simplest format, it can run effectively requiring just 4MB of memory. It is amazing that this operating system with all its features, occupies such a small memory. </li></ul><ul><li>More stable and speedy. </li></ul><ul><li>Normally, the Operating Systems are developed under a closed environment. </li></ul><ul><li>A very limited number of people were allowed to remove the errors in the entire code within a fixed deadline </li></ul><ul><li>Need much more memory to run these OS. </li></ul>
  7. 7. History of Linux continued <ul><li>Even though Linux was developed by the contribution of many people throughout the world, it is not unwieldy. </li></ul><ul><li>Developed from the beginning as per ANSI standard for Unix called POSIX . </li></ul><ul><ul><li>POSIX -Portable Operating system Interface for Computer Environments (POSIX). </li></ul></ul><ul><li>Linux is specifically designed for Intel-based PCs. </li></ul>
  8. 8. Versions of Unix <ul><li>Two versions. </li></ul><ul><ul><li>Stable version i.e a standard version </li></ul></ul><ul><ul><li>Trial (beta) version i.e version opened for all to contribute their innovations. </li></ul></ul><ul><li>Version named as n. x .y. </li></ul><ul><ul><li>n specifies version number. </li></ul></ul><ul><ul><li>second number x specifies version type </li></ul></ul><ul><ul><ul><li>If it is even stable otherwise it is a beta version. </li></ul></ul></ul><ul><li>Example 2.2.5, here </li></ul><ul><li>Second number x = 2. Therefore this is a stable version. </li></ul>
  9. 9. Internet in Linux <ul><li>The Internet is a boon for Linux development </li></ul><ul><li>it enables the people through out the world to interact with others to develop Linux. </li></ul><ul><li>Today, many companies provide support for Linux over the Internet. </li></ul><ul><li>There are many Linux groups on the Internet, and registration to these forums is free. </li></ul><ul><li>We can subscribe to and get the latest information from these forums. </li></ul>
  10. 10. Logging-in in Linux <ul><li>Linux systems allow many users to work simultaneously. (Multi User Operating System ) </li></ul><ul><li>A user at a user terminal establishing connection to the Linux system is called logging in . </li></ul><ul><li>When switched on in Linux </li></ul><ul><ul><li>The system will show some information </li></ul></ul><ul><ul><li>Then Login prompt will appear. (prompt is a helping message). There you enter your user name which is the location </li></ul></ul><ul><li>Login means user ID </li></ul>
  11. 11. Why do we login? <ul><li>Consider the following situation. </li></ul><ul><ul><li>Assume a house with many rooms </li></ul></ul><ul><ul><li>one person occupies one room and each room contains invaluable treasure. </li></ul></ul><ul><ul><li>How will you safeguard each room of that house? </li></ul></ul><ul><ul><ul><li>The answer is “ The entire house should be locked inside and a watchman should be employed”. </li></ul></ul></ul><ul><ul><ul><li>The arrangement is that you should tell him your name and your identity code. </li></ul></ul></ul><ul><ul><ul><li>He has a list of names and matching identity codes for each individual. </li></ul></ul></ul><ul><ul><ul><li>If the name and the identity code match with any of the name and its identity code, then and only then, he will allow you to enter into your room. Otherwise you will be asked to repeat your name and identity code. This process continues until user says the valid name and identity code. </li></ul></ul></ul>
  12. 12. Why do we login? …. continued <ul><li>In the same way when we connect to the Linux system, you will be asked to enter your Login name at the Login prompt. </li></ul><ul><ul><li>you have to enter your Login name </li></ul></ul><ul><ul><li>Then you will be shown the Password prompt. You have to enter your password. To keep your password a secret, the Linux system will not display your password. </li></ul></ul><ul><li>The system compares these two items with the system files. If the match is not found, then you should enter these two items. Of course, if the match is found you will be shown the following prompt; </li></ul><ul><li>[students@localhost students] $ </li></ul><ul><li>Here you assume your login name is students. </li></ul>
  13. 13. Things to be remembered while logging in <ul><li>be careful about the lower case and upper case letters because the system is case sensitive. So the verification process does not allow any unauthorized person to access any of your directories or files. </li></ul><ul><li>Normally, not necessarily, the name of the user is the Login name. </li></ul><ul><li>The Home Directory is assigned to the user when he/she enters into the system for the first time, by the System Administrator ( SA ). </li></ul>
  14. 14. Logout Process <ul><li>If you come out of the system without closing your /home directory then the other people may tamper with your work. So it is mandatory to Logout of the Linux system. </li></ul><ul><li>To log out follow the following steps. </li></ul><ul><ul><li>Type the command exit or logout </li></ul></ul><ul><ul><ul><li>So prompt will end your current Linux session </li></ul></ul></ul><ul><ul><li>Then the system displays the Login prompt on the screen for other users. </li></ul></ul>
  15. 15. Changing the password <ul><li>In Linux a user can change his/her password using the passwd command. </li></ul><ul><li>The steps followed by the user, (students), to change the password are depicted below. For Example the prompt is as follows: </li></ul><ul><li>[students@localhost students]$ </li></ul><ul><li>Now you type passwd. After typing the prompt looks like this </li></ul><ul><li>[students@localhost students]$ passwd </li></ul><ul><li>Changing password for students (current ) password: </li></ul><ul><li>New password: </li></ul><ul><li>Enter the new password : </li></ul><ul><li>Retype new password: </li></ul><ul><li>passwd: all authentication tokens updated successfully </li></ul><ul><li>[students@localhost students]$ </li></ul>
  16. 16. Keeping up Authenticity while password changing <ul><li>The passwd command asks for the old password. This command is essential to check up the authenticity of the user , otherwise the mischief mongers will play havoc on the work of the other people. Again the system demands that the user should make up his/her mind about the </li></ul><ul><li>new password. That is why it asks the new password twice. </li></ul>
  17. 17. Example <ul><li>[students@localhost students]$ passwd </li></ul><ul><li>Changing password for students </li></ul><ul><li>( current ) password: User enters the current password) </li></ul><ul><li>New passwd: (User enters the new password) </li></ul><ul><li>Retype new password: (User misspells the new password) </li></ul><ul><li>Sorry, passwords do not match </li></ul><ul><li>New password: </li></ul>
  18. 18. If current password misspelled ….? <ul><li>Then you may not be an authenticated user. So, there is a suspicion that you are trying to change someone else’s password. </li></ul><ul><li>Therefore you will not be allowed to change the password. </li></ul>
  19. 19. If two entries of the new password do not match ….? <ul><li>Then the system is in a dilemma. The system does not know which is to be accepted. </li></ul><ul><li>So, your new password is out rightly rejected. </li></ul><ul><li>Hence you should be careful about the old as well as the new passwords. </li></ul>
  20. 20. Rules for changing the password <ul><li>The password should not be less than six characters in length. </li></ul><ul><li>From old, new should be differ at least 3 positions. </li></ul><ul><li>The password should be different from the user’s Login name. </li></ul><ul><li>The new password cannot be the same as the old password. </li></ul><ul><li>It is ridiculous to change the password with same password. </li></ul><ul><li>Since the SA can execute control over the entire system, SA can change the password of any user of the Linux system. </li></ul>
  21. 21. The Linux File System <ul><li>File is a collection of records. </li></ul><ul><li>A record gives information about an entity. </li></ul><ul><ul><li>For example your mark sheet also is a record explaining performance of the entity student. </li></ul></ul><ul><li>A record consists of fields. Elementary fields cannot be further subdivided to give any meaning. Name, Rollno are examples for fields. </li></ul><ul><li>Directory. This is a collection of files, which is called as a directory </li></ul>File Collection of records Collection of fields Mark register Mark details of each student (Row) R.No, Name, Tam, Eng….(Each Headings)
  22. 22. Directory <ul><li>The collection of same type of files is placed in a directory. </li></ul><ul><li>A single fixed disk can store thousands of files. Arranging the files in the above mentioned manner would make accession a particular file easier. </li></ul><ul><li>All the files are stored on the disk under one main directory called the root directory. The files are arranged under a tree structure. </li></ul><ul><ul><li>If you stand on your head and watch a tree (without trunk), the root of the tree is at the top then comes braches, braches will give rise to other branches and ends up with leaves. The leaf represents the file, the branches represent directories or sub directories and the root as you have guessed is the root directory. </li></ul></ul><ul><li>The root directory has been further sub-divided into directories </li></ul>
  23. 23. Arrangement of Directories in Linux <ul><li>The root directory has been further sub-divided into directories such as bin, boot, home, usr, etc, lib, dev, tmp . </li></ul><ul><li>User directories are created under the home directory. The home directory is written as /home. </li></ul><ul><li>This shows that home directory is the child of / ( called root) directory and root directory is the parent of home directory. There is no parent for the root directory. There is no child for the file. </li></ul><ul><li>When a child is born, the child should be named. In a similar fashion, when you create a file, you should name it. </li></ul>
  24. 24. Rules to create (Name) a file <ul><li>The file name </li></ul><ul><li>1. may contain characters, underscores, numbers, periods and commas. </li></ul><ul><li>2. can be up to 256 characters. </li></ul><ul><li>3. should not have a number as the first character. </li></ul><ul><li>4. should not begin with a period. </li></ul><ul><li>5. should not contain slash, question mark and asterisk. </li></ul><ul><li>6. should not duplicate command names. </li></ul><ul><li>(Under certain special circumstances you may </li></ul><ul><li>start a filename with a period, you will be in a better position if </li></ul><ul><li>you do not make use of it. If a file starts with a dot, that file </li></ul><ul><li>is called a dot file. The dot files are used normally by the </li></ul><ul><li>system.) </li></ul>
  25. 25. Parts of the File Name <ul><li>The filename may have a primary and a secondary name. </li></ul><ul><li>Primary (or proper) name: Name before the period </li></ul><ul><li>Secondary Name or extension: Name after the period. </li></ul><ul><li>extension - to classify the files. </li></ul><ul><li>Example: Files with </li></ul><ul><li>extension c (.c files) represents c files. </li></ul>File name Primary Secondary
  26. 26. Linux file system
  27. 27. Naming of files <ul><li>The name that you give, when you create a file or directory, is not its full name. </li></ul><ul><li>The full name of a directory is its path name. </li></ul><ul><li>The tree structure of the file system can be used to unambiguously identify and refer any directory or file. </li></ul><ul><li>For example full name of the file C programming is in the above tree structure is /home/kumaran/cprogramming </li></ul>
  28. 28. Types of Users Types of Users <ul><li>The System </li></ul><ul><li>Administrator </li></ul><ul><li>or </li></ul><ul><li>the Root User </li></ul>2. File Owner 3. Group Owner 4. Other Users
  29. 29. The System Administrator (SA) or the Root User <ul><li>SA is primarily responsible for the smooth functioning of the system. </li></ul><ul><li>The SA also creates /home directories for the users </li></ul><ul><li>Does the service to groups of users for the system. </li></ul><ul><li>SA is the only one to use floppy disk and CD-ROM in the system and takes backups to prevent loss of data due to system breakdown. </li></ul><ul><li>In Linux,SA is also known as the root user or super user. </li></ul><ul><li>The prompt for the root user is # while the prompt for others is $. </li></ul>
  30. 30. 2. File Owner <ul><li>The user who creates a file is said to be the owner of that file. </li></ul><ul><li>The owner of a file can perform any operation on that file such as copying, deleting, and editing. </li></ul><ul><li>He/she can execute a file after changing the file access permission by chmod command. </li></ul>
  31. 31. 3. Group Owner <ul><li>A group of people who work on a single project should share their files for efficiency. </li></ul><ul><li>The files are created in the group leader’s /home directory. </li></ul><ul><li>All the members of the group share their files. </li></ul><ul><li>This group of people is called group users. A group of users is also given a name, just as a user is given a name. </li></ul>
  32. 32. 4. Other Users <ul><li>All the users of the system who are not members of a project group are referred to as Other Users, for the files of that group. Other Users are users who do not belong to that particular group. </li></ul>
  33. 33. Commands <ul><li>Directory Commands </li></ul><ul><ul><li>pwd ( p rint w orking d irectory or p ath of your w orking d irectory or the p resent w orking d irectory) </li></ul></ul><ul><ul><li>Changing the Current Directory </li></ul></ul><ul><ul><li>Creating a Directory </li></ul></ul><ul><ul><li>Removing a Directory </li></ul></ul><ul><ul><li>Listing the Contents of a Directory </li></ul></ul><ul><li>Other Commands </li></ul><ul><ul><li>Manipulating the screen </li></ul></ul><ul><ul><li>Extracting the Help </li></ul></ul><ul><ul><li>The echo Command </li></ul></ul>
  34. 34. The general form of Commands <ul><li>Command works </li></ul><ul><ul><li>without option or an argument or without both </li></ul></ul><ul><ul><li>with argument alone, </li></ul></ul><ul><ul><li>with option alone and </li></ul></ul><ul><ul><li>with both </li></ul></ul>Command option argument Example Command option argument ls - ls not used - ls –l - ls -l not used ls *.c - ls not used *.c ls -l file1 - ls -l file1 ls - helps to list out the contents of directory
  35. 35. Parts of a command <ul><li>Command </li></ul><ul><li>Option </li></ul><ul><li>Argument </li></ul>
  36. 36. command <ul><li>Command consists of a single word. </li></ul><ul><li>Generally starts with an alphabet. </li></ul><ul><li>Do not try to have any control over the names of the commands. </li></ul><ul><li>Should give the spelling and case as such. </li></ul>
  37. 37. Option <ul><li>Starts with a minus (dash) sign followed by a single letter </li></ul><ul><ul><li>but you can combine two options. Case of the letter is very important. </li></ul></ul><ul><li>There should be no blank space between the minus sign and the letter. </li></ul><ul><li>The minus sign distinguishes an option from a command and argument. </li></ul><ul><li>The same option will not behave in the same fashion with different commands. </li></ul><ul><li>The option is influenced by the command preceding it. </li></ul>
  38. 38. argument <ul><li>Argument usually refers the name of the file on which the command should work with. </li></ul><ul><li>It should start with an alphabet. </li></ul><ul><li>Some system files called dot files start with a . (dot) . </li></ul>
  39. 39. Example for command Example Command option argument ls - ls not used - ls –l - ls -l not used ls *.c - ls not used *.c ls -l file1 - ls -l file1 Consider a command ls. ls - helps to list out the contents of directory
  40. 40. Explanation for the above example <ul><li>ls – lists the contents of directory </li></ul><ul><li>ls –l - lists to have more information about the files and sub-directories </li></ul><ul><li>ls *.c - listing only all c programs in the present directory </li></ul><ul><li>ls -l file1 – listing the file named file1 and its information </li></ul>
  41. 41. The path names <ul><li>Path name are used to uniquely identify the files and directories. </li></ul><ul><li>For example consider the file system of linux </li></ul><ul><ul><li>even though there are two bins and two personal directories, they can be uniquely identified by the system because of the path name. </li></ul></ul><ul><ul><li>The path names for the bin directories are </li></ul></ul><ul><ul><li>/bin </li></ul></ul><ul><ul><li>/user/bin. </li></ul></ul><ul><li>The first slash (/) in the path name always represents the root directory </li></ul>
  42. 42. Continued… examples - paths <ul><li>Similarly the path names of the personal directories are </li></ul><ul><ul><li>/home/kumaran/personal </li></ul></ul><ul><ul><li>/home/students/personal. </li></ul></ul><ul><li>Even though the personal directories shared the common path upto /home, they take different routes later </li></ul><ul><li>This tree structure prevents the name collision. </li></ul>
  43. 43. Points to be remembered while mentioning path names <ul><li>If you place all your files at one place, the same names cannot be used. Further it will take more time to search for a particular file. </li></ul><ul><li>In Linux, you write a path name by listing each directory in the path separated by a forward slash. </li></ul><ul><li>As already stated, a slash before the first directory in the path, represents the root . </li></ul><ul><li>Path name also applies to files. The file is created within a directory by specifying a name. The system identifies the file with filename combined with the path of the directories from the root to the file’s directory. </li></ul>
  44. 44. Two Types of Path Names <ul><li>1. the Absolute path name and </li></ul><ul><li>2. the Relative path name. </li></ul><ul><li>An absolute path name is the complete path name of a file or directory starting with root directory. </li></ul><ul><li>A relative path name begins with your working directory. It is the path of the file relative to your working directory. </li></ul><ul><li>Referring to the directory structure , if your working directory is kumaran, the relative path name for the file ‘job’ is </li></ul><ul><li> /personal/job. </li></ul><ul><li>The absolute path name for the same file is /home/kumaran/personal/job. </li></ul>
  45. 45. pwd – Command to identify the current path <ul><li>pwd ( p rint w orking d irectory or p ath of your w orking d irectory or the p resent w orking d irectory) is handy when we need to find the present path where we currently work. </li></ul><ul><li>For example assume that students login has logged on the system and given pwd command in the $ prompt as follows: </li></ul><ul><li>[students@localhost students] $ pwd </li></ul><ul><li>The response will be the absolute path name as follows </li></ul><ul><li>/home/students </li></ul>
  46. 46. Changing the Current Directory <ul><li>The cd ( c hange d irectory) command changes the current directory to the specified directory. For example the current user students wants to switch over from her home directory to /usr/bin. </li></ul><ul><li>She first finds out the current directory to ascertain her position and then she switches over to /user/ bin. </li></ul><ul><li>For that purpose she has to execute the following commands at the command prompt. </li></ul>
  47. 47. Example for cd command <ul><li>[students@localhost students] $ pwd </li></ul><ul><li>/home/students </li></ul><ul><li>[students@localhost students] $ cd /user/bin </li></ul><ul><li>[students@localhost bin ] $ pwd </li></ul><ul><li>/user/bin </li></ul>
  48. 48. Important notes in handling cd command <ul><li>The cd command without any path name always takes a user to his/her home directory. </li></ul><ul><li>The double dots ( ..) denote the path of parent directory. </li></ul><ul><li>The single dot( . ) represents the directory itself. There should be a blank space between cd and .. and there should be no blank space between the two dots. </li></ul><ul><li>The tilde sign (~) is a substitute for your home directory. </li></ul><ul><li>/home/kumaran/health </li></ul><ul><li>A directory under another directory is called the subdirectory of the latter directory. </li></ul>
  49. 49. Variety examples – cd command From current directory to its subdirectory called personal cd ~/personal Moves to the directory bin whose path is entirely different from current directory. cd /user/bin Moving to its subdirectory cd .. / health To home directory cd ~ To home directory. cd Moving to parent directory of the current directory cd .. Purpose Command
  50. 50. Creating a Directory <ul><li>mkdir command is used </li></ul><ul><li>mkdir means Make Directory </li></ul><ul><li>This command creates the directory specified after the mkdir command , under the current directory </li></ul><ul><li>But the newly created directory will not become the current directory automatically. </li></ul><ul><li>If you want move to the newly created directory you have to make use of cd command. </li></ul>
  51. 51. Examples for mkdir command <ul><li>mkdir insurance </li></ul><ul><li>This command helps in creating a directory named insurance under the current directory. </li></ul><ul><li>To create a directory, but not under the current directory use the absolute path name for the directory name </li></ul><ul><li> mkdir /usr/bin/ insurance </li></ul>
  52. 52. Removing a Directory <ul><li>There is a provision to remove a directory also </li></ul><ul><li>rmdir command is used. </li></ul><ul><li>rmdir means r emove d irectory </li></ul>
  53. 53. Conditions for removing a directory <ul><li>To remove a directory the directory </li></ul><ul><ul><li>1) should be empty and </li></ul></ul><ul><li> 2) should not be the current directory. </li></ul><ul><li>Example ( assume directory insurance is empty) Then rmdir command can be applied on it. </li></ul><ul><li>We can use full path for removing a directory not from current directory </li></ul>
  54. 54. Listing contents of a directory <ul><li>to find out the name of the files and the subdirectories of a directory. </li></ul><ul><li>ls command is used to list out contents. </li></ul><ul><li>Suppose to find out contents of the directory /home/students give the command as follows. </li></ul><ul><li>ls /home/students </li></ul>
  55. 55. Variety examples – ls command Lists the information about the current directory ls Any of these commands lists all files including hidden files along with their information. ls –al ls –la ls –a-l ls –l–a . to list hidden files also ls –a to list more information about the files and sub directories ls –I The option -F adds / at the end of the directories and sub-directories ls –F Purpose Command
  56. 56. Options used with ls command Displays the files of almost all directories except the . and .. Directories -A Sorts by file size. -s Displays files and sub-directories in the reverse order. -r Lists Working Directory as well as all sub-directories. -R Shows the file type along with the name (‘/’is added at the end of each directory to distinguish it from file). -F Lists all the files including hidden files. -a Function Option
  57. 57. Other Commands-screen <ul><li>Manipulating the screen </li></ul><ul><li>The clear command clears the screen. </li></ul><ul><li>The same thing can be achieved by tput clear command also. </li></ul><ul><li>The command tput cup 20 20 will position the cursor at row 20, column 20 </li></ul>
  58. 58. Other commands - Extracting the Help <ul><li>If you want to have help for some command say ls you have to use the command man ( man ual). The man command works as Man Friday (a general servant or employee who does all kinds of jobs) </li></ul><ul><li>Example: </li></ul><ul><li>$ man ls </li></ul><ul><li>You can also specify the level of help you need from man , the level number should be specified in between man and the command for which the help is sought. Now you can get help, online. </li></ul>
  59. 59. echo command <ul><li>works as a combination of printf () and “ ” of C programming. </li></ul><ul><li>to display a message to the user you can make use of echo command. </li></ul><ul><li>Example: </li></ul><ul><li> $ echo “ Please enter your name” </li></ul><ul><li>The message Please enter your name is displayed and cursor comes to the next line. </li></ul><ul><li>To make cursor to remain along the message give command as follows (The “ ” may/may not be given. </li></ul><ul><li>$ echo -n “ Please enter your name ” </li></ul>
  60. 60. Commonly used commands are <ul><li>· pwd Prints the current working directory. </li></ul><ul><li>. man gets help </li></ul><ul><li>. mkfs formats a floppy. </li></ul><ul><li>· cd changes the current working directory </li></ul><ul><li>· mkdir creates. a new directory . </li></ul><ul><li>· rmdir Removes an empty directory </li></ul><ul><li>· ls-l displays the contents of a directory. </li></ul><ul><li>. echo used for prompting. </li></ul>
  61. 61. Arrangement of files <ul><li>Arranged as a continuous stream of bytes. </li></ul><ul><li>Only one standard type of file called byte-stream file. </li></ul><ul><li>The input data stream is called as the standard input </li></ul><ul><li>The output stream is called as standard output . </li></ul>
  62. 62. Byte-stream file <ul><li>The input data are converted into the data stream of continuous set of bytes - called the standard input. </li></ul><ul><li>Normally the standard input is connected to the key board. </li></ul><ul><li>The standard output is also data stream of continuous set of bytes. </li></ul><ul><li>Normally the standard output is connected to the printer. </li></ul><ul><li>The standard input can be redirected to the floppy disk etc. </li></ul><ul><li>Same way standard output can also be redirected to a storing device such as CD, floppy. </li></ul>
  63. 63. File Commands <ul><li>cat command </li></ul><ul><li>more command </li></ul><ul><li>tee command </li></ul><ul><li>sort command </li></ul><ul><li>cp command </li></ul><ul><li>rm command </li></ul>cat and more are filters.
  64. 64. cat command <ul><li>Displaying the contents of the file </li></ul><ul><ul><li>Cat out of the bag </li></ul></ul><ul><ul><li>List of linux commands and their purpose </li></ul></ul>
  65. 65. Editors in linux <ul><li>Many available </li></ul><ul><li>But two of them are standard </li></ul><ul><ul><li>ed - for one line editing </li></ul></ul><ul><ul><li>vi editors - to edit text of one screen at a time. </li></ul></ul><ul><ul><ul><li>More advantageous </li></ul></ul></ul>
  66. 66. VI editor <ul><ul><li>to edit text of one screen at a time. </li></ul></ul><ul><ul><li>More advantageous </li></ul></ul><ul><ul><li>Modes of using keyboard </li></ul></ul><ul><ul><ul><li>(1) command mode </li></ul></ul></ul><ul><ul><ul><ul><li>keyboard keys become editing commands </li></ul></ul></ul></ul><ul><ul><ul><li>(2) input mode. - </li></ul></ul></ul><ul><ul><ul><ul><li>behaves as a normal typewriter with the exception </li></ul></ul></ul></ul>
  67. 67. <ul><li>When you change the mode, the functionality of the keyboard also changes. For example when in the command mode, the key x, just like the delete key of your ordinary keyboard, erases the character where the cursor is on. In the input mode the same key x simply adds x to the </li></ul><ul><li>file. The ESC key is the only exception. While you are in the input mode, if you press ESC key, you will be taken to the command mode but if you are in the command mode itself, there is a beep sound. This activity can be of much help to a novice user of the Vi editor. If you have doubt </li></ul><ul><li>about the mode in which you are working, press ESC key. If you hear a beep sound, you can conclude that you are in the command mode and if you do not hear the beep sound, you can presume that you are in the command mode at present, but previously ( before presing ESC key ) you were in the input mode. So ESC key eliminates lot of confusions. Even though Vi command mode handles many editing operations effectively, it cannot perform actions such as file saving. The line editing </li></ul><ul><li>commands handle these actions. When you are in the command mode (the colon) : takes you to the line-editing mode. After completing the necessary actions if you press ENTER key that will take you again to the command mode. In addition to the modes that you already know, you have been introduced to the line mode also. </li></ul>

×