我正在尝试查找早于几天的文件,我想要将这些文件复制到特定的文件夹中,并通过一个命令从源目录中删除这些文件。
find . -type d -mtime +600 -exec cp -rf '{}' destination folder \; -exec rm -rf '{}' \;
错误:
find: ./one: No such file or directory
find: ./two: No such file or directory
find: ./three: No such file or directory
我如何解决这个错误?
例如,我希望将c复制到ab/而不是用c将a/b转换为文件夹:
$ mkdir /a /b /ab /b/b
$ ln -s /ab /a/b
$ touch /b/b/c
$ ls -Rl
.:
total 12
drwxrwxr-x 2 a
drwxrwxr-x 2 ab
drwxrwxr-x 3 b
./a:
total 0
lrwxrwxrwx 1 b -> ab
./ab:
total 0
./b:
total 4
drwxrwxr-x 2 b
./b/b:
total 0
-rw-rw-r-- 1 c
我试过:
cp -rf /b/* /a/
cp: can
编辑:找到一个重复的解决方案: rsync -a --删除https://stackoverflow.com/questions/23698183/how-to-force-cp-to-overwrite-directory-instead-of-creating-another-one-inside
工作的新脚本:
#!/bin/bash
numCopy=$1
shift
cmdline="${@}"
echo "prepare folders"
for ((i=1;i<=$numCopy;i++));
do
(rsync -a --delete
在执行dockerfile时,执行命令RUN cp -rf roundcubemail-1.2.3/. /var/www/html/,我得到以下错误:
cp: cannot create directory '/var/www/html/': No such file or directory
ERROR: Service 'mailserver' failed to build: The command '/bin/sh -c cp -rf
roundcubemail-1.2.3/. /var/www/html/' returned a no
我在顶部菜单栏中得到以下错误:
An error occurred.
Please run the Package Manager from the right-click menu or apt-get in a terminal to see what is wrong.
The error message was:'Error:BrokenCount>0'.
This usually means that your installed packages have unmet dependencies.
📷
我该如何解决这个问题?