文件脚本
#!/bin/bash
file_path=$1
modify_time=`stat -c %x $file_path`
echo $modify_time
format_time=`date --date="$modify_time" "+%F %T"`
echo $format_time
判断给定路径文件是否存在
#!/bin/bash
file_path=$1
modify_time=`stat -c %x $file_path`
echo $modify_time
format_time=`date --date="$modify_time" "+%F %T"`
echo $format_time
if [ -f "$file_path" ]; then
echo "exist"
else
echo "empty"
fi