A "process" is the UNIX abstraction that
manages the Memory, CPU, and I/O resources
that comprise a running program.
kidpid = fork(); if (kidpid == 0) { /* child should exec somthing */ } else { /* parent can continue or wait */ }
% ps -H ps: illegal option -- H usage: ps [ -aAdeflcjLPy ] [ -o format ] [ -t termlist ] [ -u userlist ] [ -U userlist ] [ -G grouplist ] [ -p proclist ] [ -g pgrplist ] [ -s sidlist ] 'format' is one or more of: user ruser group rgroup uid ruid gid rgid pid ppid pgid sid pri opri pcpu pmem vsz rss osz nice class time etime stime f s c lwp nlwp psr tty addr wchan fname comm args % ps PID TTY TIME CMD 17020 pts/3 0:01 tcsh % ps -f UID PID PPID C STIME TTY TIME CMD ics54 17020 17018 0 14:03:26 pts/3 0:01 -tcsh % ps -u$USER | more PID TTY TIME CMD 17322 pts/5 0:00 more 17212 pts/5 0:01 tcsh 17020 pts/3 0:02 tcsh 17332 pts/3 0:00 more 17330 pts/5 0:00 vi 17256 pts/5 0:01 vi % ps -f -u$USER | more UID PID PPID C STIME TTY TIME CMD ics54 17322 17212 0 14:41:18 pts/5 0:00 more ics54 17212 17210 0 14:34:16 pts/5 0:01 -tcsh ics54 17020 17018 0 14:03:26 pts/3 0:02 -tcsh ics54 17325 17212 0 14:42:14 pts/5 0:00 vi s1.txt s2.txt ics54 17327 17020 0 14:42:19 pts/3 0:00 more ics54 17256 17212 0 14:35:58 pts/5 0:01 vi ../c20.html
crontab Installs, Edits, Lists, or Removes a user's crontab file
crontab [ filename ] crontab -e [ username ] crontab -l [ username ] crontab -r [ username ]
If you inadvertently enter the crontab command with no argument,
do not attempt to get out by typing CTRL-D.
This removes all entries in your crontab file.
Instead, exit by typing your interrupt character (normally CTRL-C).
minutes hours day_of_month month day_of_week command
Fields are separated by spaces or tabs
0 0 * * 1-5 /usr/local/weekdays 0 0 * * 0,6 /usr/local/weekends # days-daze runs on 1st, 15th, and every Monday 0 0 1,15 * 1 /home/guest/bin/days-daze 0 0 * * 1 /home/guest/bin/Only-on-Mondays # 0 1 * * * write guest % Good Guests Leave % by 1 a.m. 15 0 * * * /usr/etc/sa -s >/dev/null 15 4 * * * find /var/preserve -mtime +7 -a -exec rm -f {} ';' 40 4 * * * find / -name '#*' -atime +3 -exec rm -f {} ';'
% man -s 4 passwd File Formats passwd(4) NAME passwd - password file SYNOPSIS /etc/passwd DESCRIPTION /etc/passwd is a local source of information about users' accounts. The password file can be used in conjunction with other password sources, including the NIS maps passwd.byname and passwd.bygid and the NIS+ table passwd . Programs use the getpwnam(3C) routines to access this infor- mation. Each passwd entry is a single line of the form: username:password:uid:gid:gcos-field:home-dir:login-shell where username is the user's login name. It is recommended that this field conform to the checks performed by pwck(1M). password is an empty field. The encrypted password for the user is in the corresponding entry in the /etc/shadow file. pwconv(1M) relies on a special value of 'x' in the password field of /etc/passwd. If this value of 'x' exists in the password field of /etc/passwd, this indicates that the password for the user is already in /etc/shadow and should not be modified. uid is the user's unique numerical ID for the system. gid is the unique numerical ID of the group that the user belongs to. gcos-field is the user's real name, along with information to pass along in a mail-message heading. (It is called the gcos-field for historical reasons.) An ``&'' (ampersand) in this field stands for the login name (in cases where the login name appears in a user's real name). home-dir is the pathname to the directory in which the user is initially positioned upon logging in. login-shell is the user's initial shell program. If this field is empty, the default shell is /usr/bin/sh. The maximum value of the uid and gid fields is 2147483647. To maximize interoperability and compatibility, administra- tors are recommended to assign users a range of UIDs and GIDs below 60000 where possible. The password file is an ASCII file. Because the encrypted passwords are always kept in the shadow file, /etc/passwd has general read permission on all systems and can be used by routines that map between numerical user IDs and user names. Previous releases used a password entry beginning with a `+' (plus sign) or `-' (minus sign) to selectively incorporate entries from NIS maps for password. If still required, this is supported by specifying ``passwd : compat'' in nsswitch.conf(4). The "compat" source may not be supported in future releases. The preferred sources are, "files" fol- lowed by "nisplus". This has the effect of incorporating the entire contents of the NIS+ passwd table after the password file. EXAMPLES Example 1: A sample passwd file. Here is a sample passwd file: root:q.mJzTnu8icF.:0:10:God:/:/bin/csh fred:6k/7KCFRPNVXg:508:10:& Fredericks:/usr2/fred:/bin/csh and the sample password entry from nsswitch.conf: passwd: files nisplus In this example, there are specific entries for users root and fred to assure that they can login even when the system is running single-user. In addition, anyone in the NIS+ table passwd will be able to login with their usual pass- word, shell and home directory. If the password file is: root:q.mJzTnu8icF.:0:10:God:/:/bin/csh fred:6k/7KCFRPNVXg:508:10:& Fredericks:/usr2/fred:/bin/csh + and the password entry from nsswitch.conf is: passwd: compat then all the entries listed in the NIS passwd.byuid and passwd.byname maps will be effectively incorporated after the entries for root and fred. .... SunOS 5.7 Last change: 14 May 1998
% man -s 4 shadow File Formats shadow(4) NAME shadow - shadow password file DESCRIPTION /etc/shadow is an access-restricted ASCII system file that stores users' encrypted passwords and related information. The shadow file can be used in conjunction with other shadow sources, including the NIS maps passwd.byname and passwd.byuid and the NIS+ table passwd . Programs use the getspnam(3C) routines to access this information. The fields for each user entry are separated by colons. Each user is separated from the next by a newline. Unlike the /etc/passwd file, /etc/shadow does not have general read permission. Each entry in the shadow file has the form: username:password:lastchg:min:max:warn:inactive:expire:flag The fields are defined as follows: username The user's login name (UID). password A 13-character encrypted password for the user, a lock string to indicate that the login is not accessible, or no string, which shows that there is no password for the login. lastchg The number of days between January 1, 1970, and the date that the password was last modified. min The minimum number of days required between pass- word changes. max The maximum number of days the password is valid. warn The number of days before password expires that the user is warned. inactive The number of days of inactivity allowed for that user. expire An absolute date specifying when the login may no longer be used. flag Reserved for future use, set to zero. Currently not used. The encrypted password consists of 13 characters chosen from a 64-character alphabet (., /, 0-9, A-Z, a-z). To update this file, use the passwd(1), useradd(1M), usermod(1M), or userdel(1M) commands. In order to make system administration manageable, /etc/shadow entries should appear in exactly the same order as /etc/passwd entries; this includes ``+'' and ``-'' entries if the compat source is being used (see nsswitch.conf(4)). ... SunOS 5.7 Last change: 10 Dec 1991