Related Actions for text

Source: Internet
Author: User

Create a file and directory

1 Touch Touch is intended to modify the timestamp of the file, but you can create a new file if the file does not exist.

-A modifies the file's access time, which is the modification to read the file or to execute the file time

-M change the time the file content was modified

-C modifies the time at which the file's property information is changed, that is, the owner of the file, the owning group, and the time the file permission was changed

The time that can be modified after-T. Format is [YYMMDDHHMM]

2 mkdir command to create a directory

-p recursive creation of subdirectories

-V Show details of the creation process

3 LS View directory with those subdirectories or files

-L Displays the file's attribute information. That is, the owner of the file. Array permissions file type information

-ld displaying property information for a directory

-a displays all files in the directory, along with hidden files

-H Displays the size of the file in kilobytes

4 CP commands for copying files or directories

-P is copied along with the file's attribute information

-R recursive replication to replicate directories

-F Forced replication

-I if the target file already exists, will ask whether the Operation

5 MV move a file or directory, or change the name

-F Mandatory meaning, if the target file already exists, will not ask and directly overwrite

-I if the target file already exists, I will be asked if the operation

6 CD Switch directory commands

~ Switch to the user's home directory

~ User name switch to the home directory of the specified user

-Switch to the last visited directory

.. Switch to the top-level directory in the current directory

7 RM Delete a file or directory command

-F forcibly Delete, does not ask whether the operation

-R recursive deletion, along with directories and files in the directory

8 Cat Viewing the contents of a file

-N to mark the file with the uplink number

9 PWD Show Current working directory

WC Text Statistics Command

How many rows are in the-l statistics file

-W Statistics file How many words

How many bytes of the-C statistic file

-M statistics how many characters are in a file

The number of characters in the longest line in the-l statistic file

11.head View the first few lines of the file (default is 10 rows)

-N View the first n rows of a file

Tail viewing the following lines of a file (default is 10 rows)

-N View the following n rows of a file

The sort text sorting command, which is sorted by default in ascending order

-n Sort by numeric size

-R Reverse Order

-t specifies the field delimiter

-K Sort by that field

-F ignores case

Uniq Displays the contents of the file and displays the duplicate lines only once

"If several of the same rows are not adjacent, they are not considered duplicates"

-D displays only duplicate rows, one at a time

-D displays only the rows that are re-fixed, displayed multiple times

-C show repeated rows How many times have you repeated

The. TR Character Conversion command "cannot be followed directly by the file name and requires input redirection"

Eg:tr A-Z </etc/passwd converts all lowercase letters in the/etc/passwd file to uppercase letters

Tee reads data from standard input and sends to standard output and specified file

"A copy is displayed on the screen and a copy is saved in the file."

[Email protected] desktop]# echo Hello | Tee/tmp/file
Hello
[Email protected] desktop]# Cat/tmp/file
Hello



Related Actions for text

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.