Linux command System (i)

Source: Internet
Author: User
Tags set time time and date touch command

One: commands for displaying directories and systems

The 1:is command is used to display information about the specified directory and file

Permissions: All Users

-A lists all files under the directory

-B The characters that are not output in the file are numbered with backslashes and characters

-C Output File I-node modification time, and sorted by this

-D Displays the directory like a file without displaying the following folder

-l list File details

-P or-F appends a character to each file to indicate the file type and cannot be shared with the L parameter

-r Display fixed directory and sub-directory content

file type: the

-Denotes normal file

D indicates directory

L represents a symbolic link file

P indicates pipeline file

file Permissions

R Read-only

W Writable

X executable

T-paste

2:dir command: Used to display relevant information under a specified directory or file

Permissions: All Users

-p equivalent to the-p parameter in is

-r displays content in directories and subdirectories

-a displays all files in the specified directory, including hidden files

Modify directory file permissions and commands for the master and owner groups

1:chmod: Permission to change the owner, group, and other groups of a specified directory or file

Permissions: Root user or other user and group with permissions

U represents the owner of the file

G means that the owner of the file belongs to the same group

O means other than the other person

A means the above three

+ indicates increased permissions

-Represents the Cancel permission

= indicates a unique set of permissions

R indicates readable

W indicates writable

X indicates an executable

X means only if the file is a subdirectory or the file has been set as executable

-C Show Change action if file permissions have changed

-F does not display an error message even if the file cannot be changed

-V Show details of no permission changes

-R changes the same permissions for all files in the current directory and subdirectories in a recursive manner


2:chown command: Used to change the owner of the specified file, the genus Group

Permissions: Root or other privileged users and groups

-C If this file has changed, the change action is displayed

-F If the owner of the file cannot change or display an error message

-H only changes the link, not the file that link really points to

-V Show details of owner changes

-R the same owner changes to all files in the current directory as subdirectories, recursively changing them in a recursive way

3:CHGRP command

Used to change ownership of a file or directory

Permissions: All Users

Example: Change the owner of an AA file to Jack

CHGRP Jack AA

4:chattr command: For setting files with permissions that cannot be deleted or modified

Permissions: Root

I immutable, the file that set the I attribute cannot be modified, the user can neither delete it nor rename it, or other action: Only a super administrator can eliminate this property

Example: Setting the A.txt file is not modifiable

, Chattr +i a.txt

5:lsattr used to tie the hidden properties of a file or directory

-D Show hidden properties of a directory

-R recursive display of hidden properties of files in directories and subdirectories

-A displays the properties of all files and directories in the current or specified directory

-V Displays the version of the program

Example: Show hidden properties of all files in root directory

Lsattr-a

Displays the properties of all files and subdirectories under the FTP directory

Lsattr-ra/ftp

commands for creating and deleting directories

1:mkdir command: Used to create a directory

Permissions: All Users

-p Ensure that the directory name exists and that it does not exist to create a

-m set directory permissions when creating a directory

2:rmdir command: Used to delete empty commands

Permissions: All Users

-p When subdirectories are deleted this directory is also empty directory and deleted

commands for creating and deleting files

1;touch command: Change the file's time record and create a new file

Usage rights: All users

-D set time and date, can be used in a variety of different formats

Example: Create AA, BB, cc three files under a file

Touch {AA,BB,CC}

Modify Time History

touch-d "05:07pm 05/11/2010" AA

2:RM command: Delete a file or directory

Permissions: All Users

-F Force Delete files or directories, delete files or directories money no longer asks users

-I asks the user before deleting both files or directories, the default

-r/-r recursive processing, processing the files under the specified directory and subdirectories

3:MV Renaming and Moving commands

Permissions: All Users

-B If you need to overwrite files, back up before moving

-F Overwrite existing files and directories directly if the destination file or directory is duplicated with an existing file or directory

-I ask user before overwriting

-U does not overwrite if the destination file already exists and its file date is newer than the source file when you move or change the file name

-V Show Details when executing

6: Copy command: CP Copy file or directory

-L link to source file instead of copy

7:SCP commands the user to copy a local file or directory to a remote server, or to copy files from a remote server to a local

-P remains the same as the source file properties

-P Enter the custom port number




2:


Linux command System (i)

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.