Iv. Linux/unix operation Command Accumulate "chmod, chown, tail"

Source: Internet
Author: User

under the use of Linux/unix, often use the text interface to set up the system or operating system, the author himself in the process of work is also constantly in touch with this command, so forThis special brewing, preparation, began the writing of this article. This paper mainly records some of their usual linux/unix under the operation of command, record and collation, one can deepen the printinglike, two can record to share. I hope you crossing, for inappropriate or ambiguous places, give the specified and explain, in order to learn and improve together.

"Reproduced use, please specify the source: http://blog.csdn.net/mahoking "

014Linux chmod Command

1 command format
chmod [options] [file]   format chmod [option] [file]
2 Command function
Userdel command set folder (file) read, write, execute permissions.
3 Common examples
Command description
syntax structure:

chmod abc file
where A, B, C represents a number that represents the permissions of the user, group, and other, respectively.
r=4,w=2,  x=1
to the RMX property 4+2 +1=7
to R-x property 4 +1=5;


Example 01
Command: chmod 777 TestFile.txt
Input: [[email protected] root]# chmod 777 TestFile.txt
Description
Change the Read and write execution permissions of TestFile.txt, all users of this machine can do all the work on this file.

015Linux chown Command

1 command format

chown [Options] [owner] format chown[option] [user]
2 command functions
Change the file owner and group by Chown. You can use the user name and user identification number settings when you change the owner or group of the file. Ordinary users cannot change their files to other owners. Its operation permissions are generally administrators.
3 Common examples


Example 01

Command: chown mail:mail testLog2014.log
Input: [[email protected] root]# chown mail:mail testLog2014.log
Description
Change the owner and group of the file. This example assigns the TestLog2014.log file to the mail user, the mail group. If the command is Chown:mail TestLog2014.log indicates that the TestLog2014.log file is assigned to the Mail group, the owner does not change.

Example 02
Command: chown–r–v root:mail TestDir

Input:
[Email protected] root]# chown–r–v root:mail TestDir
The owner of "Testdir/log2014.log" has changed to Root:mail
The owner of "Testdir/linklog.log" has changed to Root:mail
The owner of "Testdir/log2015.log" has changed to Root:mail
The owner of "Testdir/log2013.log" has changed to Root:mail
The owner of "Testdir/log2012.log" has been reserved for Root:mail
The owner of "Testdir/log2017.log" has changed to Root:mail
The owner of "Testdir/log2016.log" has changed to Root:mail
The owner of "TestDir" has changed to Root:mail
Description
Changes the owner and group of all files in the specified directory and its subdirectories.
-R processes all files under the specified directory and its subdirectories.
-V displays detailed processing information.

016Linux Tail Command

1 command format
tail [options] [Files] format tail [option] [file]
2 command functions
The tail command writes the file to standard output starting at the specified point. Using the-f option of the tail command makes it easy to see the log files that are being changed, TAIL-F filename will display the most up-to-date content on the screen, and constantly refresh to keep you updated on the contents of the file.
3 Common examples


Example 01

Command: tail–f FileName
Input: [[email protected] root]# tail–f fileName
Description
-F If the input file is a regular file or if the filename parameter specifies a FIFO (first in, out), then the tail command does not terminate after the last specified unit of the input file is copied, but continues to read and copy additional units from the input file (when those cells are available). If the file parameter is not specified and the standard input is a pipe, the-f flag is ignored. The tail-f command can be used to monitor the growth of files that another process is writing.


Iv. Linux/unix operation Command Accumulate "chmod, chown, tail"

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.