如何创建文件夹,例如:wdw/1/11、wdw/2/22、... wdw/6/66、...、wdw/9/99,以及使用最深目录中的目录名创建文件,例如目录名_文件.txt
最佳答案
在 bash 中:
mkdir wdw # Creates the top dir.
mkdir {1..9} # Creates the subdirs using brace expansion.
for dir in {1..9} ; do
mkdir $dir/$dir$dir # Creates the subsubdirs.
touch $dir/$dir$dir/$dirdir"_file".txt # Creates the file.
done
关于Linux,如何使用目录名创建文件?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13181034/