zoukankan      html  css  js  c++  java
  • Linux命令第二篇

    作业二:

    1)   在用户的主目录下创建目录test,进入test创建空文件file1

    # ls /home/test

    file

    2)   以长格式形式显示文件信息,注意文件的权限和所属用户和组

    # ls -l

    总用量 0

    -r--r-xr-x. 1 root root 0 3月  15 15:06 file

    3)   为文件file1设置权限,使其他用户可以对此文件进行写操作

    # chmod o=w file

    4)   查看设置结果,

    # ll

    总用量 0

    -r--r-x-w-. 1 root root 0 3月  15 15:06 file

    5)   取消同组用户对文件file1的读取权限,并查看设置结果。

    chmod g-r file

    # ll

    总用量 0

    -r----x-w-. 1 root root 0 3月  15 15:06 file

    6)   用数字表示法为文件file设置权限,所有者可读、可写、可执行,所属组用户和其他用户只具有读和执行的权限。设置完成后查看设置结果。

    # chmod 755 file

    [root@localhost test]# ll

    总用量 0

    -rwxr-xr-x. 1 root root 0 3月  15 15:06 file

    7)   用数字形式更改文件file1的权限,使所有者只能读取此文件。其他任何用户都没有权限。查看设置结果。

    # chmod 400 file

    [root@localhost test]# ll

    总用量 0

    -r--------. 1 root root 0 3月  15 15:06 file

    8)   回到上层目录,查看test的权限

    # ll

    drwxr-xrwx.  2 root   root       17 3月  15 15:06 test

    9)  为其他用户添加对此目录的写权限

    ]# chmod o=w test

    [root@localhost home]# ll

    drwxr-x-w-.  2 root   root       17 3月  15 15:06 test

  • 相关阅读:
    数据量过大时数据库操作的处理
    VC中回调函数的用法
    基于BindingSource的WinForm开发
    VC获取各类指针
    GetSystemMetrics()函数的用法
    samba建立个人专享网盘
    Windows 7下用Windows照片查看器打开图片速度变慢的解决方案
    这是一个模板
    QT中编译和使用OPENCV
    MFC日志(2011.4.9)
  • 原文地址:https://www.cnblogs.com/asaka/p/6557707.html
Copyright © 2011-2022 走看看