shell基础十二篇_学习笔记_2_useradd_groupadd_passwd

useradd与groupadd命令
useradd添加用户,常用的选项有
-m 添加/home/xxx目录
-m, –create-home create home directory for the new user
account

-g 用户组的gid 指定用户所属的gid。
-g, –gid GROUP force use GROUP for the new user account

-G 附加组
-G, –groups GROUPS list of supplementary groups for the new
user account

例如abc用户属于abc的组,也属于root的组,abc组的gid为111
useradd -m -g 111 abc -G root abc

-s 指定用户的登录Shell
-s, –shell SHELL the login shell for the new user account

-p 密码

Read more »

shell基础十二篇_学习笔记_1_chmod_date_chattr

权限命令: chmod
1为运行; 2为可写; 4为只读
所以3为可写可运行;5为可读可运行;6为可读可运行;7为可读可写可运行

我按字面意思理解:
u就是user
g就是group
o就是other
a就是all

所以
chmod 777
chmod a+xwr
chmod ugo+xwr
得到的结果会是一样的.

修改时间命令: date
例如修改为 1999年1月1日 01:01 分 [ 可以精确到秒 ]
date -s “1999/01/01 01:01”

debian:~/test# date
2009年 04月 11日 星期六 16:46:33 EDT

debian:~/test# date -s “1999/01/01 01:01”
1999年 01月 01日 星期五 01:01:00 EST
Read more »

shell监控系统服务

shell监控系统服务,除了root用户以外,其他用户运行的程序如果CPU超过25%的话,就会发生警报并且写进B.txt文件

  1. #!/bin/bash
  2. A=`ps aux|awk '$1!="root"{print $0}'|awk '$3>25{print $PID}'`
  3. if [[ -z $A ]]
  4.   then
  5. exit 0
  6.  else
  7.  echo "$A" >> /root/A.txt
  8. B=`cat /root/A.txt|wc -l`
  9. if [[ $B -gt 5 ]]
  10.   then
  11. echo "$A" >> /root/B.txt && rm /root/A.txt
  12. fi fi

Kaspersky(卡巴斯基)6.0key(无限期补丁)

如果您的卡巴斯基版本为6.0的话,按照我这里的方法一步一步的操作,可以让你的卡巴斯基使用无限期时间!尽量详细点,让不太懂的朋友也能看清楚!
文章中提到的三个工具都在压缩包里,文章后面有下载地址,解压密码为我博客的域名.
1) 将 “卡巴6.0_2010.key” 这个文件放到c盘或其他盘下,不要有更深的目录或中文名.
2) 安装卡巴斯基
3) 安装过程中将刚才放在C盘的key导入.
4) 可能会提示 ” key被列入黑名单 ” ,这个不太要紧.
Read more »

2009年4月3日 pagerank更新了

距上次1月1日更新后,都整整3个月了,前两天看我的pagerank有3啦,暗自高兴一下!
您的pr升了没?