Common Linux commands and common linux commands

Source: Internet
Author: User
Tags touch command

Common Linux commands and common linux commands
Directory: relative path and absolute path.

  • Absolute path: the path is written in the root directory, for example,/usr/share/doc.
  • Relative Path: the path is not written by/. For example, if/usr/share/doc is to be written under/usr/share/man, you can write it as [cd .. /man: This is the relative path.

Cd: Switch directory; pwd: display the current directory; mkdir: Create a new directory; rmdir: delete an "empty" Directory; rm: delete a file or directory; mv: rename mobile files, directories, and files;

Various File Viewing files:

Ls: display the attributes and permissions of the file; cat: view the file (the first row to the last row is displayed on the screen consecutively); tac: reverse view of the display file (from the last line to the first line in reverse display on the screen );

Nl: view files (with a row number when displayed); more: view files on pages (only page flip is allowed); less: view files on pages (you can view files on pages before and after PageUp and PageDown );

Head: extract the first few rows (head-n 20/etc/man. config); tail: extract the following rows; od: view non-text files;

Modify and create a file:

Touch: only creates an empty file with no content in it (rarely used );

Touch fileA: If fileA exists, use the touch command to change the date and time of the file or directory, including the access time and change time. If fileA does not exist, the touch command creates a blank file fileA in the current directory.

Vi command: You can create a file, write the content, and save it;

 

Related Article

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.