drwxr--r--

链接   硬链接   软链接

#ln      源文件    链接文件         #ln -s

# ln -s /application/apache2.2..17/  /application/apache

# ll -li a b c

402871 -rw-r--r-- 2 root root 3 3月  27 19:10 a

402872 lrwxrwxrwx 1 root root 1 3月  27 19:16 b -> a

402871 -rw-r--r-- 2 root root 3 3月  27 19:10 c

对目录只能创建软链接  

2个条件同时具备

文件的应连接数 i-link=0 就被删除了

创建一个文件i_link=1,创建硬链接i_link=2,

是否有进程占用这个文件  有进程占用这个文件为i_count+1   i_count=0就删除了。

亿图图示专家

# yum -y install httpd

# grep log httpd.conf   --color=auto

# sed -i 's@CustomLog logs/access_log combined@Customlog   /app/log/access_log  combined@g'  /etc/httpd/conf/httpd.conf

# mkdir /app/log -p

# dd if=/dev/zero  of=/dev/sdc  bs=8k  count=10

# mkfs  -t ext3 /dev/sdc

# mount /dev/sdc /app/log/  -o loop

# df -h

# tail -f access_log

# rm -f access_log

# lsof | grep del

# /etc/init.d/httpd restart 

1删除文件,重启

2清空文件,不删除

3不要删当天的被进程占用的文件,删一起的。

# for n in `seq  100000`; do  curl -s 192.168.10.10 > /dev/null; done

# >access_log清空文件

# lsof -i :22

# ls -ld /hequan/ett/

drwxr-xr-x 2 root root 4096 3月  27 20:08 /hequan/ett/

# info ln

mkdir -p /hequan/ett/xx

[root@localhost ~]# ls -ld /hequan/ett

drwxr-xr-x 3 root root 4096 3月  27 20:09 /hequan/ett

# type cd

# id root

uid=0(root) gid=0(root) 组=0(root)

# ps -ef |  grep httpd

# usermod -s /sbin/nologin xx

# useradd mysql -g mysql -s /sbin/nologin -M

chattr +i /etc/passwd /etc/shadow /etc/group  /etc/gshadow 

access  访问时间

modify  修改时间

change  改变时间

mtime 修改时间  # ls -lt

ctime  状态改变世界

atime  最后访问时间

# stat a

ls -l --time-style=long-iso