Linux Learning Note 2016.03.12

Source: Internet
Author: User

I come again, not baby lazy, but today all day in the laboratory and Brother Siang Tuning board, 10 points more than 40 to return to the dormitory, today also can only learn two new orders, but this is also insisted on, and so on board adjustment should be more time to learn it.

Today learned two and directory operations related to the command, the Linux directory is equivalent to the folder in Windows, but also note that the General command in Linux is part of the files and directories, collectively referred to as files, only special commands to fixed operations directory or files, So like the general file Operation command can be directly applicable to various files.

1. Create directory: mkdir [options] directory name, supported parameters:

Mkdir-l directory name, create directory when the directory access permissions, estimate I womb will not use this parameter

mkdir AA bb cc, so the most direct, connected to create three directories, these three directories are the same level.

Mkdir-p aa/bb/cc, this is to create a level three directory, that is, AA is the parent directory of BB, and BB is the parent directory of CC, so create a level three directory.

2. Delete directory:

(1) rmdir This command can only delete empty folders, such as RmDir AA can be empty folder AA deleted,

Rmdir-p aa/bb/cc, delete cc, if delete cc after bb into empty folder then delete bb, similarly if AA becomes empty folder after remove AA; but although AA bb cc are empty folders, if only write RmDir AA is will prompt delete failed because inside There's something else. Note that the folder operation is the directory under the current working directory operation, for the operation of this directory is not valid, for example, I now operate under the directory AA, AA below an empty folder cc, so I input rmdir aa/cc, will prompt operation error , there is no directory aa/cc under the current folder, but you can do this when you jump out of AA to return to the top level of AA.            Also, rmdir-p and rmdir can be multi-level directory operation, but the effect is different, such as RmDir aa/cc is the AA under the delete, but do not delete a, and Rmdir-p aa/cc is now cc deleted, further if AA is empty Folder so the AA is also removed; this is because rmdir can not add p when the multi-level operation, then the front of the aa/cc is only equivalent to the index, that is to remove the AA below the CC just

(2) RM command, this command not only can delete the folder, but also can delete the file, regardless of whether the folder contents are empty;

The parameters of the RM command are r f I v, where R is used to delete the folder, such as the AAA directory under the AA directory, then only enter the RM AAA will prompt the error, will be prompted AAA is a directory can not be deleted, this time with

Rm-r AA and the following files can be removed all, f parameter is forced to delete, do not need to ask the user whether to delete, in fact, the default is forced to delete, so this parameter can not be used, and I parameter in the delete will ask whether delete files, is more secure, only when the user input y will be deleted, Entering n preserves the source file. The V parameter is a display deletion process that prints the deleted results to the screen.

Come here today, it is almost 1 o'clock, and tomorrow to get up early, refueling, and finally did not live up to their

Linux Learning Note 2016.03.12

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.