使用shell找出同名文件的文件,并输出文件的全路径
使用find、perl、sort、uniq、sed一起操作如下:
- [root@station1 tmp]# find /etc -type f | perl -nle 's/(.*\/)/\1 /;print' | sort -k2 | uniq -f 1 -D | sed -e 's/ //'
- /etc/pam.d/atd
- /etc/rc.d/init.d/atd
- /etc/sysconfig/atd
- /etc/rc.d/init.d/auditd
- /etc/sysconfig/auditd
- /etc/pam.d/authconfig
- /etc/security/console.apps/authconfig
- /etc/sysconfig/authconfig
- /etc/pam.d/authconfig-gtk
- /etc/security/console.apps/authconfig-gtk
- /etc/pam.d/authconfig-tui
- /etc/security/console.apps/authconfig-tui
- /etc/rc.d/init.d/autofs
- /etc/sysconfig/autofs
- /etc/sgml/catalog
- /etc/xml/catalog
- /etc/certmonger/certmonger.conf
- /etc/dbus-1/system.d/certmonger.conf
- /etc/rc.d/init.d/cgconfig
- /etc/sysconfig/cgconfig
- /etc/cups/client.conf
- /etc/pulse/client.conf
- /etc/selinux/config
- /etc/vmware-tools/config
- /etc/vmware-tools/state/config
- /etc/pam.d/config-util
- /etc/security/console.apps/config-util
- /etc/rc.d/init.d/cpuspeed
- /etc/sysconfig/cpuspeed
- /etc/pam.d/crond
- /etc/rc.d/init.d/crond
- /etc/sysconfig/crond
- /etc/cron.daily/cups
- /etc/logrotate.d/cups
- /etc/pam.d/cups
- /etc/portreserve/cups
- /etc/rc.d/init.d/cups
- /etc/pam.d/cvs
- /etc/xinetd.d/cvs
- /etc/gdm/Init/Default
- /etc/gdm/PostSession/Default
- /etc/gdm/PreSession/Default
- /etc/depmod.d/dist.conf
- /etc/modprobe.d/dist.conf
- /etc/dbus-1/system.d/dnsmasq.conf
- /etc/dnsmasq.conf
- /etc/pam.d/eject
- /etc/security/console.apps/eject
- /etc/selinux/targeted/contexts/files/file_contexts
- /etc/selinux/targeted/modules/active/file_contexts
- /etc/selinux/targeted/contexts/files/file_contexts.homedirs
- /etc/selinux/targeted/modules/active/file_contexts.homedirs
- /etc/rc.d/init.d/firstboot
- /etc/sysconfig/firstboot
- /etc/pam.d/halt
阅读(622) | 评论(0) | 转发(0) |