Linux basic commands-ls

Source: Internet
Author: User

Ls Running Mechanism

Command for viewing environment variables:EnvOrEcho $ path

The which LS command is used to find the location of all the LS commands in the environment variables. It is returned not only when one is found, but also how many ls commands are found.

DOS first checks the current directory and then the environment variables. Linux does not check the current directory.

File comparison command:CMP/Bin/DIR/bin/ls this command compares two executable files: Dir and LS.

Command for copying files:CP/Bin/ls/bin/LLSs this command copies the LS file. The new file is named LLSs.

Command for permission escalation: Sudo CP/bin/ls/bin/LLSs this command copies the file as administrator.

User, group, file, and folder attributes

Different users belong to different groups.

-RW-r --

Drwxr-r-XR-x

The first letter at the beginning. If it is-it indicates a file and D indicates a folder.

R indicates read, W indicates write, and X indicates execution. For files, X indicates executable. For directories, X indicates that the directory can be accessed.

The first, second, and fifth letters indicate the permissions of the master, the middle three represent the permissions of the user group, and the last three represent the permissions of other users.

Command for modifying File Access Permissions:ChmodChange Mode: Modify the access permission of the test file. After execution, other user groups do not have the read permission for the test file.

After the chmod g-r test command is executed, the group user has no permission to read the test file.

After the chmod g + R test command is executed, the group user restores the read permission on the test file.

Lsattr lists the advanced attributes of files and folders.

Lsusb: check which USB devices are in the system. lsusb-V lists detailed properties. idvendor and idproduct are important. when Linux installs a driver for a USB device, it depends on these two attributes to choose which driver to install.

Lspci lists the properties of all PCI interface devices, and the-V Switch can also list detailed properties. The-VV switch includes more detailed information.

 

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.