zoukankan      html  css  js  c++  java
  • 前端同学 linux常用指令汇总

    删除文件

    rm -rf file11
    -r:递归的删除目录下面文件以及子目录下文件。
    -f:强制删除,忽略不存在的文件,从不给出提示
    

    查看文件内容

    cat file1
    more file1
    less file1
    

    liunx 服务器上面查找文件

    find / -name httpd.conf
    find 目录 -name 文件名
    

    查找文件里面内容

    cat httpd.conf | grep listen
    cat httpd.conf | grep -ignore listen / cat httpd.conf | grep -i listen 忽略大小写
    

    递归创建目录

    mkdir -p a/b/c/d/e/f/g
    

    zip 压缩包

    zip -r public.zip public
    -r 递归 表示将指定的目录下的所有子目录以及文件一起处理
    

    zip解压

    unzip public.zip
    unzip public.zip -d dir
    

    gz 压缩包

    tar czvf public.tar.gz public
    

    解压 gz

    tar xzvf public.tar.gz
    

    tar 包

    tar cvf wwwroot.tar wwwroot 仅打包,不压缩!
    

    解压 tar 包

    tar xvf wwwroot.tar
    

    xz 压缩包

    tar cvf xxx.tar xxx // 这样创建 xxx.tar 文件
    xz xxx.tar //将 xxx.tar 压缩成为 xxx.tar.xz 删除原来的 tar 包
    xz -k xxx.tar //将 xxx.tar 压缩成为 xxx.tar.xz 保留原来的 tar 包
    

    解压xz 压缩包

    xz -d ***.tar.xz //先解压 xz 删除原来的 xz 包
    xz -dk ***.tar.xz //先解压 xz 保留原来的 xz 包
    tar -xvf ***.tar //再解压 tar
    

    yum 安装 npm 包

    yum install -y net-tools 包括 netstat ifconfig 等命令
    

    yum 搜索 npm

    yum search 名称
    

    启动服务

    systemctl start httpd
    

    关闭服务

    systemctl stop httpd
    

    重启服务

    systemctl restart httpd
    

    设置开机自启动

    systemctl enable httpd
    

    使指定服务从新加载配置

    systemctl reload httpd
    

    目录

    cd ~  //回到家目录,root用户回到root目录,其他用户回到/home/其他用户
    

    ls

    ls -lh //显示文件大小
    
  • 相关阅读:
    hdu 4685(强连通分量+二分图的完美匹配)
    图的连通性问题
    poj 1904(强连通分量+完美匹配)
    poj 2186 "Popular Cows"(强连通分量入门题)
    poj 1236(强连通分量分解模板题)
    EOJ2018.10 月赛
    21.Merge Two Sorted Lists
    20.Valid Parentheses
    19.Remove Nth Node From End of List
    18.4Sum
  • 原文地址:https://www.cnblogs.com/mengfangui/p/12247367.html
Copyright © 2011-2022 走看看