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

      

  • 相关阅读:
    int **指针问题
    用 _tcscmp 替代 strcmp 或 wcscmp
    C++经典面试算法题
    目标世界上最小的Linux系统—ttylinux体验
    im-switch -s ibus错误:Error: no configuration file "ibus" exists.
    Ruby环境搭建
    emulator: ERROR: x86 emulation currently requires hardware acceleration!Please ensure Intel HAXM is properly installed and usable.CPU acceleration status: HAX kernel module is not installed!
    POJ 1007 DNA Sorting
    POJ 1002 487-3279
    Ubuntu Android adb调试无法识别设备 -- List of devices attached ???????????? no permissions
  • 原文地址:https://www.cnblogs.com/dusong0717/p/3590086.html
Copyright © 2011-2022 走看看