sas*_*tte 3 unix command-line file
我在一个文件夹中有大约2000个子文件夹,在每个文件夹中都有.pdf
文件.我需要一个unix命令,将所有这些文件移到一个文件夹中.
mik*_*iku 10
$ cd thefolder # which contains the subfolders and where the PDFs should land
$ find . -name *.pdf | xargs -I {} cp -iv {} .
# find all files
# which end in .pdf
# recursively from
# the current folder
# |
# for each emitted line
# copy the output (captured by {}) to
# the specified path ('.' is the current directory)
# copy should be verbose and should ask,
# in case a file would be overwritten
Run Code Online (Sandbox Code Playgroud)
这应该将您的文件复制到/thefolder/
.如果你想移动它们替换cp
为mv
.