Linux folder creation and deletion

Create folder

mkdir 文件夹名称

Create another folder (bb) in a folder (aa) in the current directory

mkdir 文件夹名称1/文件夹名称2If folder 1 does not exist, it will fail to create and prompt "No such file or directory".
mkdir -p 文件夹名称1/文件夹名称2If folder 1 does not exist, create folder 1 first, and then create folder 2 in it (no error will be reported)

Delete empty folder

rmdir 空文件夹名称 Delete the empty folder (empty folder, if there is content in the folder, an error "rm: cannot remove'empty folder name': Is a directory" will be reported)

Delete non-empty folders

rm -r 文件夹名称(Forcibly delete the folder and its internal files, and ask questions)
rm -rf 文件夹名称(Forcibly delete the folder and its internal files, don't ask, use it with caution)

Guess you like

Origin blog.csdn.net/nongminkouhao/article/details/108005030