root pts/3 2017-10-26 08:47 (192.168.30.1)
[root@localhost pts]# who
root tty1 2017-10-24 19:32
root pts/3 2017-10-26 08:47 (192.168.30.1)
root pts/4 2017-10-26 08:49 (192.168.30.1)
[root@localhost pts]# w
09:24:55 up 16:43, 3 users, load average: 0.00, 0.01, 0.05
USER TTY FROM LOGIN@ IDLE JCPU PCPU WHAT
root tty1 Tue19 7:19 0.48s 0.48s -bash
root pts/3 192.168.30.1 08:47 7.00s 0.10s 0.00s w
root pts/4 192.168.30.1 08:49 23:27 0.02s 0.00s write root pts/3
[root@localhost pts]# write root pts/4
please keep quit^H^H^H
^C[root@localhost pts]# lastlog
Username Port From Latest
root pts/4 192.168.30.1 Thu Oct 26 08:49:56 +0800 2017
bin **Never logged in**
daemon **Never logged in**
adm **Never logged in**
lp **Never logged in**
sync **Never logged in**
shutdown **Never logged in**
halt **Never logged in**
mail **Never logged in**
operator **Never logged in**
games **Never logged in**
ftp **Never logged in**
nobody **Never logged in**
systemd-network **Never logged in**
dbus **Never logged in**
polkitd **Never logged in**
postfix **Never logged in**
sshd **Never logged in**
lzc **Never logged in**
[root@localhost pts]# last
root pts/4 192.168.30.1 Thu Oct 26 08:49 still logged in
root pts/3 192.168.30.1 Thu Oct 26 08:47 still logged in
root pts/2 192.168.30.1 Wed Oct 25 15:54 - 09:20 (17:26)
root tty1 Tue Oct 24 19:32 still logged in
reboot system boot 3.10.0-693.el7.x Tue Oct 24 19:32 - 09:26 (1+13:53)
wtmp begins Tue Oct 24 19:32:30 2017
$( )中放的是命令,相当于` `,例如todaydate=$(date +%Y%m%d)意思是执行date命令,返回执行结果给变量todaydate,也可以写为todaydate=`date +%Y%m%d`;
root@localhost ~]# echo $(date)
Thu Oct 26 09:56:13 CST 2017
[root@localhost ~]# date +%F
2017-10-26
[root@localhost ~]# date +%F -d 1day
2017-10-27
[root@localhost ~]# date +%F -d -1day
2017-10-25
[root@localhost ~]# `date +%F`
-bash: 2017-10-26: command not found
[root@localhost ~]# echo `date`
Thu Oct 26 09:58:54 CST 2017
[root@localhost ~]# echo `date +%F`
2017-10-26
[root@localhost ~]# echo `date +%F`todya
2017-10-26todya
数组定义:用 a=(0 1 2 3),打印用 echo ${a[1]}
2>&1和1> 2>的用法
[root@localhost ~]# ls a>test.f 2>&1
[root@localhost ~]# cat test.f
ls: cannot access a: No such file or directory
[root@localhost ~]# ls a 2>>test.f
[root@localhost ~]# cat test.f
ls: cannot access a: No such file or directory
ls: cannot access a: No such file or directory
孤儿进程:一个父进程退出,而它的一个或多个子进程还在运行,那么那些子进程将成为孤儿进程。孤儿进程将被init进程(进程号为1)所收养,并由init进程对它们完成状态收集工作。
僵尸进程:一个进程使用fork创建子进程,如果子进程退出,而父进程并没有调用wait或waitpid获取子进程的状态信息,那么子进程的进程描述符仍然保存在系统中。这种进程称之为僵死进程。
#locale -a 查看已经安装的语言包
#locale 查看当前系统的语言环境