Linux basic commands (3)

table of Contents

  • chmod
  • head
  • more
  • less

chmod command

Permission for the change of command in linux

Remember: r = 4 w = 2 x = 1

Rights generally -rwxr-x - x in the form of a total of 13 characters, of which the foremost - we do not understand the principle (understanding of the principles, please pass), rwx user belongs to the first group representation file is readable (r ), write (w), executable (x), respectively, is an abbreviation of the word. rx second group, belonging to the same group is represented as user permissions readable (R & lt), not write (-), executable (X), the third group the same logic, but the object has changed, permission for other users unreadable (-), and write (-), executable (x).

Then we look at the permissions of a file when it is to see an array of rwx each group consisting of, here's -rwxr-x - x its permissions is 751.

The results after revision 

 

head command

N the first line of a file to view

Format: head -n filename

 

 more command

 Page by page displays the contents of the file

Syntax: more filename

Methods: space (space): on behalf of a downward turn

           Enter: the representative of his party turned down

   / String that represents the content displayed in them, down search "string"

     -f: immediately shows the file name and line number currently displayed

     q: represents a leaving more immediately, does not display the contents of the file

 

 

 less command

less command is often used because the pages can be turned and look for the actual situation in the discovery process, very convenient

Usage: less log file name ---- page displays the contents of the file

Spaces or F Down

enter key wrap

q quit

pgup / pgdn Previous / Next Change

A direction key / next row switch

Specified search string: / find syntax similar character, and more inside. But here you can press the "n" continues to look down the other

 

Guess you like

Origin www.cnblogs.com/cheneyboon/p/11520963.html