File Operation commands, operation commands

Source: Internet
Author: User

File Operation commands, operation commands

I used to Google the corresponding commands when I used them all the time. I felt that this was not systematic and I didn't have any connection with the things in the environment programming. So I decided to have time to sort out my ideas. 1. ls:
File Type:D directory l link s socket file (socket) block B device file c character device file (character) p named pipeline file (named pipe, FIFO)-common file
Create FILE command: Touch filenameChange File Permissions: Definition of chmod [who] perator [permission] filename who: u file owner, g group users, o other users, all users of a operator: +-= Add/cancel/set permission: rwx read/write execution, s (will be discussed later), l lock the file Use Case: chmod a + x myfileChange file permissions (set absolute values): Chmod [mode] file mode: converts the corresponding bits into an octal format. Use Case: chmod 740 myfile
2.Directory permission bit:Directory reading means you can open the directory (execute the open operation). The execution bit means you can search for and access the directory, and the write command controls whether you can create files in the directory. The test is as follows:
3. sUid comprehension:If a user sets the suid permission for an executable file of his/her own, other users also have the corresponding permissions of his/her owner when executing the file, after execution, you can restore your identity and have a similar understanding of guid. In Linux programming, you may also encounter such a situation where you have the root permission for a code segment. Note: When setting suid and guid, the corresponding execution permission limit must be set. Use Case: chmod 4741 myfile to see which commands are available in the/bin directory:
4. Change the owner and group of the file: chown, chgrp 5.Umask understanding (important): When a user logs on to a system, umask determines the default permission value for the file to be created to ensure file security. As the name suggests, the corresponding user does not have the corresponding permissions. The default umask value is defined in the/etc/login. def file, which can be customized by the system administrator.












Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

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.