摘要: 剑指 Offer 03. 数组中重复的数字 难度简单485 找出数组中重复的数字。 在一个长度为 n 的数组 nums 里的所有数字都在 0~n-1 的范围内。数组中某些数字是重复的,但不知道有几个数字重复了,也不知道每个数字重复了几次。请找出数组中任意一个重复的数字。 示例 1: 输入: [2, 阅读全文
posted @ 2021-07-21 09:17 刘凯_tju 阅读(46) 评论(0) 推荐(0) 编辑
摘要: 1、常用命令 git checkout -b liukai origin/liukai 新建本地分支liukai与远端分支liukai关联 git checkout -b liukai 新建本地分支liukai 并切换到liukai git branch -d liukai 删除分支 -D强制删除( 阅读全文
posted @ 2021-07-20 08:41 刘凯_tju 阅读(105) 评论(0) 推荐(0) 编辑
摘要: 一、小括号( ) 1)作为局部变量作用符号 #!/bin/bash a=123 ( a=321; ) echo "$a" #a的值为123而不是321,因为括号将判断为局部变量 2)初始化数组 #!/bin/bash arr=(1 4 5 7 9 21) echo ${arr[3]} # get a 阅读全文
posted @ 2021-07-20 08:40 刘凯_tju 阅读(44) 评论(0) 推荐(0) 编辑
摘要: 1,# 注释字符(跟python注释字符#一样,可放开头,可放结尾) echo "The # here does not begin a comment." echo 'The # here does not begin a comment.' echo The \# here does not b 阅读全文
posted @ 2021-07-20 08:10 刘凯_tju 阅读(166) 评论(0) 推荐(0) 编辑
摘要: 1,定时任务一般放在 crontab-e 吊起的文件中 2,20,50 * * * * sh xx/yy.sh >xx/log/copy_test_data_log_$(date +\%Y\%m\%d_\%H\%M\%S) 2>&1 & 20,50 是每小时20分和50分各自执行一次 若20 是每小 阅读全文
posted @ 2021-07-13 20:20 刘凯_tju 阅读(172) 评论(0) 推荐(0) 编辑
摘要: 1,gg 返回文件开始2,G 文件末尾3,行号+G 转至行号处4,$ 光标移动到当前行的末尾5, 0 光标移动到当前行的开始6, /word 文档内搜索word n: 向后查找下一个。 N: 向前查找下一个。7,: set nu 设置行号8,dd 删除所在行,ndd删除往下n行 d1G 删除第一行到 阅读全文
posted @ 2021-07-13 20:19 刘凯_tju 阅读(22) 评论(0) 推荐(0) 编辑
摘要: 4, hadoop fs -ls XX | awk -F" " '{print $6"-"$7,$8}'|sort -k1 -r | awk -F" " '{print $2}'| head -n 1 第一步 -ls :显示出XX目录下所有目录以及其详细信息 drwxrwx--x+ - userna 阅读全文
posted @ 2021-07-13 20:12 刘凯_tju 阅读(81) 评论(0) 推荐(0) 编辑
摘要: 1,hadoop fs -cat /shining/temp.txt.gz | zcat | head -1hadoop fs -text /shining/temp.txt.gz | head -1 查看gz文件的第一行数据 参考资料:https://blog.csdn.net/java___bo 阅读全文
posted @ 2021-07-13 19:57 刘凯_tju 阅读(492) 评论(0) 推荐(0) 编辑
摘要: #!/bin/sh source ~/.bash_profile; source /etc/profile; start_date="20190622" end_date="20190625" while [ "$start_date" -le "$end_date" ]; do yestertod 阅读全文
posted @ 2021-07-13 19:46 刘凯_tju 阅读(192) 评论(0) 推荐(0) 编辑
摘要: #!/bin/bash source ~/.bash_profile; source /etc/profile; echo "start backup at $(date "+%Y-%m-%d %H:%M:%S")" crontab -l > crontab-backups #显示定时任务的内容 x 阅读全文
posted @ 2021-07-13 19:38 刘凯_tju 阅读(48) 评论(0) 推荐(0) 编辑