English 中文(简体)
只复制 *.log 文件
原标题:Copy only *.log file
这个问题在这里已有答案 : Bash : 复制命名的文件, 并重覆复制, 保存上个月关闭的文件夹结构 (6个解答) 。 我有以下的. ksh 文件 。 我只是想在维护文件夹结构和时间戳的同时, 从父目录复制 *.log 文件到目标目录。 下面的 ksh 复制了来自源/ 父目录的所有内容 。 我只是想复制 *. log 文件 。 #! / bin/ ksh # 输入参数 PARENT_ DIR= 1, TARGET_ DIR=" / 输出/ d_ grid_ 目标/ folder/ floor_ dump 文件。 如果“ - d'd 't'd“d“d“dtargET_ faretr_ diral_ dental_ diral_ diral_ diral_ gental_ diral_ gental_ diral_ gental_ gental_ d'
问题回答
Possible solution using cpio, assuming you don t have files with special characters in the name. cd "$PARENT_DIR" && find . -type f -name "*.log" | cpio -pdmuv "$TARGET_DIR" Omit cpio s option v if you don t want to see the list of processed files. See man cpio for a description of the options.




相关问题
KornShell- Creating a fixed width text file

I need to create a simple fixed width text file in KornShell (ksh). My current attempt using printf to pad the string isn t working out very well. What s the shortest, cleanest way to create a fixed ...

unix find command

how to use the find command to find files/directories which are not matching the pattern. for eg: find <some options > -name "dontfile.txt" should give me output of all the find whose file ...

encoding of file shell script

How can I check the file encoding in a shell script? I need to know if a file is encoded in utf-8 or iso-8859-1. Thanks

Case insensitive comparison of strings in shell script

The == operator is used to compare two strings in shell script. However, I want to compare two strings ignoring case, how can it be done? Is there any standard command for this?

1. 露台式照像

在Windows XP中,没有一时出现指挥时,是否有办法操作一种灰色文字? 我常常需要把“善待”(工作)与“灰色”同起来,即使我的文字没有产出,......

热门标签