zoukankan      html  css  js  c++  java
  • Linux常用命令

    • 查看端口占用
    netstat -apn
    • mysql查看所有列名及其类型
    show columns from partner;
    • 常用系统变量

    系统变量只能引用不能修改

    $0           当前shell程序的名字
    $1 ~ $9      命令行上的第一到第九个参数
    $#           命令行上的参数个数
    $*           命令行上的所有参数
    $@           分别用双引号引用命令行上的所有参数
    $$           当前进程的进程标识号(PID)
    $?           上一条命令的退出状态
    $!           最后一个后台进程的进程标识号
    • 判断上一条命令是否执行成功
    if [ $? -eq 0 ]
    then
    ''''
    fi
    • 添加用户
    useradd test
    • 修改用户密码
    sudo passwd root
    • 整个文件大小写转换
    tr a-z A-Z < **.txt
    
    tr A-Z a-z < **.txt
    • 确保抓包完整性
    1. 关闭网卡的包聚合
    ethtool -K em1 lro off
    ethtool -K em1 gro off
    ethtool -K em1 tso off
    ethtool -K em1 gso off
    ethtool -K em1 sg off
    
    2. 设置网卡为混杂模式
    ip link set enp6s0f1 promisc on
    
    3. 抓包
    tcpdump -i em1 -nn -n -s 0 -B 5120 -w test_pop3.pcap
    • 压缩和解压
    tar zcvf kernel.tgz linux-2.6.9
    tar xzvf kernel.tgz
    
    其他格式的解压
    *.tartar –xvf 解压
    *.gz 用 gzip -d或者gunzip 解压
    *.tar.gz和*.tgz 用 tar –xzf 解压
    *.bz2 用 bzip2 -d或者用bunzip2 解压
    *.tar.bz2用tar –xjf 解压
    *.Z 用 uncompress 解压
    *.tar.Z 用tar –xZf 解压
    *.rar 用 unrare解压
    *.zipunzip 解压
    • 首尾加入字符
    :%s/^/ :%s/$/
    • 修改根目录为可读写权限
    mount -o remount, rw /
    • 修改用户目录
    usermod -m -d /home/admin -u 508 admin
    • scp认证错误
    ssh-keygen -R 192.168.18.165
    • 设置http服务器为点击下载而不是直接打开
    DefaultType application/octet-stream
    • centos7修改mtu
    ip link set em2 mtu 9000
    • 发送html邮件
    cat 2 | mail -s "$(echo -e "test
    Content-Type: text/html;charset=utf-8")" yangdongyin@antiy.cn
  • 相关阅读:
    SimpleDateFormat解析的时区问题
    linux之cp/scp命令+scp命令详解
    java.net.SocketException: java.security.NoSuchAlgorithmException
    Gradle使用手册(一):为什么要用Gradle?
    js_实用
    exp.validate.js
    MySQL实用技巧
    MongoDB 用户配置
    js 图片处理 Jcrop.js API
    MySQL连接池
  • 原文地址:https://www.cnblogs.com/yangddongyin/p/7651247.html
Copyright © 2011-2022 走看看