Chinaunix首页 | 论坛 | 博客
  • 博客访问: 503943
  • 博文数量: 401
  • 博客积分: 244
  • 博客等级: 入伍新兵
  • 技术积分: 2215
  • 用 户 组: 普通用户
  • 注册时间: 2012-08-04 10:02
文章分类

全部博文(401)

文章存档

2013年(37)

2012年(364)

分类:

2012-09-14 14:59:02

使用shell找出同名文件的文件,并输出文件的全路径

使用find、perl、sort、uniq、sed一起操作如下:
  1. [root@station1 tmp]# find /etc -type f | perl -nle 's/(.*\/)/\1 /;print' | sort -k2 | uniq -f 1 -D | sed -e 's/ //'
  2. /etc/pam.d/atd
  3. /etc/rc.d/init.d/atd
  4. /etc/sysconfig/atd
  5. /etc/rc.d/init.d/auditd
  6. /etc/sysconfig/auditd
  7. /etc/pam.d/authconfig
  8. /etc/security/console.apps/authconfig
  9. /etc/sysconfig/authconfig
  10. /etc/pam.d/authconfig-gtk
  11. /etc/security/console.apps/authconfig-gtk
  12. /etc/pam.d/authconfig-tui
  13. /etc/security/console.apps/authconfig-tui
  14. /etc/rc.d/init.d/autofs
  15. /etc/sysconfig/autofs
  16. /etc/sgml/catalog
  17. /etc/xml/catalog
  18. /etc/certmonger/certmonger.conf
  19. /etc/dbus-1/system.d/certmonger.conf
  20. /etc/rc.d/init.d/cgconfig
  21. /etc/sysconfig/cgconfig
  22. /etc/cups/client.conf
  23. /etc/pulse/client.conf
  24. /etc/selinux/config
  25. /etc/vmware-tools/config
  26. /etc/vmware-tools/state/config
  27. /etc/pam.d/config-util
  28. /etc/security/console.apps/config-util
  29. /etc/rc.d/init.d/cpuspeed
  30. /etc/sysconfig/cpuspeed
  31. /etc/pam.d/crond
  32. /etc/rc.d/init.d/crond
  33. /etc/sysconfig/crond
  34. /etc/cron.daily/cups
  35. /etc/logrotate.d/cups
  36. /etc/pam.d/cups
  37. /etc/portreserve/cups
  38. /etc/rc.d/init.d/cups
  39. /etc/pam.d/cvs
  40. /etc/xinetd.d/cvs
  41. /etc/gdm/Init/Default
  42. /etc/gdm/PostSession/Default
  43. /etc/gdm/PreSession/Default
  44. /etc/depmod.d/dist.conf
  45. /etc/modprobe.d/dist.conf
  46. /etc/dbus-1/system.d/dnsmasq.conf
  47. /etc/dnsmasq.conf
  48. /etc/pam.d/eject
  49. /etc/security/console.apps/eject
  50. /etc/selinux/targeted/contexts/files/file_contexts
  51. /etc/selinux/targeted/modules/active/file_contexts
  52. /etc/selinux/targeted/contexts/files/file_contexts.homedirs
  53. /etc/selinux/targeted/modules/active/file_contexts.homedirs
  54. /etc/rc.d/init.d/firstboot
  55. /etc/sysconfig/firstboot
  56. /etc/pam.d/halt

阅读(622) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~