"Linux" Bird's Linux private cuisine basic study finishing (i)

Source: Internet
Author: User

recently, I have been writing PPC simulators and assemblers, also in the design. So the new look at "Bird's Linux private dishes", or a lot of commands are not familiar. I'm going to write a few blog notes down.

1. nl [-BNW] FileName: Add line number to print
Parameters:
- B: Specifies the way the line number is specified, mainly in two ways:
- B A: Indicates that the line number (similar to cat-n) is also listed, whether or not it is a blank line;
- B T: If there is a blank line, do not list the line number (the default) for the empty row.
- N: List the method of line number representation, there are three main kinds:
-N LN: The line number is displayed at the left of the screen;
- N RN: The line number is displayed on the very right of its own field and does not add 0;
- N RZ: The line number is displayed on the very right of its own field, plus 0.
-W: the number of digits occupied by the line number field.

2. More: One page, one page flip
Supported keys:
Space: Represents a page down;
Enter: represents scrolling down one line;
/string: Represents the keyword in this display to query down the "string";
: F: Displays the file name immediately and the number of rows currently displayed;
Q: The delegate immediately leaves more, no longer displays the contents of the file;
B or [ctrl]-b: Represents paging back, but is useful only for files and useless for pipelines.

3. Less: one page, one page flip
Supported keys:
Space: Flipping down one page;
[PageDown]: flipping down one page;
[PageUp]: Flip up one page;
/string: Queries the keyword "string" Down;
string: Query up the keyword "string";
N: Repeats the previous query (related to/or);
N: Reverse repeats the previous query (related to/or);
Q: Exit.

4. Head [-N number] FileName: Remove the previous lines
Parameters:
- N: followed by numbers, representing the number of rows to display;

5. Tail [-NF] FileName: Take back a few lines
Parameters:
- N: followed by numbers, representing the number of rows to display;
- F: Indicates continuous detection of the subsequent files, until the [ctrl]-c] is pressed to end the detection of tail.

6. od [-t TYPE] FileName: Lookup fee Plain text file
Parameters:
-T: followed by various types of output, for example:
A: Use the default characters to output;
C: Use ASCII characters to output;
D[size]: Use decimal to output, each integer occupies size bytes;
F[size]: Use floating point number to output, each integer occupies size bytes;
O[size]: Use octal to output, each integer occupies size bytes;
X[size]: Use hexadecimal to output, each integer occupies size bytes;

7. Touch [-ACDMT] FileName: Modify file time or create file
Parameters:
-A : Modify the access time;
- C: Modify the file time, if the file does not exist, do not create the file;
- D: You can follow the date you want to modify without the current date, or you can use the--date= "date or time";
- m: Modify Mtime only;
- T: the time after which you want to modify instead of the current time, in the format [YYMMDDHHMM].

8. Umask [-S]: File default Permissions
Parameters:
-S: viewed as symbol type.

9. chattr [+-=] [asacdistu] FileName: Set hidden properties of the file
Parameters:
+: Add a special parameter, the other existing parameters will not move;
-: The deletion of a particular parameter, the other existing parameters are not moving;
=: Only the parameters that follow are followed.
A: When you set the A property, the access time Atime will not be modified if you have access to this file. Avoids excessive access to the disk by a slow I/O machine;
S: The general file is written asynchronously to the disk, plus the parameter S, when you make any changes to the file, synchronization also into the disk;
A: After setting up a, this file can only add data, the deletion can not modify the data;
c: After setting C, the file is automatically compressed. Automatic decompression when reading, but in the storage, the first compressed after storage;
D: When the dump program is executed, the D attribute is set so that the file will not be backed up by dump;
I: So that the file can not be deleted, renamed, set up the connection is also unable to add data;
S: If the file is deleted, it will be completely deleted from the disk;
u: If the file is deleted, the data content is actually still on the disk, can be retrieved.

lsattr [-ADR] filename: Show file hidden Properties
Parameters:
-A: Displays the hidden properties of the file;
-D: If it is a directory, list the properties of the directory itself rather than the files within the directory;
-R: Listed together with the data in the catalogue.

which [-a] command: Looking for "execute" file
Parameters:
-A : Lists all directories that can be found in the path directory, not just the first found command name.

Whereis [-BMSU] FileName: Finding a specific file
Parameters:
- B: only binary files are searched;
-M: only find files under the manual path of the description file;
- S: Only source files are found;
-U: Find other special files that are not among the above three options.

locate [-ir] keyword: finding specific keywords
Parameters:
-I: Ignoring the difference in case;
- R: The display of the regular expression can be followed.

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.