已经在profile中设定了cp=cp -i 在脚本中使用cp时,又不希望它有提示。覆盖式拷贝。使用什么参数,查man没看到。谢谢。 例如rm 有rm -f参数。mv有mv -f参数 [ 本帖最后由 kingkaung 于 2006-10-18 16:34 编辑 ]
在当前目录下建个bak目录,然后 cp * bak,会提示略过bak,有其它办法可以排除指定文件(夹)? 就像find的 exclude参数之类
# cp --help Usage: cp [OPTION]... SOURCE DEST or: cp [OPTION]... SOURCE... DIRECTORY or: cp [OPTION]... --target-directory=DIRECTORY SOURCE... Copy SOURCE to DEST, or multiple SOURCE(s) to DIRECTORY. -f, --force if an existing destination file cannot be opened, remove it and try again