Red Flag asianux Server 3 System Management: command-line Operations (ii)

Source: Internet
Author: User
Keywords Asianux command-line operation
Tags cd command command line command-line operation content create default directory directory operation

1.2 Directory Operation commands

1.2.1 View Directory

The command to view the contents of the directory is LS, which displays the contents of the current directory by default, and can be viewed by giving one or more directory names at the location of the command line arguments. The syntax format for the command is:

ls [options] ... [FileName] ...

The LS command has multiple command-line options, such as:

-A: List all files, including those with "." The beginning of the document;

-D: If followed by a directory, use this parameter to output only the name of the directory;

-L: Displays file entries in long format, including number of connections, owner, size, last modification time, permissions, etc.

-T: Sort by file modification time instead of using file name;

-C: Sort the file names vertically by column;

-F: Adds a symbol after the filename to indicate the file type;

CX: Sort file names by line spread;

CF: Lists the file names in the directory by column, which appends a character to the file name to distinguish the type of directory and file;
--Append a slash (/) to the directory file name
--Append an asterisk (*) to the executable file name
--Append an @ character after the symbolic link file
--no characters after normal file name

CR: Displays all files in the current directory in a multiple-column format and all files along the directory tree's subdirectories, also known as recursive lists. This command distinguishes between a directory and an executable file, that is, appending a character to the file name.

1.2.2 Change Working directory

Enter a directory, or change the current working directory using the CD command, the syntax format for the command is:

CD Directory Name

The CD command has a unique parameter that represents the path name (relative path name or absolute pathname) of the destination directory.

Use the dots (.. Move the working directory up the first level directory: CD. . To return to the user home directory from anywhere in the system, you can use a CD command with no parameters.

1.2.3 Create a directory

Use the mkdir command to create a directory or multiple directories to effectively organize your own files. The syntax for the command is:

mkdir [Options] Directory name [directory name ...]

The same subdirectory should contain similar files. For example, you should create a subdirectory that contains all the database files, another subdirectory contains a spreadsheet file, and a subdirectory to hold a project-related file.

-P option: Create a directory and its subdirectories at the same time.

Mkdir-p Directory Name/subdirectory name

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.