9

I have some folders and files, I created a rar file from them and copy them to my linux machine using ftp then I use this command line to extract them:

sudo unrar e files.rar /home/usr1/file

It start working but after I open the folder, I did not find my folders, I only find files a lot of them but not structured in folders like the original folder.

How can I unrar them with keeping the original structures of files and folders?

andrew.46
  • 39,479
  • 1
    Why the F are you using sudo? You shouldn't get used to using sudo everywhere, only for commands that really need it, and if you do, only if you understand how and why the command may trash your machine. – Guntram Blohm Feb 20 '21 at 13:07
  • darn it I missed that. @GuntramBlohm is correct. NEVER use sudo when not needed. andrew: still don't want it? 7 upvotes already :D – Rinzwind Feb 20 '21 at 13:17

1 Answers1

16

The manual says:

e - Extract files to current directory.
x - Extract files with full path.

so it is expected behavior. Use x for to have it restore including path names.

Rinzwind
  • 310,127