Flylib.com

Books Software

 
 
 

ps-reports process status

 <  Day Day Up  >  

ps reports process status

ps [ acdefjl ] [ g grplist ] [ p proclist ]

   [ s sidlist ] [ t term ] [ u uidlist ]

ps prints information about active processes. Without options, ps prints information about processes associated with the controlling terminal. The output contains only the process ID, terminal identifier, cumulative execution time, and the command name . Otherwise, the information that is displayed is controlled by the options. The ps options are not the same for AT&T and Berkeley type versions of UNIX.

Example A.42.
1   ps -aux  grep '^linda'

#  ucb

2   ps -ef  grep '^ *linda'

# at&t


EXPLANATION

  1. Prints all processes running and pipes the output to the grep program, and printing only those processes owned by user linda, where linda is at the beginning of each line. (UCB version)

  2. Same as the first example, only the AT&T version.

 <  Day Day Up  >  
 <  Day Day Up  >  

pstree ”displays a tree of processes

pstree [-a] [-c] [-h] [-l] [-n] [-p] [-u] [-G-U][piduser]

pstree -V

pstree shows running processes as a tree. The tree is rooted at either pid or init if pid is omitted. If a username is specified, all process trees rooted at processes owned by that user are shown. pstree visually merges identical branches by putting them in square brackets and prefixing them with the repetition count, for example:

init-+-getty

    -getty

    -getty

    '-getty

becomes

init---4*[getty]

 <  Day Day Up  >  
 <  Day Day Up  >  

pwd ”displays the present working directory name

 <  Day Day Up  >  
 <  Day Day Up  >  

quota ”displays users' disk usage and limits

quota [ -guvv  q ]

quota [ -uvv  q ] user

quota [ -gvv  q ] group

quota displays users' disk usage and limits. By default, only the user quotas are printed.

-g

Prints group quotas for the group of which the user is a member.

-u

An optional flag, equivalent to the default.

-v

Displays quotas on file systems where no storage is allocated.

-q

Prints a more terse message, containing only information on filesystems where usage is over quota.


 <  Day Day Up  >  
 <  Day Day Up  >  

rcp ”remote file copy

rcp [ p ] filename1 filename2

rcp [ pr ] filename...directory

The rcp command copies files between machines in the following form:

remotehostname:path

user@hostname:file

user@hostname.domainname:file

Example A.43.
1   rcp dolphin:filename /tmp/newfilename

2   rcp filename broncos:newfilename

EXPLANATION

  1. Copies filename from remote machine dolphin to /tmp/newfilename on this machine.

  2. Copies filename from this machine to remote machine broncos and names it newfilename.

 <  Day Day Up  >