Advertisement
rccharles

using ditto command

Jan 4th, 2019
521
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 2.65 KB | None | 0 0
  1. Here are example commands using ditto.
  2.  
  3.  
  4. mac $ cd /
  5. /
  6. mac $ ls -l
  7. total 46
  8. drwxrwxr-x+ 164 root  admin   5.4K Dec 22 08:49 Applications/
  9. drwxr-xr-x+  66 root  wheel   2.2K Jun 18  2018 Library/
  10. drwxr-xr-x@   2 root  wheel    68B Nov 21  2015 Network/
  11. drwxr-xr-x+   4 root  wheel   136B Jan 28  2015 System/
  12. lrwxr-xr-x    1 root  wheel    49B Jul 27  2015 User Information@ -> /Library/Documentation/User Information.localized
  13. drwxr-xr-x   13 root  admin   442B Aug 28 20:57 Users/
  14. ...clipped...
  15. lrwxr-xr-x@   1 root  wheel    11B Nov 21  2015 var@ -> private/var
  16. mac $ ls -l /Volumes/
  17. total 16
  18. drwxrwxr-x  10 mac   staff   408B Dec 22 22:13 --Mojave--/
  19. lrwxr-xr-x   1 root  admin     1B Dec 21 02:35 Macintosh HD@ -> /
  20. drwxrwxr-x   9 mac   staff   374B Dec 23 14:31 hps+/
  21. mac $ cd /Users
  22. /Users
  23. mac $ ls -l
  24. total 16
  25. drwxrwx---    5 root       admin   170B Jul 21 14:25 Deleted Users/
  26. drwxrwxrwt   13 root       wheel   442B Dec  9 22:28 Shared/
  27. drwxr-xr-x+  16 letssee    staff   544B Jan 28  2018 letssee/
  28. drwxr-xr-x+ 144 mac        staff   4.8K Jan  3 20:00 mac/
  29. mac $ cd mac
  30. mac $ cd play
  31. mac $ pwd
  32. /Users/mac/play
  33. # You are coping your play folder to your flash drive /Volumes/hps+. You need to give the new folder a name
  34. # the new folder play must not exist! Should it exist it will be overwritten!  
  35. mac $ ditto -v -rsrc /Users/mac/play /Volumes/hps+/play
  36. Copying /Users/mac/play
  37. mac $ pwd
  38. /Users/mac/play
  39. mac $ ls -lR
  40. total 24
  41. -rw-r--r--@ 1 mac  staff    56B Dec 19 15:11 containsBill
  42. -rw-r--r--  1 mac  staff     4B Dec 19 15:07 containsBob
  43. -rw-r--r--  1 mac  staff     5B Dec 19 15:08 containsJoe
  44. -rw-r--r--  1 mac  staff     0B Dec 19 19:56 hi"there"
  45. drwxr-xr-x  4 mac  staff   136B Jan  4 14:46 more/
  46.  
  47. ./more:
  48. total 0
  49. -rw-r--r--  1 mac  staff     0B Jan  4 14:46 file1
  50. drwxr-xr-x  3 mac  staff   102B Jan  4 14:46 moreStill/
  51.  
  52. ./more/moreStill:
  53. total 0
  54. -rw-r--r--  1 mac  staff     0B Jan  4 14:46 fileToo
  55.  
  56. # list contents of flash drive hps+
  57. mac $ ls -lR /Volumes/hps+
  58. total 0
  59. -rw-r--r--  1 mac  staff     0B Dec 23 14:30 hi2
  60. drwxr-xr-x  8 mac  staff   272B Jan  4 14:46 play/
  61.  
  62. /Volumes/hps+/play:
  63. total 24
  64. -rw-r--r--@ 1 mac  staff    56B Dec 19 15:11 containsBill
  65. -rw-r--r--  1 mac  staff     4B Dec 19 15:07 containsBob
  66. -rw-r--r--  1 mac  staff     5B Dec 19 15:08 containsJoe
  67. -rw-r--r--  1 mac  staff     0B Dec 19 19:56 hi"there"
  68. drwxr-xr-x  4 mac  staff   136B Jan  4 14:46 more/
  69.  
  70. /Volumes/hps+/play/more:
  71. total 0
  72. -rw-r--r--  1 mac  staff     0B Jan  4 14:46 file1
  73. drwxr-xr-x  3 mac  staff   102B Jan  4 14:46 moreStill/
  74.  
  75. /Volumes/hps+/play/more/moreStill:
  76. total 0
  77. -rw-r--r--  1 mac  staff     0B Jan  4 14:46 fileToo
  78. mac $
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement