Linux has a command to delete a file reminder information, mkdir and rm command options

mkdir and rm command options

learning target

  • Delete files can say there is information about the command options

1. mkdir command options

Command Options Explanation
-p Create a folder depends

mkdir command options renderings:

[Image dump the chain fails, the source station may have security chain mechanism, it is recommended to save the picture down uploaded directly (img-08eaX4xH-1583850585980) (imgs / mkdir% E9% 80% 89% E9% A1% B9.png)]

2. rm command options

Command Options Explanation
-i Interactive prompts
-r Recursively delete the directory and its contents
-f Force delete, ignore the file does not exist, without prompting
-d Delete empty directories

rm -i command options renderings:

[Image dump the chain fails, the source station may have security chain mechanism, it is recommended to save the picture down uploaded directly (img-B6MVzvtj-1583850585981) (imgs / rm% E9% 80% 89% E9% A1% B9-1.png )]

rm -r command options renderings:

[Image dump the chain fails, the source station may have security chain mechanism, it is recommended to save the picture down uploaded directly (img-62dPXneq-1583850585981) (imgs / rm% E9% 80% 89% E9% A1% B9-2.png )]

rm -f command options renderings:

[Image dump the chain fails, the source station may have security chain mechanism, it is recommended to save the picture down uploaded directly (img-TaO19yqV-1583850585982) (imgs / rm% E9% 80% 89% E9% A1% B9-3.png )]

rm -d command option renderings:

[Image dump the chain fails, the source station may have security chain mechanism, it is recommended to save the picture down uploaded directly (img-bi1xwpA2-1583850585982) (imgs / rm% E9% 80% 89% E9% A1% B9-4.png )]

3. Summary

  • Create nested folders using "mkdir -p" nested directories
  • Delete empty directory using the "rmdir directory name" or "rm -d directory name"
  • To delete a non-empty directory using the "rm -r directory name"
Published 698 original articles · won praise 929 · views 120 000 +

Guess you like

Origin blog.csdn.net/qq_35456045/article/details/104785313