• 01开班第一节


    Web课程Linux命令统计

    这里统计的Linux命令不要求全部掌握,但是对于基础、进阶和并发班部分的命令要能熟练使用。

    1.分类统计

    分类命令总数
    1.基本必知 cd, ls, mkdir, rmdir, cp, mv, cat, touch, rm, help, man 11
    2.网络 wget, telnet, ping, netstat, ifconfig, route, ip, curl, ssh, iptables 10
    3.系统管理 sudo, ps, crontab, halt, umount, passwd, reboot, su, shutdown, poweroff, useradd,usermod, userdel, groupadd, groupdel, groupmod 16
    4.软件、打印、开发和工具 xargs, awk, date, clear, whoami, sleep, who 7
    5.文件和目录管理 iconv, grep, tree, zip, unzip, tar, gzip, scp, wc, sort, cut, which, sed, find, chmod, tail, whereis, chown, pwd, vim, ln 21
    6.硬件、内核、shell和监测 sh, bash, du, lsof, time, free, top, bg, jobs, history, uname, kill, alias, unalias, fg, echo, df, ulimit 18

    这里总共83个命令,至于一些常在shell脚本中使用的命令没有添加到其中。

     

     

     

    2.分阶段统计

    阶段命令总数
    基础 cd, ls, mkdir, rmdir, cp, mv, cat, touch, rm, help, man, wget, ping, ifconfig, ip, sudo, halt, reboot, shutdown, poweroff, umount, passwd, su, useradd, usermod, userdel, groupadd, groupdel, groupmod, xargs,date, clear, whoami, who, grep, zip, unzip, tar, gzip, which, find, chmod, whereis, chown,pwd, vim, ln, du, free, history, uname, alias, unalias, df, sh, bash 56
    进阶 telnet, netstat, wc, time 4
    框架和项目 route, curl, crontab, awk, sleep, iconv, tree, scp, sort, cut, sed, tail, lsof, echo, ulimit, ssh, iptables 17
    并发班 ps, top, kill, bg, jobs, fg 6

     

    3.命令基本介绍

    1.基本必知作用示例
    cd 切换工作目录 cd ~
    ls 显示文件列表 ls
    mkdir 创建文件夹 mkdir test
    rmdir 删除文件夹 rmdir test
    cp 复制 cp a.txt b.txt
    mv 移动和重命名 mv b.txt bbb.txt
    cat 查看文件内容 cat a.txt
    touch 创建文件 touch c.txt
    rm 删除文件 rm c.txt
    help 帮助 help cd
    man 帮助 man cd
    2.网络 作用 示例
    wget 从URL下载文件 wget https://bootstrap.pypa.io/get-pip.py
    telnet 登录远程主机 telnet 127.0.0.1 1234
    ping 测试网络连通性 ping 8.8.8.8
    netstat 网络系统的状态 netstat -at
    ifconfig 配置和显示网络参数 ifconfig
    route 显示并配置路由表 route -n
    ip 网络配置工具 ip addr
    curl 下载工具 curl https://www.shiguangkey.com/
    ssh ssh客户端连接工具 ssh pyvip@127.0.0.1 -p 22
    iptables 防火墙配置 service iptables stop
    3.系统管理 作用 示例
    sudo 默认以root权限执行命令 sudo apt-get update
    ps 查看进程状态 ps -ef
    crontab 定时任务 crontab -l
    halt 关机 halt
    umount 卸载已经挂载的文件 umount /dev/sda
    passwd 修改密码 passwd pyvip
    reboot 重启 reboot
    su 切换用户 su root
    shutdown 关机命令 shutdown -h
    poweroff 关机并断电 poweroff
    useradd 添加用户 useradd pyvip
    usermod 修改用户 usermod pyvip pyvip2
    userdel 删除用户 userdel pyvip
    groupadd 添加用户组 groupadd pyvip
    groupdel 删除用户组 groupdel pyvip
    groupmod 修改用户组 groupmod pyvip
    4.软件、打印、开发和工具 作用 示例
    xargs 将输入数据装换成命令行参数,一般是组合使用 find ./ * |xargs grep 'soft'
    awk 处理文本和数据的利器,Linux命令三剑客之一 cat install.sh |awk '{print $1}'
    date 显示或设置系统时间与日期 date
    clear 清屏 clear
    whoami 当前用户名 whoami
    sleep 暂停指定时间 slepp 1
    who 当前用户信息 who
    5.文件和目录管理 作用 示例
    iconv 转换文件编码 iconv install.sh -f UTF-8 -t GBK -o install.sh.bak
    grep 文本搜索,Linux命令三剑客之一 grep "then" *.sh
    tree 树状图列出目录的内容 tree
    zip 解压缩文件 zip -q -r config.zip config
    unzip 解压zip文件 unzip config.zip
    tar 打包 tar cvf config.tar config
    gzip 解压缩文件,后缀为.gz gzip install.sh
    scp 远程拷贝文件 scp pyvip@127.0.0.1:/home/pyvip/install.sh /tmp
    wc 显示字数,列数和Bytes数 wc install.sh
    sort 将文件内容排序 sort install.sh
    cut 显示文件指定的部分 cut -c1-4 install.sh
    which 查找命令的绝对路径 which ls
    sed 流编辑器,Linux命令三剑客之一 sed -i 's/#/##/g' install.sh
    find 查找指定目录下的文件 find ./ -name "*.py"
    chmod 更改文件或目录的权限 chmod 664 install.sh
    tail 查看文档结尾,一般默认10行 tail -f install.sh
    whereis 定为命令的二进制程序,源代码和man手册等绝对路径 whereis ls
    chown 改变文件或目录的属组 chown -R pyvip:pyvip install.sh
    pwd 显示当前的绝对路径 pwd
    vim 编辑器 vim install.sh
    ln 创建链接 ln -s install.sh install
    6.硬件、内核、shell和监测 作用 示例
    sh shell命令语言解释器 sh install.sh
    bash 大多数Linux默认shell bash install.sh
    du 查看使用空间 du -d 1 -h
    lsof 查看打开的文件的情况 lsof -i:22
    time 统计命令所花费的时间 time ls
    free 显示内存使用情况 free
    top 动态查看系统运行情况 top
    bg 将作业放到后台 bg(执行top,然后按CTRL+Z,就可以使用bg,jobs,fg查看现象)
    jobs 显示任务列表和任务状态 jobs
    history 显示历史命令 history
    uname 打印系统相关信息 uname -a
    kill 删除执行中的程序或工作 kill -9 12343
    alias 设置指令的别名 alias cd=‘rm -rf’
    unalias 取消设置的别名 unalias cd
    fg 将后台作业放到终端 fg
    echo 输出 echo hello
    df 显示磁盘分区使用情况 df -h
    ulimit 限制用户对资源的访问 ulimit -a
  • 相关阅读:
    HDU 4005 The war
    #undef
    [转载] #define new DEBUG_NEW
    [转载]常用正则表达式
    [百科]
    [转载]
    [转载]
    [转载]
    [百科]
    [转载]VC6中的文件后缀
  • 原文地址:https://www.cnblogs.com/zcmq/p/8627784.html
Copyright © 2020-2023  润新知