zoukankan      html  css  js  c++  java
  • Linux file permission partial

    Most versions of Linux have two types of user accounts: standard and root.

    The root user can access and /or delete whatever files it wants. 

    It can configure hardware,change settings, and so on.

    Ububntu is different in that it doesn't allow login as the root user. Instead, it allows certain users, 

    including the one created during installation, to adopt temporarily root-like powers. 
    This way of working is referred to as sudo, which is short for superuser do.

    The file permissions part of a file listing can be broken down into four separate parts.

    Type of file:  A standard data file is indicated with a dash(-). Most files on your system fall

    into this category. 

    A d shows that the entry is not a file but a directory.

    User permissions: Read(r),Write(w),Execute(x)

    Group permissions:

    Everyone else's permissions: other users in other groups.

    File Type Codes

    Code File type

    -  Standard file

    d  Standard directory

    l   Symbolic link(a shortcut to another file)

    p    Named pipe(a file that act as a conduit for data between two programs)

    s  Socket

    c  Character device( a hardware device driver, usually found in /dev)

    b  Block Device (a hardware device driver, usually found in /dev)

    Change the permissions:

    chmod a+rw filename   : (chmod +rw filename do the same thing, a is for all the user.)

    chmod u+rw    Change permissions just for the owner( u is for user, which is the same as owner).

    chmod u+x myprogram

    Numeric file permissions

    r for reader,w for write, x for execute. This is know as symbolic notation, and its goal is to make file permissions intuitive and easy for the user to understand. However, Unix and Linux file permissions are traditionally expressed as octal notation. 

    r (Reader):4 , w(Write):2, x(Execute):1 .

    so (rwx) has a value 7(4+2+1)

    chmod 644 myfile.txt  means -rw-r--r-- for myfile.txt

    -----------------------------------------------------------------------

    With this information in hand, you’re now ready to mount the disk. For a FAT32disk (that is, one from an older Windows installation, such as 95, 98, Me, or olderWindows XP setups), type the following:
    sudo mount -t vfat -o umask=000 /dev/sdb1 /media/newdisk
    . For an NTFS disk, type the following:
    sudo mount -t ntfs-3g /dev/sdb1 /media/newdisk

    Removing a Mounted Systemsudo umount /media/newdisk
    File Searches

    find /home/keir -name "myfile"

  • 相关阅读:
    ASP.NET Core 3.0 迁移避坑指南
    Go初学乍练
    IdentityServer4 常见问题
    ASP.NET Core 奇淫技巧之动态WebApi
    Visual Studio 2019 16.1 使用 .NET Core 3.0
    【Java】maven多项目资源共享
    【Web】Web开发中的异常处理方案
    【UML】Java代码与UML模型相互转换方法
    【Spark】为什么没有任务调度到新增的Worker之上???
    【网络】高性能网络编程--下一个10年,是时候考虑C10M并发问题了
  • 原文地址:https://www.cnblogs.com/wucg/p/1853095.html
Copyright © 2011-2022 走看看