gpt4 book ai didi

Linux 命令用 1 个命令创建目录树?

转载 作者:太空宇宙 更新时间:2023-11-04 05:43:49 25 4
gpt4 key购买 nike

您好,我想要一个命令来在一个命令中创建这样的目录 http://imgur.com/qArsAIb

想知道执行此操作的结构

谢谢

最佳答案

来自manpage (尝试man mkdir):

SYNOPSIS
mkdir [OPTION]... DIRECTORY...

DESCRIPTION
Create the DIRECTORY(ies), if they do not already exist.

-p, --parents
no error if existing, make parent directories as needed

所以你可以使用:

mkdir -p folder1/subfolder1 folder1/subfolder2 folder2/aap folder3/noot folder3/mies/piet

然后 find 将返回:

.
./folder2
./folder2/aap
./folder1
./folder1/subfolder2
./folder1/subfolder1
./folder3
./folder3/noot
./folder3/mies
./folder3/mies/piet

关于Linux 命令用 1 个命令创建目录树?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32919270/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com