承离的觉前
CategoriesTagsAboutGitHub
地振高岗 一派溪山千古秀 门朝大海 三合河水万年流
  • 条件一出shell不服

    Wednesday, March 25, 2020

    if 最常用的条件 if [ 条件测试 ] then 做这个 fi fi意思是if语句结束。then是"那么"的意思。 “做这个"…

    LinuxShell

  • 变量在手shell不愁

    Tuesday, March 24, 2020

    指定脚本要使用的Shell 第一行 #!/bin/bash ,#!叫做She-bang。 Shell 脚本注释以 # 开头。 以调试模式运行 bash -x test.sh 会把脚本运行时的细节打印出来,在出现错…

    LinuxShell

  • 定时任务

    Friday, March 20, 2020

    at crontab 47 * * * * command 每个小时的 47 分都执行 command 命令,也就是 00 点 47 分, 01 点 47 分, 02 点 47 分等等 0 0 * * 1 command 每个礼拜一的凌晨都执行 command 命令 30 5 1-15 * * command 每个月…

    LinuxShell

  • 输入重定向和管道

    Wednesday, March 18, 2020

    <:从文件中读取。用于指定命令的输入。 cat 1.txt 和 cat < 1.txt 运行结果一样,原理不一样。 cat 1.txt :cat 命令接受的输入是 1.txt 这个文件名,要先打开1.tx…

    LinuxShell

  • 流和输出重定向

    Tuesday, March 17, 2020

    重定向到文件 > :重定向到新的文件。 cut -d , -f 1 notes.csv > 1.txt 若文件不存在,则新建一个文件,若文件存在,就会把源文件内容覆盖(清楚原有内容,再写入)。 既…

    LinuxShell

  • 数据处理天下无敌

    Thursday, March 12, 2020

    grep grep xx filename grep "ur sb" 2.txt grep [-cinvrABC] 'word' filename -c 行数 -i 不区分大小写 -n 显示行号 -v 取反 -r 遍历所有子目录 -A 后面跟数字,过滤出符合要求的行以及下面n行 -B 同上,过滤出符合要…

    LinuxShell

  • find文件无所遁形

    Wednesday, March 11, 2020

    用法:find 何处 何物 做什么 何处:指定在哪个目录中查找。此目录的所有子目录也会被查找,与 locate 命令的查找所有文件数据库的所有记录不同,find 命…

    LinuxShell

  • nohup后台启动

    Friday, October 19, 2018

    示例 nohup ./startserver.sh >output 2>&1 & nohup 是不挂断的运行命令. 语法:nohup Command [ Arg … ] [ & ] 描述:nohup 命令运行由 Command 参数和任何相关的 Arg 参数指定的命令,忽略所有挂…

    LinuxShell

  • Goaccess分析日志

    Friday, July 27, 2018

    首先是安装goaccess # yum -y install glib2 glib2-devel ncurses ncurses-devel GeoIP GeoIP-devel # wget http://tar.goaccess.io/goaccess-1.2.tar.gz # tar -xzvf goaccess-1.2.tar.gz # cd goaccess-1.2/ # ./configure --prefix=/usr/local/goaccess --enable-utf8 --enable-geoip` 或者 `./configure --enable-utf8 --enable-geoip=legacy # make && make install 然后是脚本 #!/bin/bash export LANG="en_US.UTF-8" yesterday=`date -d '-1 day' +%d/%b/%Y` cat /data/3.x/logs/006-nginx/access.log |grep $yesterday > /home/wwwlog/awstats/access.log cat /home/wwwlog/awstats/access.log |grep…

    LinuxShell

  • Lvm磁盘管理

    Saturday, July 14, 2018

    使用gdisk工具,如果没有,则yum -y install gdisk …

    LinuxShell

  • 1
  • 2
  • 3
  • 4
  • 5

承离的觉前

Powered by TinkleSpring & TinkleSpring ipv6 ready