Red Flag Linux Desktop 6.0 User manual: directory and file operations

Source: Internet
Author: User
Keywords Linux desktop user manual file operation
Tags cd command command line create default deleted desktop directory directory operation

8.2.1 Directory Operation command

8.2.1.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:

Parameter feature description-a lists all files, including the "." The beginning of the file-D if the following is a directory, then use this parameter to output only the name of the directory-l display file entries in a long format, including number of connections, owner, size, Yun modification time, permissions, etc.-t sort by file modification time, instead of using file name ordering---- F add a symbol after the filename to represent the file type--a slash (/) appended to the directory file name--Append an asterisk after the executable file name (*)--After the symbolic link file append an @ character--normal file name without any characters cx the file name is sorted by row across pages CF Lists the file names in the directory by column, which appends a character to the file name to distinguish between the directory and the file type CR displays all files in the current directory in a multiple-column format, as well as 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

8.2.1.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 (.. To move the working directory up one level: CD. To return to the user home directory from anywhere in the system, you can use a CD command with no parameters.

8.2.1.3 Create a directory

Use the mkdir command to create one or more directories to effectively organize your own files. The syntax format for this 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 the 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

8.2.1.4 Delete directory When the directory is no longer in use, or if disk space has reached the limit value, you need to remove the unused directory from the file system. Use the rmdir command to remove one or more empty subdirectories from a directory with the following syntax:

rmdir [Options] Directory name [directory name ...]

The subdirectory should be empty before it is deleted, that is, all files in that directory must be emptied. If there are still other files in the directory, you cannot use the rmdir command. The current working directory must be above the deleted directory, not the deleted directory itself, or the subdirectory of the deleted directory.

-p option: recursively deletes the specified directory and its subdirectories. That is, if the specified directory has a subdirectory, it deletes its subdirectories before deleting the directory.

8.2.1.5 Display current directory

When you do this, you may not be able to remember your current directory, and command pwd can display the location of the user's current directory tree. As:

# pwd

#/usr/local/rfinput/bin

The information given by the system indicates that the user's current directory is/usr/local/rfinput/bin.

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.