Linux file permission- partial

來源:互聯網
上載者:User

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"

 

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.