问题1:find命令用 “-a” 时为什么找不出以下*sample*文件?
[[email protected] test]# find / -name "usr"
/usr
/usr/share/doc/oddjob-0.30/sample/usr
/usr/share/gdb/auto-load/usr
[[email protected] test]# find / -name "usr" -a -name "sample"
[[email protected] test]# find / -name "usr" -a -name "*sample*"
[[email protected] test]#
解答:该命令相当于既找一个文件该文件既叫usr同时又叫sample,矛盾!
问题2:以下命令为什么不能重定向?
[[email protected] test]# ifconfig eth10
eth10: error fetching interface information: Device not found
[[email protected] test]# ifconfig eth10 2> /dev/null
[[email protected] test]# ifconfig eth10 | grep ‘interface‘ 2> /dev/null
eth10: error fetching interface information: Device not found
[[email protected] test]#
时间: 2024-10-07 15:47:13