Linux Basic Command ①

Source: Internet
Author: User
Tags chmod file type file file permissions

1. Basic commands

LS View this directory

ll view this directory and display detailed information equal to Ls-l

Ls-r dirname recursively displays all contents of a directory

PWD View the text of the current file, which is the current path

Cd. . Go to previous folder

CD/go to the root directory

CD Directory name Enter directory

CD ~ Go to home directory

2. Users

User Name list currently online

Groups View the name of the user group for the current user

Su switches to the root user

WhoAmI View the name of the current user

ID View the current user's ID, Group ID, additional group ID

ID User name view the ID of the specified user

Who-q View the user name of the online user, number of users

3. File permissions

Stat filename View File details Access time, modification time, change time

chmod 755 filename The permission to modify the file is 755

(A brief introduction to the meaning of 777, READ4 write 2 execution 1, the first one for the owner, the second for the user group, and the third for the group outside)

Chmod-r 755 dirname permission to modify a directory recursively

Chown-r user:user php recursively modifies PHP directory owners and user groups to user

Chgrp-r Nick Demo recursively changes the user group to which the directory belongs

Chattr +i index.php settings file is not allowed to modify, delete, move, copy, root user also takes effect

Chattr-i index.php Canceling file property settings

4. Find

Find-iname index.php Find index.php file in this directory, ignoring case

Find it! -name "*.php" in this directory to find files that are not. PHP End

< Span class= "Hljs-keyword" >find. -type f              Find file Type file

< Span class= "Hljs-keyword" >find.- Type d            Find file type is directory

< Span class= "Hljs-keyword" >
Find-maxdepth 1-type F # Find file type is file, down maximum depth limit is 1

< Span class= "Hljs-keyword" >find.- Type D #查找文件类型为目录

< Span class= "Hljs-keyword" >find. -type f-atime-7          Find files accessed within 7 days

< Span class= "Hljs-keyword" >find.- Type F-atime +7        find access files for more than 7 days

< Span class= "Hljs-keyword" >find. -type f-atime 7          find access files 7 days ago

find. -type f-amin-10        find access files within 10 minutes

find. -type f-amin 10         Find more than 10 minutes of access files

find. -type f-amin +10       Find more than 10 minutes of access to files

 

which php    Find the folder where the PHP command resides     may also look like there is no this command

whereis php      find Location of the PHP command

< Span class= "hljs-built_in" >< Span class= "hljs-built_in" >< Span class= "hljs-built_in" >< Span class= "hljs-built_in" >< Span class= "hljs-built_in" > locate/etc/*.conf       Find all the. conf suffix files under the/etc command, this command is faster than find

Linux Basic Command ①

Related Article

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.