zoukankan      html  css  js  c++  java
  • linux 学习笔记3

    ①find -name *.txt  //查看当前目录所有文件 .txt 结尾文件

    ②whereis  *.txt   //查看.txt结尾文件   但不显示 .txt

    打包:tar  -cf  a.tar  *.txt  //当前目录所有文件 .txt 打包

    解包:tar  -xf  a.tar

    压缩:zip  1.gz  *.txt  //当前目录所有文件 .txt 压缩

      打包压缩

      tar   -czf  a.tar.zip  *.txt

      解包压缩

      tar  -xzf  a.tar.zip

      打包并压缩

      tar  -cjf  1.tar.bz2  *.txt

      解压

      tar  -cjf  1.tar.bz2

      测试题、

      需求:  组    用户    目录    文件

           A     a     AA    A.txt

           B     b     BB    B.txt

           D     d

      把A,B组和用户改为D,d

      1.创建三个用户

        useradd  a  useradd  b  useradd  c

      2.查看用户  cat  /etc/passwd

            详细:用户id  组id

            eg:id  用户名

      3.显示组: cat /etc/group  

      4.修改组名  groupmod  -g  501(组id)  -n  新组名  旧组名

      5.mkdir  AA   cd AA  touch  a.txt

        chown  -R  a.A  AA

        groupdel  组名  删除组

      cd  /etc/rc.d /init.d   服务

      http -k   restart    //重启

            start  //启动

            stop  //停止

      runlevel  查看运行级别

      ps  查看进程

      ps  -aux  查看所有进程

      init 0 关机

      init  6 重启(reboot)

      grep 搜索

      ps  -aux  |  grep  apache

      ps  -ef   |  grep  apache

      ① chkconfig  --list

      ②chkconfig  --level  5  httpd  on  //启用进程

      ③chkconfig  --list  |  grep  httpd

      ④chkconfig  --del  5  httpd  on

      

  • 相关阅读:
    Populating Next Right Pointers in Each Node II
    Populating Next Right Pointers in Each Node
    Construct Binary Tree from Preorder and Inorder Traversal
    Construct Binary Tree from Inorder and Postorder Traversal
    Path Sum
    Symmetric Tree
    Solve Tree Problems Recursively
    632. Smallest Range(priority_queue)
    609. Find Duplicate File in System
    poj3159最短路spfa+邻接表
  • 原文地址:https://www.cnblogs.com/dusong0717/p/3590086.html
Copyright © 2011-2022 走看看