格式 MMDDhhmm
touch -t 10112200 new.txt
格式 yyyyMMDDhhmm
touch -t 200910112200 new.txt
创建与已存在文件相同时间
touch -r /etc/passwd new.txt
格式 MMDDhhmm
touch -t 10112200 new.txt
格式 yyyyMMDDhhmm
touch -t 200910112200 new.txt
创建与已存在文件相同时间
touch -r /etc/passwd new.txt
find ./ -type f -iname '*test*' -exec ls -l {} \; -rw-r--r-- 1 mysql mysql 0 Dec 22 14:01 ./TEST -rw-r--r-- 1 mysql mysql 0 Dec 3 14:01 ./TEST_20161203 -rw-r--r-- 1 mysql mysql 0 Dec 13 14:01 ./TEST_20161213 $ date Fri Dec 23 17:35:17 CST 2016
查找修改时间为9天以前的文件
find ./ -type f -iname '*test*' -mtime +9 -exec ls -l {} \; -rw-r--r-- 1 mysql mysql 0 Dec 3 14:01 ./TEST_20161203 -rw-r--r-- 1 mysql mysql 0 Dec 13 14:01 ./TEST_20161213
查找修改时间为20天以内的文件
find ./ -type f -iname '*test*' -mtime -20 -exec ls -l {} \; -rw-r--r-- 1 mysql mysql 0 Dec 22 14:01 ./TEST -rw-r--r-- 1 mysql mysql 0 Dec 13 14:01 ./TEST_20161213
查找修改时间为过去第20天的文件
find ./ -type f -iname '*test*' -mtime 20 -exec ls -l {} \; -rw-r--r-- 1 mysql mysql 0 Dec 3 14:01 ./TEST_20161203 $ find ./ -type f -iname '*test*' -mtime +19 -mtime -21 -exec ls -l {} \; -rw-r--r-- 1 mysql mysql 0 Dec 3 14:01 ./TEST_20161203
查找指定修改时间段的文件
find ./ -type f -iname '*test*' -newermt '2016-12-04' ! -newermt '2016-12-23' -exec ls -l {} \; -rw-r--r-- 1 mysql mysql 0 Dec 22 14:01 ./TEST -rw-r--r-- 1 mysql mysql 0 Dec 13 14:01 ./TEST_20161213
1、4yl复制光标后的 4yh用后复制光标前的,l 和 h是用来指明方向,然后y、p进行复制粘贴操作
2、shift+v进入VISUAL LINE模式,或者ctrl+v进入VISUAL BLOCK模式进行hjkl选择操作,然后y、p进行复制粘贴操作
比如有这么个需求:
select F_command from bfb_db_finance . t_task where F_command like '%5025:%' and F_enabled = 1 limit 1 union all select F_command from bfb_db_finance . t_task where F_command like '%5026:%' and F_enabled = 1 order by F_task_id desc limit 1 ;
然后报错了:
ERROR 1054 (42S22): Unknown column 'F_task_id' in 'order clause'
解决方案:
select * from (select F_command from bfb_db_finance . t_task where F_command like '%5025:%' and F_command like '% 20161215 %' and F_enabled = 1 order by F_task_id desc limit 1 ) t5025 union all select * from (select F_command from bfb_db_finance . t_task where F_command like '%5026:%' and F_command like '% 20161215 %' and F_enabled = 1 order by F_task_id desc limit 1 ) t5026 union all select * from (select F_command from bfb_db_finance . t_task where F_command like '%5028:%' and F_command like '% 20161215 %' and F_enabled = 1 order by F_task_id desc limit 1 ) t5028 union all select * from (select F_command from bfb_db_finance . t_task where F_command like '%5027:%' and F_command like '% 20161215 %' and F_enabled = 1 order by F_task_id desc limit 1 ) t5027 union all select * from (select F_command from bfb_db_finance . t_task where F_command like '%5036:%' and F_command like '% 20161215 %' and F_enabled = 1 order by F_task_id desc limit 1 ) t5036;
这种问题一般mysql 5.x上出现。我用的mysql5.1
官方解释说:得知新版本mysql对空值插入有”bug”,要在安装mysql的时候去除默认勾选的enable strict SQL mode
那么如果我们安装好了mysql怎么办了,解决办法是更改mysql中的配置 my.ini
my.ini中查找sql-mode,
默认为sql-mode=”STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION”,
将其修改为sql-mode=”NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION”,重启mysql后即可
所以呢,为了避免小错误,程序一定要严谨,都规范一点,空值就写 null。
"=================" "加入文件头注释" "=================" autocmd BufNewFile *.js,*.php exec ":call SetComment()" "新建文件后,自动定位到文件末尾 autocmd BufNewFile * normal G func SetComment() if expand("%:e") == 'php' call setline(1,"") call append(line(".")+5, " * 创建日期:".strftime("%Y年%m月%d日 %H:%M:%S")) call append(line(".")+6, " ****************************************************************/") call append(line(".")+7, "") call append(line(".")+8, "") endfunc
t=('1' '2' '3' '4') #第一种 for v in ${t[@]};do echo $v done; #第二种 cnt=${#t[*]} for ((i=0;i<$cnt;i++));do echo ${t[$i]} done; #第三种 t='5 6 7 8' for v in $t;do echo $v done #数字段形式 for i in {1..10} do echo $i done for v in 1 2 3 4 5;do echo $v; done;
#!/bin/sh beg_date=`date -d "$1" +%s` end_date=`date -d "$2" +%s` if [[ -z $1 ]]||[[ -z $2 ]];then echo "Usage: $0 YYYY-MM-DD YYYY-MM-DD" exit 0; fi if [[ ${beg_date} > ${end_date} ]];then echo "The end_date < beg_date ;Please input the right date,example: $0 2014-01-01 2014-03-01" exit 0; fi for (( i=${beg_date};i<=${end_date};i=i+86400)) do d=`date -d "1970-1-1 UTC $i seconds" +%Y%m%d` echo $d done
我们打开Safari,菜单->偏好设置,或者【command】+ 逗号进入。
在此界面,打开高级选项卡,勾选最下面的“在菜单栏中显示“开发”菜单”
然后就ok了,两指双击页面(鼠标右键)就可以看到源代码选项了。