Linux Files, document operation commands (1), linux commands

Source: Internet
Author: User

Linux Files, document operation commands (1), linux commands

Open a directory (enter this directory): cd [path]

Create document: mkdir [file name]

Delete a directory (only empty directories are allowed. to delete the entire directory, You need to delete it one by one): rmdir

Create an empty file: touch [file name]

View files and directories: ls

Modify the document owner: chown

Modify the group where the document is located: chgrp

Modify the File Permission: chmod

View the default permissions of a file (a number will be returned, and the last three are the permissions not required in the directory and file, and the (-rw-) directory is (drwxrwxrwx )): unmask


Check the file content (nano editable file)

Cat: displays the file content from the first line.

Tac: displays the file content from the last line

Nl: displays the row number by the way (empty rows do not show the row number)

The cat-n file can also display the row number, and the line number of the empty row will also be displayed.

More: displays data on one page.

Less: similar to more, but can flip the page forward

Head: only view the first few rows of data (only 10 rows are displayed by default) (for example, the header-n 3 File Name Only displays the first three rows of this file)

Tail: only the last few rows

Od: Read File Content in binary mode



Search for file names

Whereis: Find a specific file

Locate: equivalent to fuzzy search. Enter the name of part of the file to obtain the path of the relevant file.

Find: search on the disk, the speed is relatively slow

Note: in linux, commands are embedded and installed. You need to configure the PATH variable for installation.


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.