Flylib.com

Books Software

 
 
 

top-displays top CPU processes

 <  Day Day Up  >  

top ”displays top CPU processes

top [-] [d delay] [q] [c] [S] [s] [i]

top provides an ongoing look at the CPU's activity in real time and a listing of the most CPU- intensive tasks .

 <  Day Day Up  >  
 <  Day Day Up  >  

touch ”updates access time and/or modification time of a file

touch [ amc ] [ mmddhhmm [ yy ] ] filename...

touch causes the access and modification times of each argument to be updated. The filename is created if it does not exist. If no time is specified the current time is used.

Example A.61.
touch a b c

EXPLANATION

Three files, a , b , and c are created. If any of them already exist, the modification time-stamp on the files is updated.

 <  Day Day Up  >  
 <  Day Day Up  >  

tput ”initializes a terminal or queries the terminfo database

tput [ Ttype ] capname [ parms...]

tput [ Ttype ] init

tput [ Ttype ] reset

tput [ Ttype ] longname

tput S <<

tput uses the terminfo database to make the values of terminal-dependent capabilities and information available to the shell (see sh ), to initialize or reset the terminal, or return the long name of the requested terminal type.

Example A.62.
1   tput longname

2   bold=`tput smso`

    unbold=`tput rmso`

    echo "${bold}Enter your id: ${offbold}\c"

EXPLANATION

  1. Displays a long name for the terminal from the terminfo database.

  2. Sets the shell variable bold to turn on the highlighting of displayed text. Then sets the shell variable unbold to return to normal text display. The line Enter your id: is highlighted in black with white letters . Further text is displayed normally.

 <  Day Day Up  >  
 <  Day Day Up  >  

tr translates characters

tr [ cds ] [ string1 [ string2 ] ]

tr copies the standard input to the standard output with substitution or deletion of selected characters. Input characters found in string1 are mapped into the corresponding characters of string2 . The forward slash can be used with an octal digit to represent the ASCII code. When string2 (with any repetitions of characters) contains fewer characters than string1 , characters in string1 with no corresponding character in string2 are not translated. Octal values for characters may be used when preceded with a backslash:

\11

Tab

\12

Newline

\042

Single quote

\047

Double quote


Example A.63.
1   tr 'A' 'B' < filex

2   tr '[A-Z]' [a-z]' < filex

3   tr -d ' ' < filex

4   tr -s '' '' < filex

5   tr -s ':' ' ' < filex

6   tr '7' '2'

EXPLANATION

  1. Translates As to Bs in filex .

  2. Translates all uppercase letters to lowercase letters .

  3. Deletes all spaces from filex .

  4. Replaces (squeezes) multiple tabs with single tabs in filex .

  5. Squeezes multiple colons into single spaces in filex .

  6. Translates double quotes to single quotes in text coming from standard input.

 <  Day Day Up  >