View stunning SlideShares in full-screen with the new iOS app!Introducing SlideShare for AndroidExplore all your favorite topics in the SlideShare appGet the SlideShare app to Save for Later — even offline
View stunning SlideShares in full-screen with the new Android app!View stunning SlideShares in full-screen with the new iOS app!
Command takes the standard input from the keyboard and sends the standard output to the terminal window.<br />You can modify the default action of the standard input, standard output, and standard error within the shell by redirecting stdin, stdout, and stderr.<br />
Sends the output from a command into a file instead of sending the output to the screen. As the command generates error messages, these messages are sent to the standard error. Usually error messages are sent to the terminal screen.
Using the greater than (>) metacharacter to direct the standard output to a file instead of printing the output to the screen. If file does not exist, the system creates it. If the file exists, the redirection overwrites the contents of the file.
User initialization file<br />The primary purpose of the user initialization files is to define the characteristics of a user’s work environment, such as the command-line prompt, the environment variables, and the windowing environment.<br />
The commands in the initialization file is executed :
LOGNAME Define the user’s login name<br />HOME Sets the path to the user’s home directory. It is the default <br /> argument for the cd command.<br />SHELL Sets the path to the default shell.<br />$ Hold the id no. of current shell<br />0 Hold the name of the current shell<br />PATH Sets the default path that the shell searches to find commands.<br />MAIL Sets the path to the user’s mailbox.<br />TERM Defines the terminal.<br />LPDEST Sets the user’s default printer.<br />PWD Defines the current working directory.<br />PS1 Defines the shell prompt for the Bourne or Korn shell.<br />
List all environmental variable (having value) + exported local variableenv<br />printenv<br />List all environmental variable (having value) + exported and un exported local variableexport<br />set <br /> <br />
File name globing
* : Zero or more matching <br />? : any character matching<br />: Range matching [a-c] as example<br />
If you don’t add & from the beginning and then 2 numbers will be displayed the job id [as when more than one job is running in back ground they are put in stack ]and the process id [ we deal with this number in process management]
ps -e : Prints information about every process on the system
ps -u username : List the process of certain user
ps -p processid : Prints information about this process [ps –p $$]
Know process id of process:<br />pgrep processname<br />Send signals process:<br />
Kill -l : view all the signals available
Kill -signal no pid : Send the signal to process
2Interrupt[ctrl+c] exit without saving can be ignored23Stop running [ctrl+z]25Continue running15“default if no signal is specified with kill” exit after saving can be ignored9Terminate without saving and cannot be ignored
pkill -signal nopname : Send the signal to process by the name
pkill -u username : To terminate the processes owned by this user