![](https://img-blog.csdnimg.cn/20201014180756930.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
Linux
ThisIsNobody
这个作者很懒,什么都没留下…
展开
-
Linux 时间日期指令
date 显示当前日期datedate +%Ydate +%mdate +%ddate "+%Y-%m-%d %H:%M:%S"date -s 设置日期date -s 字符串时间date -s "2018-11-11 11:11:11" #设置当前日期cal 显示日历cal [option]cal #显示当前月的日历cal 2020 显示年份的日历...原创 2018-06-23 22:11:45 · 496 阅读 · 0 评论 -
Linux 压缩和解压缩指令
gzip/gunzip 压缩/解压缩gzip a.txt 压缩a.txt为a.txt.gz,不保留a.txtgunzip a.txt.gz 解压缩a.txt.gz为a.txtzip/unzip 常用于项目打包zip [option] *.zip [path/file]unzip [option] *.zipzip -r hello.zip /usr/local/hello 将he...原创 2018-06-25 08:46:29 · 214 阅读 · 0 评论 -
Linux find/locate/grep指令
find 从搜索目录递归遍历,查找符合条件的文件或目录find [搜索目录] [选项]-name 文件名查找-user 文件所属查找-size 文件大小查找 +大于 -小于find /usr -name a.txt 在目录/usr下查找名字叫a.txt的文件find /usr -user root 查找目录下文件所属为root的目录和文件find /usr -siz...原创 2018-06-25 08:46:26 · 260 阅读 · 0 评论 -
Linux ln/history指令
ln 软链接 类似于快捷方式 可以为文件或者目录创建软链接ln -s [src] [dst]ln -s linktolocal /usr/local 为目录/usr/local创建软链接linktolocal删除软链接时不要带/,rm -rf linktolocalhistory 查看历史指令history 显示所有指令history 10 显示最近10条指令!1000 执行编号为1000的...原创 2018-06-25 08:46:23 · 165 阅读 · 0 评论 -
Linux echo/head/tail
echo 输出内容至控制台echo [选项] [内容]echo $PATHhead 默认查看文件前10行head a.txt 显示前10行head -n 5 a.txt -n 5 显示前5行,-n选项自定义行数tail 默认显示文件后10行tail a.txt 显示后10行tail -n 5 a.txt 显示后5行tail -f a.txt 用于实时监控文件变化,重要...原创 2018-06-25 08:45:58 · 117 阅读 · 0 评论 -
Linux cat/more/less
cat 浏览文件cat -n a.txt | more cat 指令打开a.txt,-n选项分页,并使用more指令分页| 竖线表示管道命令more 基于vi编辑器的文本过滤器,全屏幕分页显示文件内容快捷键Ctrl+B 上一页Ctrl+F 下一页,也可以使用空格键= 档期那行号:f 文件名+当前行号Enter 下一行less分屏查看,比more好,因为不...原创 2018-06-24 19:16:25 · 139 阅读 · 0 评论 -
Linux touch/cp/rm/mv指令
touch 创建文件touch a.txtcp 复制cp a.txt .. 将a.txt拷贝到上一层目录cp -r dir1 dir2 将目录dir1的所有内容拷贝到dir2下,形成dir2/dir1,-r实现递归拷贝,即目录下所有内容拷贝cp -r dir1 dir2 如果dir2下已有dir1,现在再次拷贝,会提示是否需要覆盖相同文件\cp -r dir1 dir2 使...原创 2018-06-24 18:43:18 · 152 阅读 · 0 评论 -
Linux mkdir/rmdir指令
mkdirmkdir -p /usr/local/hello/kitty如果只有/usr/local目录,-p选项可以为kitty创建parents目录hellormdir只能删除空目录,目录有内容则无法删除删除非空目录使用rm -rf...原创 2018-06-24 18:07:27 · 180 阅读 · 0 评论 -
Linux 路径和目录指令
1) pwd 当前目录的绝对路径2) cd cd .. 上一级目录 cd . 当前目录 cd ~ 用户目录,如果时root用户,则到/root cd / 根目录 cd - 上一次工作目录 当前目录为/usr/local/hello,如果需要进入到/usr/net/kitty目录下,可以使用 (1) 绝对路径 cd /us...原创 2018-06-24 17:46:38 · 198 阅读 · 0 评论 -
Linux ">"和">>"指令
将命令行的输出写入文件,> 输出重定向,覆盖文件内容,>> 追加内容,不覆盖文件内容1) ls -l > a.txt ls -l >> a.txt2) cat a.txt > b.txt cat a.txt > b.txt3) echo "hello" > a.txt echo "hello" >>原创 2018-06-24 15:27:48 · 308 阅读 · 0 评论 -
Linux 帮助指令
以ls命令为例1) man ls2) ls --help3) info ls原创 2018-06-24 02:13:36 · 147 阅读 · 0 评论 -
Linux crontab定期执行程序
查看定期服务状态 service crond status系统任务:编辑/etc/crontab用户任务:crontab -e,写入命令crontab -l 列出定时任务* * * * * /usr/local/hello.sh 分钟 消失 日 月 星期Reference: http://www.runoob.com/linux/linux-comm-crontab.html...原创 2018-07-02 00:48:34 · 259 阅读 · 0 评论