Parameters that cause headaches

Source: Internet
Author: User
To learn about linux, what makes me feel a headache is the parameters in the command. The following lists some parameters 1 and ls (list) used to display information-l detailed information of the displayed file, including file attributes, size, date, and other information ls-lvarlog-h this option is best used with-l. Based on-l, the file size is displayed in kb, ls-lhvar learning linux makes me feel a headache CommandParameters below, Ls(List) is used to display the display information-l displays the detailed information of the file, including the file attributes, size, date and other information ls-l/var/log/-h this option is best used with-l. Based on-l, the file size is displayed in kb, ls-lh/var/www or ls-h-l/var/www-a shows multi-purpose files, including hidden files. (Some objects that do not want to be viewed by others can be hidden files). The corresponding-A does not represent the local directory ".. "And the parent directory ". ", All others are the same.-r. If you want to sort files in reverse alphabetical order, you can use this option-R to display the content in files and folders recursively.-d this option is used to display the information of directories or files, write ls-ld/var/www in this way to display www information rather than other files in the www directory. 2, Cd(Change directory) switch the working directory usage method cd/var/www/html cd without adding any options, switch to your home directory cd ~ Also switch to the user's home directory, cd ~ Switch username to the Home Directory of a specific user (usually root can be executed) 3, Mkdir(Make directory) create directory usage method mkdir [options] [arguments] mkdir/tmp/test directly create-p can be recursively created, used when the upper directory does not exist, for example, mkdir-p/tmp/x/y, and x does not exist, you can use-p to create both x and y-v to display the creation process, which is of little use. 4, RmDir can only delete empty directories, no practical usage Rmdir/Tmp/test must be an empty directory before deletion. Otherwise, error 5 and rm can be interpreted as an upgraded version of rmdir to delete files and directories, be sure to use the rm [options] parameter rm/tmp/a.txt. You can delete files without adding any parameters, but it is very troublesome to determine whether to delete them, in fact, rm = rm-I does not want the prompt to use-f to force the deletion, but the deletion directory cannot be deleted, you need to use-r to recursively Delete the Directory and use it with-f, but it is useless to determine the directory before deletion. 6, CpCopy files and directories cp [option] source FileDestinationfile-r recursive replication: cp-r ol when there is a file under the copy directory DfIle newfile (renamed)-p copies the content while retaining the original owner and group-a =-rp of the file or directory. 7, Pwd(Printing working directory) display the current working directory usage pwd without adding anything 8, MvMv source destination is used to rename a file and directory while mv is used in the same directory. mv test 123 renames test to 123, TouchThis interface is used to create an empty file. You can use touch filename to modify the Time of the file and directory. If filename does not exist, you can modify the file time when it exists. touch-t yymm DdThe time when HHMM filename was used to modify files and directories 10, StatDisplay time of files and directories. Use stat filename to view the latest file modification time.
0 people This article
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.