登陆环境

首先看看/etc/passwd
它保存着用户名、加密后的密码等信息,我们登录系统所有信息都要在里面查找
-bash-3.00$ cat /etc/passwd | tr ":" "\t" | sort -k0
adm     x       4       4       Admin   /var/adm
bin     x       2       2               /usr/bin
daemon  x       1       1               /
gdm     x       50      50      GDM Reserved UID        /
jiang   x       100     1               /       /bin/sh
listen  x       37      4       Network Admin   /usr/net/nls
lp      x       71      8       Line Printer Admin      /usr/spool/lp
noaccess        x       60002   60002   No Access User  /
nobody  x       60001   60001   NFS Anonymous Access User       /
nobody4 x       65534   65534   SunOS 4.x NFS Anonymous Access User     /
nuucp   x       9       9       uucp Admin      /var/spool/uucppublic   

/usr/lib/uucp/uucico
root    x       0       0       Super-User      /       /bin/bash
smmsp   x       25      25      SendMail Message Submission Program     /
sys     x       3       3               /
ttaserv x       101     100             /       /bin/sh
ttasys  x       102     100             /       /bin/sh
uucp    x       5       5       uucp Admin      /usr/lib/uucp
webservd        x       80      80      WebServer Reserved UID  /
www     x       81      81      WebServer User  /
-bash-3.00$ cat /etc/passwd | sed -n  '/jiang/'p
jiang:x:100:1::/:/bin/sh
-bash-3.00$ cat /etc/passwd | sed -n  '/jiang/'p | tr ':' '\t'
jiang   x       100     1               /       /bin/sh


用户登录时自动读取/etc/profile 此文件包含:
  • 全局或局部环境变量。
  • PATH信息
  • 终端设置
  • 安全命令
  • 日期信息或放弃操作信息

让我们来看一个详细的profile
-bash-3.00$ cat /etc/profile
#ident  "@(#)profile    1.19    01/03/13 SMI"   /* SVr4.0 1.3   */

# The profile that all logins get before using their own .profile.

trap ""  2 3 #忽略两个信号,即使用QUIT退出或<Ctrl-c>键停止文件执行


ulimit -d 100000 #限制内存溢出,设置数据段的最大值:单位kbytes
export LOGNAME PATH #导出LOGNAME 和 PATH
export LANG=C #设置语言环境
if [ "$TERM" = "" ] #设置终端类型
then
        if /bin/i386
        then
                TERM=sun-color
        else
                TERM=sun
        fi
        export TERM
fi

#       Login and -su shells get /etc/profile services.
#       -rsh is given its environment in its .profile.

case "$0" in

-sh | -ksh | -jsh | -bash)

        if [ ! -f .hushlogin ]
        then
                /usr/sbin/quota
                #       Allow the user to break the Message-Of-The-Day only.
                trap "trap '' 2"  2
                /bin/cat -s /etc/motd
                trap "" 2

                /bin/mail -E
                case $? in #建立邮件信息(当有新邮件到达时显示提示信息)
                0)
                        echo "You have new mail."
                        ;;
                2)
                        echo "You have mail."
                        ;;
                esac
        fi
esac

umask 022 #设置umask值,使文件创建时带有一定的缺省权限位集
trap  2 3 #重新设置捕捉信号<Ctrl-C>和QUIT,即恢复信号量的默认操作

# add by jianghua

export
PATH=$PATH:/usr/local/bin:/usr/local/mysql/bin:/opt/SunStudio_11/SUNWspro/bin:/usr/ccs/bin:

/usr/sfw/bin:.
export HISTSIZE=1000
export HISTFILESIZE=1000
#
# Show Unix-Center.Net Welcome Message in Chinese
#
show_welcome_message


用户的$HOME.profile
下面显示如何在命令提示符中设置主机名:
-bash-3.00$ PS1='$PWD >'
/home/l/g/tomotoboy >export PS1


stty用于设置终端特性。要查询现在的stty选项,使用stty -a
/home/l/g/tomotoboy >stty -a
speed 9600 baud;
rows = 25; columns = 82; ypixels = 0; xpixels = 0;
csdata ?
eucw 1:0:0:0, scrw 1:0:0:0
intr = ^c; quit = ^\; erase = ^?; kill = ^u;
eof = ^d; eol = <undef>; eol2 = <undef>; swtch = <undef>;
start = ^q; stop = ^s; susp = ^z; dsusp = ^y;
rprnt = ^r; flush = ^o; werase = ^w; lnext = ^v;
-parenb -parodd cs8 -cstopb -hupcl cread -clocal -loblk -crtscts -crtsxoff -parext

-ignbrk brkint -ignpar -parmrk -inpck -istrip -inlcr -igncr icrnl -iuclc
ixon -ixany -ixoff imaxbel
isig icanon -xcase echo echoe echok -echonl -noflsh
-tostop echoctl -echoprt echoke -defecho -flusho -pendin iexten
opost -olcuc onlcr -ocrnl -onocr -onlret -ofill -ofdel tab3


创建.logout文件
trap "$HOME /.logout " 0

/home/l/g/tomotoboy >cat .logout
rm -f $HOME/*.txt
rm -f $HOME/*.tmp
rm -f $HOME/x*
echo "Bye...bye $LOGNAME"


你可能感兴趣的:(mysql,F#,bash,Access,sun)