Copyright (C) 2000 M K Saravanan http://www.mksarav.org Written on 15th June 2000. Last modified on Sat Nov 15 02:23:43 SGT 2003 Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.1 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts and no Back-Cover Texts. You can download a copy of the license from http://www.gnu.org/copyleft/fdl.txt ============================================================================== 1. To change your password: passwd Type your current password and then your new password. 2. Instead of man pages you can also use a help facility called "info". Try: info sort info bash 3. The shell you are using by default, under Linux is called "bash" shell stands for "Bourne Again SHell". "bash" has a rich set of inbuilt shell programming commands. for more info about shell programming "info bash". 4. You can use the grep command to search a particular piece of text in a file. For e.g do the following exercise: cat > temp.txt My name is Saravanan. I have a good friend called Ranjan. Press ^D to save the above two lines in the file temp.txt. This way you can indirectly use your cat as a simple editor. grep called temp.txt What is the output you got? Now try the following: who | grep finger | grep 5. There is a wonderful and universally highly used editor called "vi" (otherwise called as "vim" ) in linux. Actually it is an improved version of original "vi" editor. You can invoke "vi" by typing: vi (or) vim Try the following: vi test2.c Press "i" to get into "insert" mode. vi uses two modes called "command mode" and "normal typing mode". To return to command mode Press Esc. To return to normal typing mode press "i" (for insert) or "a" (for append). type: God is Great. Press Esc type a colon and "wq" (for write and quit). :wq To comeout without saving you can use: :q! 6. If you want to locate the pathname of a command use: whereis date whereis ls whereis cp 7. The command "which" will also produce similar result: which date which mv 8. If you don't know a command name but know the keyword use the following to find out in which man pages those keyword appear: man -k sort apropos sort Both "man -k" and "apropos" command will produce the same result. 9. All the process running in Linux is otherwise called as jobs. To view the currently running process under Linux: ps ps -aux //list all the running process of all the users ps -aux | grep ranjan //process belongs to ranjan. In Unix each process will have a Process Id. called "pid". The ps command will list the pid. Suppose if some program got hang, then you can kill the coresponding process using it pid. Try the follwing: pico test.txt // run this command in one window Login in another window. use ps -aux | grep "pico test.txt" Note down the pid. Let's say it is 1029. kill -9 1029 will kill the process. 10. To logout from a system you can use any one of the following: logout exit ^D ===============================================================================