UNIX Shells by Example
Authors: Quigley E.
Published year: 2004
Pages: 383-389/454
Buy this book on amazon.com >>
 <  Day Day Up  >  

stty ”sets the options for a terminal

stty [ a ] [ g ] [ modes ]

stty sets certain terminal I/O options for the device that is the current standard input; without arguments, it reports the settings of certain options.

Example A.54.
1   stty erase <Press backspace key> or ^h

2   stty -echo; read secretword; stty echo

3   stty -a (AT&T) or stty -everything (BSD)

EXPLANATION

  1. Sets the Backspace key to erase.

  2. Turns off echoing; waits for user input; turns echoing back on.

  3. Lists all possible options to stty .

 <  Day Day Up  >  
 <  Day Day Up  >  

su ”become superuser or another user

su [  ] [ username [ arg ... ] ]

su allows one to become another user without logging off. The default username is root (superuser). To use su , the appropriate password must be supplied (unless the invoker is already root). If the password is correct, su creates a new shell process that has the real and effective user ID, group IDs, and supplementary group list set to those of the specified username. The new shell will be the shell specified in the shell field of username's password file entry. If no shell is specified, sh (Bourne shell) is used. To return to normal user ID privileges, type Ctrl-D to exit the new shell. The option specifies a complete login.

 <  Day Day Up  >  
 <  Day Day Up  >  

sum ”calculates a checksum for a file

 <  Day Day Up  >  
 <  Day Day Up  >  

sync ”updates the superblock and sends changed blocks to disk

 <  Day Day Up  >  
 <  Day Day Up  >  

tabs ”sets tab stops on a terminal

 <  Day Day Up  >  
 <  Day Day Up  >  

tail ”displays the tail end of a file

tail +[number [ lbc ] [ f ] [ filename ]

tail +[number [ l ] [ rf ] [ filename ]

When a plus sign precedes the number, tail displays blocks, characters , or lines counting from the beginning of the file. If a hyphen precedes the number, tail counts from the end of the file.

Example A.55.
1   tail +50 filex

2   tail -20 filex

3   tail filex

EXPLANATION

  1. Displays contents of filex starting at line 50.

  2. Displays the last 20 lines of filex .

  3. Displays the last 10 lines of filex .

 <  Day Day Up  >  
 <  Day Day Up  >  

talk ”allows you to talk to another user

talk username [ ttyname ]

talk is a visual communications program that copies lines from your terminal to that of another user.

Example A.56.
talk joe@cowboys

EXPLANATION

Opens a request to talk to user joe on a machine called cowboys .

 <  Day Day Up  >  
UNIX Shells by Example
Authors: Quigley E.
Published year: 2004
Pages: 383-389/454
Buy this book on amazon.com >>

Similar books on Amazon

Similar books