- 递归修改文件后缀名
find ./ -name "*.c" | awk -F "." '{print $2}' | xargs -i -t mv ./{}.c ./{}.cpp
- 判断进程是否已启动
ps -ef | grep 进程名 | grep -v grep
if [ $? -ne 0 ];then
echo "not runing"
else
echo "runing"
fi
- 文件拷贝显示进度
rsync -avh --progress source_file destination_directory/
- 当前时间后退20s
date;date -s "$(date --date='-20 seconds' '+%Y-%m-%d %H:%M:%S')";date