1. 在Linux下写一个shell脚本,统计某目录(如/turbomail/accounts 目录下)所有文件个数,包括包含所有层次子目录。
#方法1:
# cd /turbomail/accounts
# ls -lR |grep "^-" |wc -l
#方法2:
# cd /turbomail/accounts
# find . -maxdepth 1 -type f |wc -l
2. 在Linux下,让程序在操作系统启动时自动启动的方法有几种?分别列出。
方法1. /etc/rc.local中输入启动程序的shell;
方法2. crontab,设定程序的执行时间表;
方法3. 注册系统服务,chkconfig --add