Advertisement
rockdrilla

Linux / findutils / find(1) usage

Sep 3rd, 2014
613
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.06 KB | None | 0 0
  1. $ find prj/ -exec ls -lhd {} +
  2. drwxr-xr-x 4 user user 4.0K Sep 2 11:26 prj/
  3. drwxr-xr-x 2 user user 4.0K Sep 1 12:50 prj/kernel
  4. -rw-r--r-- 1 user user 55K Aug 19 09:28 prj/kernel/ChangeLog-3.14.17
  5. -rw-r--r-- 1 user user 22K Aug 19 09:28 prj/kernel/ChangeLog-3.16.1
  6. -rwxr-xr-x 1 user user 1.1K Aug 11 12:11 prj/kernel/apt.update.rb
  7. -rw-r--r-- 1 user user 9.3K Sep 16 2013 prj/kernel/builddeb
  8. -rw-r--r-- 1 user user 41K Sep 30 2013 prj/kernel/config
  9. -rw-r--r-- 1 user user 95K Sep 30 2013 prj/kernel/config.pristine
  10. -rwxrwxrwx 1 user user 968 Sep 1 12:50 prj/kernel/kk
  11. -rw-rw-rw- 1 user user 3.4K Sep 1 12:50 prj/kernel/kk.action
  12. -rw-rw-r-- 1 user user 9.9K Sep 16 2013 prj/kernel/kk_debkernel.sh
  13. -rw-r--r-- 1 user user 1.7K Feb 16 2014 prj/kernel/kk_kernel
  14.  
  15. $ find prj/ \( -exec echo every: {} \; -exec echo every2: {} \; \) , \
  16. > \( -type d -and -exec echo dir: {} \; \) , \
  17. > \( -type f -exec echo file: {} \; \) , \
  18. > \( -type f -executable -exec echo file exec: {} \; \)
  19. every: prj/
  20. every2: prj/
  21. dir: prj/
  22. every: prj/kernel
  23. every2: prj/kernel
  24. dir: prj/kernel
  25. every: prj/kernel/kk
  26. every2: prj/kernel/kk
  27. file: prj/kernel/kk
  28. file exec: prj/kernel/kk
  29. every: prj/kernel/builddeb
  30. every2: prj/kernel/builddeb
  31. file: prj/kernel/builddeb
  32. every: prj/kernel/kk_debkernel.sh
  33. every2: prj/kernel/kk_debkernel.sh
  34. file: prj/kernel/kk_debkernel.sh
  35. every: prj/kernel/config.pristine
  36. every2: prj/kernel/config.pristine
  37. file: prj/kernel/config.pristine
  38. every: prj/kernel/ChangeLog-3.14.17
  39. every2: prj/kernel/ChangeLog-3.14.17
  40. file: prj/kernel/ChangeLog-3.14.17
  41. every: prj/kernel/config
  42. every2: prj/kernel/config
  43. file: prj/kernel/config
  44. every: prj/kernel/kk.action
  45. every2: prj/kernel/kk.action
  46. file: prj/kernel/kk.action
  47. every: prj/kernel/ChangeLog-3.16.1
  48. every2: prj/kernel/ChangeLog-3.16.1
  49. file: prj/kernel/ChangeLog-3.16.1
  50. every: prj/kernel/kk_kernel
  51. every2: prj/kernel/kk_kernel
  52. file: prj/kernel/kk_kernel
  53. every: prj/kernel/apt.update.rb
  54. every2: prj/kernel/apt.update.rb
  55. file: prj/kernel/apt.update.rb
  56. file exec: prj/kernel/apt.update.rb
  57.  
  58. $ find prj/ \( -exec echo every: {} + -exec echo every2: {} + \) , \
  59. > \( -type d -and -exec echo dir: {} + \) , \
  60. > \( -type f -exec echo file: {} + \) , \
  61. > \( -type f -executable -exec echo file exec: {} + \)
  62. every: prj/ prj/kernel prj/kernel/kk prj/kernel/builddeb prj/kernel/kk_debkernel.sh prj/kernel/config.pristine prj/kernel/ChangeLog-3.14.17 prj/kernel/config prj/kernel/kk.action prj/kernel/ChangeLog-3.16.1 prj/kernel/kk_kernel prj/kernel/apt.update.rb
  63. every2: prj/ prj/kernel prj/kernel/kk prj/kernel/builddeb prj/kernel/kk_debkernel.sh prj/kernel/config.pristine prj/kernel/ChangeLog-3.14.17 prj/kernel/config prj/kernel/kk.action prj/kernel/ChangeLog-3.16.1 prj/kernel/kk_kernel prj/kernel/apt.update.rb
  64. dir: prj/ prj/kernel
  65. file: prj/kernel/kk prj/kernel/builddeb prj/kernel/kk_debkernel.sh prj/kernel/config.pristine prj/kernel/ChangeLog-3.14.17 prj/kernel/config prj/kernel/kk.action prj/kernel/ChangeLog-3.16.1 prj/kernel/kk_kernel prj/kernel/apt.update.rb
  66. file exec: prj/kernel/kk prj/kernel/apt.update.rb
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement