Linux Learning Notes (ix)--command Learning (file and directory Viewing)

Source: Internet
Author: User

Linux files and directories View

Note: The following commands are from the network, if there are copyright infringement or other issues, please contact me to do the appropriate treatment, thank you very much ...

CD pwd ls cat tac more less Head tail command exercise:

Command CD (Abbreviation for change directory)
Grammar Transform Catalog
Extended

Relative path: is from. Or. The starting path. (. Represents the current directory: Represents the top level of the current directory)

Absolute path: To have a complete path, from the directory you want to list to the directory (must be absolute path from/to).

Parameters
.  Represents this layer directory: Represents the previous level directory-represents the home directory where the current user identity is located but it is customary to return to the previous level of the directory directly (CD
Instance

To facilitate the practice of the above command, I first create a few folders, as follows:


650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/4B/F6/wKiom1Q2OZeAbhNOAADZs8FrnE8573.jpg "title=" 16.png "alt = "Wkiom1q2ozeabhnoaadzs8frne8573.jpg"/>

650) this.width=650; src= http://s3.51cto.com/wyfs02/M00/4B/F6 /wkiom1q2kdsrprd-aafiztht7zs058.jpg "title=" 12.png "alt=" wkiom1q2kdsrprd-aafiztht7zs058.jpg "/>

1, Absolute path vs. relative path:

650) this.width=650; "Src=" http://s3.51cto.com/wyfs02/M02/4B/F7/ Wkiol1q2k8ytctgfaadxhymkyca278.jpg "title=" 13.png "alt=" wkiol1q2k8ytctgfaadxhymkyca278.jpg "/>

2, .&: & ~-Use of  .

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M01/4B/F7/wKioL1Q2LJTDPKhkAAFSPMREXkE026.jpg "title= "14.png" alt= "wkiol1q2ljtdpkhkaafspmrexke026.jpg"/>



Command Pwd
Grammar View your current directory
Extended No
Parameters

-P (Note: This is the capital letter P) shows the detailed path

Mail >> equivalent shortcuts to Windows

Spool/mail >> is the absolute path of mail

Instance

The following mail file is a connection file, so if you add the parameter-p, it will be fully displayed (just like in Windows, right-click on the shortcut to see the exact path of the shortcut as the effect).

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/4B/F1/wKioL1Q15hiCjQryAAHAiAt48Ps817.jpg "title=" 11.png "Width=" "height=" 197 "border=" 0 "hspace=" 0 "vspace=" 0 "style=" WIDTH:600PX;HEIGHT:197PX; "alt=" Wkiol1q15hicjqryaahaiat48ps817.jpg "/>


Command LS (abbreviation for list)
Grammar Display commands for files and directories
Extended No
Parameters
-A: All files, together with hidden (files that begin with.), are listed (common)-A: All files, together with hidden, but not included. And.. The two directories-D: Lists only the directory itself, not the file data in the directory (frequently used)-F: Lists the results directly without sorting (LS defaults to sort by file name!) F: According to files, directories and other information, give additional data structure-H: List the file capacity;-I: Lists inode number-L: Long data string list, including file attributes and permissions and so on data; (common)-r: Reverse Output-r: Lists all files in this directory-S: Large file size Small sort, not sort by file name;-T: Sort by time, not by file name.
Instance

ls to view the files in the directory ls-f viewing files in a directory ls-l displaying details of files and directories

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/4B/F8/wKioL1Q2NTmw4YMPAAJgqcySF2o079.jpg "title=" 15.png "alt=" Wkiol1q2ntmw4ympaajgqcysf2o079.jpg "/>

Ls-a View all files (included. &, .... of hidden files)

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/4B/F8/wKioL1Q2P6bQfcn9AAJPKqSobR8544.jpg "title=" 18.png "alt=" Wkiol1q2p6bqfcn9aajpkqsobr8544.jpg "/>

Ls-h is shown in the form of habit

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/4B/F8/wKioL1Q2QAvyLJrHAADL6QMl7OQ820.jpg "title=" 19.png "alt=" Wkiol1q2qavyljrhaadl6qml7oq820.jpg "/>

Ls-r List all content in this directory

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/4B/F7/wKiom1Q2P-iAUfPnAADZs8FrnE8655.jpg "title=" 16.png "alt=" Wkiom1q2p-iaufpnaadzs8frne8655.jpg "/>


Command Cat (concatenate's abbreviation)
Grammar View Documents
Extended No
Parameters

-B Displays the ordinal (but not the blank line) before the row

-N Displays the ordinal number before the row (blank lines are counted)

instance

No parameters displayed:

650) this.width=650; "Src=" http ://s3.51cto.com/wyfs02/m01/4b/f9/wkiol1q2re-tkixeaaftkbhnt_0528.jpg "title=" 20.png "alt=" Wkiol1q2re-tkixeaaftkbhnt_0528.jpg "/>

-n display ordinal (blank line also counted) 650) this.width=650; "Src=" http://s3.51cto.com/wyfs02/M00/4B/F7/wKiom1Q2Rc3T_ 7e8aai-imerbrq726.jpg "title=" 21.png "alt=" wkiom1q2rc3t_7e8aai-imerbrq726.jpg "/>

Command Tac
Grammar Reverse display of document content
Extended No
Parameters No
Instance 650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/4B/F7/wKiom1Q2RwjARkLbAAJtcpqehoo163.jpg "title=" 22.png "alt=" Wkiom1q2rwjarklbaajtcpqehoo163.jpg "/>
Command More
Grammar Paging through the document (only looking at the page, not backwards)
Extended

Enter & Space (space) turn down one page

Q Exit page

Parameters No
Instance 650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/4B/F7/wKiom1Q2Sx_gRbZcAAM3bDLQ7bQ304.jpg "title=" 23.png "alt=" Wkiom1q2sx_grbzcaam3bdlq7bq304.jpg "/>
Command Less
Grammar As with the above, paging through the document
Extended No
Parameters

Blank key: Flip one Page down;

[PageDown]: flipping down one page;

[PageUp]: Flip up one page;

Q: Leave

Instance 650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/4B/F7/wKiom1Q2TMKjawgCAANlR_DKrM4291.jpg "title=" 24.png "alt=" Wkiom1q2tmkjawgcaanlr_dkrm4291.jpg "/>
Command Head
Grammar View documents (only a few lines)
Extended No
Parameters

-N (followed by a number that indicates a few lines of content to display)

Note: Blank lines are also considered a line

Instance 650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/4B/F9/wKioL1Q2UnCx80m2AAJDcesLjy8677.jpg "title=" 26.png "alt=" Wkiol1q2uncx80m2aajdcesljy8677.jpg "/>
Command Tail
Grammar View a document (see the end of a few lines)
Extended No
Parameters

-N (n = number, indicating the next few lines to display)

Note: As with the above, a blank line is counted as a row.

Instance 650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/4B/F9/wKioL1Q2UvWiaPkCAAItOjhICfw327.jpg "title=" 27.png "alt=" Wkiol1q2uvwiapkcaaitojhicfw327.jpg "/>

Finally sorted out ....

This article is from the "Last Bus" blog, so be sure to keep this source http://hznethome.blog.51cto.com/722914/1561858

Linux Learning Notes (ix)--command Learning (file and directory Viewing)

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.