Common Linux File Processing commands and linux File Processing

Source: Internet
Author: User

Common Linux File Processing commands and linux File Processing

I am a beginner in Linux. Take a note. Below are some common file processing commands in Linux:

Command Prompt

[Root @ localhost ~] #

Where:

Root indicates the current Login User

Localhost indicates the Host Name

~ Indicates the current directory (Home Directory)

# Prompt indicating Super User Name

The normal user's prompt is $

  • Query pipeline content: ls

Ls [Option] [file or directory]

Options:

-A: displays all files, including hidden files.

-L display details

-D. view directory properties.

-H humanized display file size

-I display incode

  • Create directory: mkdir

Mkdir-p [directory name]

-P recursive Creation

Make directories

  • Switch Directory: cd

Cd [Directory]

Command: change directory

Simplified operations

Cd ~ (Or enter only cd) to enter the home directory of the current directory.

Cd-go to the last directory

Cd .. go to the upper-level directory

Cd. Enter the current directory

  • Query Directory location: pwd

Pwd

Print working directory

  • Delete an empty directory: rmdir

Rmdir [directory name]

Command: remove empty directory

  • Delete a file or directory: rm

Rm-rf [file or directory]

Command: remove

Option:

-R: delete a directory.

-F force Delete

  • Copy command: cp

Cp [Option] [original file or directory] [target directory]

Option:

-R copy directory

-P joint file property Replication

-D if the source file is a linked file, copy the link property.

-A is equivalent to-pdr.

  • Cut or rename: mv

Mv [source file or directory] [target directory]

If the target directory is the current directory, rename it; otherwise, cut

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.