Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
尝试在已安装目录中复制文件时,我在终端上打印了以下消息:
cp: writing `file': Bad address
但是,复制操作已成功执行,但我只想删除此消息(出于演示目的)。知道如何删除此警告(或错误)吗?
您可以将错误重定向到 /dev/null 或日志文件,如下所示:
cp a b 2>/dev/null
或者
cp a b 2>errors.log