zoukankan      html  css  js  c++  java
  • linux command

    1.新建用户

    [root@localhost linux]# adduser liangh
    [root@localhost linux]# passwd liangh
    Changing password for user liangh.
    New password: 
    BAD PASSWORD: it is based on a dictionary word
    Retype new password: 
    passwd: all authentication tokens updated successfully.

    2.切换用户

    [root@localhost linux]# su - liangh

    3。查看用户信息

    [liangh@localhost ~]$ cat /etc/passwd
    root:x:0:0:root:/root:/bin/bash
    bin:x:1:1:bin:/bin:/sbin/nologin
    daemon:x:2:2:daemon:/sbin:/sbin/nologin
    adm:x:3:4:adm:/var/adm:/sbin/nologin
    lp:x:4:7:lp:/var/spool/lpd:/sbin/nologin
    sync:x:5:0:sync:/sbin:/bin/sync
    shutdown:x:6:0:shutdown:/sbin:/sbin/shutdown
    halt:x:7:0:halt:/sbin:/sbin/halt
    mail:x:8:12:mail:/var/spool/mail:/sbin/nologin
    uucp:x:10:14:uucp:/var/spool/uucp:/sbin/nologin
    operator:x:11:0:operator:/root:/sbin/nologin
    games:x:12:100:games:/usr/games:/sbin/nologin
    gopher:x:13:30:gopher:/var/gopher:/sbin/nologin
    ftp:x:14:50:FTP User:/var/ftp:/sbin/nologin
    nobody:x:99:99:Nobody:/:/sbin/nologin
    dbus:x:81:81:System message bus:/:/sbin/nologin
    root:x:0:0:root:/root:/bin/bash
    root 用户名,唯一
    x 加密口令,为x表示加密口令保存在/etc/shadow文件中
    0 用户ID,root为0
    0 组ID
    root 注释,可以是任何东西,但通常是用户到名字
    /root 主目录,用户登录后到当前目录
    /bin/bash 默认shell
    4.查看文件详细信息
    [liangh@localhost ~]$ ls -l a.txt
    -rw-rw-r--. 1 liangh liangh 0 Nov 26 22:05 a.txt
    -rw-rw-r-- 许可
    1 连接数
    liangh 用户
    liangh 组
    0 字节数
    Nov 26 22:05 最后修改时间
    a.txt 名字
    5.更改文件许可
    [liangh@localhost ~]$ chmod 777 a.txt
    [liangh@localhost ~]$ ls -l a.txt
    -rwxrwxrwx. 1 liangh liangh 0 Nov 26 22:05 a.txt

    5.设置文件粘连位(不能删除他人到文件)

    [liangh@localhost ~]$ chmod +t a.txt

    6.解压文件

    tar -xzvf xxx.tar.gz

    x  要执行到是解压动作

    z  将要解压到包压缩格式为gzip格式

    v  显示解压过程中到信息

    f 代表file,必须

    7.复制文件

    cp  /../s.txt   /.../d.txt
    /../s.txt 要复制的文件路径

    /.../d.txt 目标路径
    8.移动文件
    mv  /../a.txt    /.../a.txt
  • 相关阅读:
    Python基础23_os,sys,序列化,pickle,json
    Python基础22_模块,collections,time,random,functools
    Python基础21_类与类型, MRO, C3算法, super()
    Python基础20_类的约束,异常处理,MD5加密,日志
    python反射机制
    python 依赖关系 与关联关系
    python 类的常见的特殊成员
    类的成员(*变量与*方法)
    初识面向对象
    简说匿名函数与递归
  • 原文地址:https://www.cnblogs.com/LH2014/p/4126302.html
Copyright © 2011-2022 走看看