View Single Post
  #8   (View Single Post)  
Old 30th November 2022
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 7,983
Default

I just happened by and noticed you edited your post to add
Quote:
Originally Posted by Entropic View Post
UPDATE (since original version of this post):...
I'm sorry that you're frustrated with using Unix/Linux utilities, which you've never used before. Briefly:
  • mount(8) attaches and makes a filesystem available underneath a "mount point", such as in your use-case, an otherwise empty directory you previously created, /mnt/pen.
  • cp(1) copies files and, if used recursively with a directory, an entire branch of a filesystem.
Check the contents of /mnt/pen after mounting it, before you blame the cp(1) command for any failures to copy. If the contents are empty, there will be nothing to copy.

Here's an example of a recursive directory copy with cp(1). In this example I have created a directory "a" and then under it created files "b" and "c", a sub-directory "d" and within that files "e" and "f":
Code:
t450$ ls -FR a
a:
b  c  d/

a/d:
e  f
Now, I do a recursive copy of directory "a" to "g" with cp(1). This copies the contents of "a" and every file and directory within "a" to a new directory "g", created by that cp command:
Code:
t450$ cp -R a g
t450$ ls -FR g
g:
b  c  d/

g/d:
e  f
Reply With Quote