1

This code is wrong but is there something to do its job?

mount somefile.iso | cp - Directory

More specifically, I have read-only issues while using the original mounted files so I need a copy.

Dead
  • 11
  • 1
  • 2
    What is it that you're trying to accomplish? `mount` will not list the contents of `somefile.iso`, it'll just create a spot on the filesystem that you could copy the files from. – Eric Renouf Nov 04 '16 at 14:36
  • In gui we right click on the file and choose "extract here" so we have a copy of iso contents, but `mount` just gives access to the original file which is "read-only". I want to do that in command line. – Dead Nov 04 '16 at 14:50
  • Actually I mounted my file in a temporary directory then copied it somewhere else to use it. Isn't there anyway to do this in one code? – Dead Nov 04 '16 at 14:53

1 Answers1

1

While this is definitely not possible through a pipe (mount does make the file accessible through the filesystem, but thanksfully will NOT send them all through stdout), you can however use normal command chaining like mount -o loop /path/to/file.iso /path/to/directory && cp /path/to/directory /path/to/cop. Here && just means that the second command will be executed if and only if the first command suceeded (i.e. returned 0).

Now apparently what you want to do is not mount the iso, but rather extract the files from the iso like you would do with a tar.gz or zip archive, if I understood correctly. In this case you might look here for more efficient alternatives : What is the fastest way to extract an ISO?