1

When I try to move my files into /opt with the command mv, bash says that I don't have permission.

Zanna
  • 69,223
  • 56
  • 216
  • 327
HilalHussain
  • 19
  • 1
  • 2
  • 3
    Please add more information. Which user account are you using, and are you using sudo. – thomasrutter May 09 '17 at 00:47
  • I'd suggest that manually moving arbitrary files into /opt is probably the wrong thing to do. If you've got executable files, you should put them in ~/bin (in your home folder). Non-executable files belong elsewhere. – heynnema May 09 '17 at 14:23

1 Answers1

6

To move a file called filename into the /opt directory change directories using cd into the directory containing filename and run this command:

sudo mv filename /opt # preface mv with sudo to move a file into a directory that is owned only by root
karel
  • 110,292
  • 102
  • 269
  • 299
  • I'm suggesting to the user that they not manually move arbitrary files into /opt, but rather put executable files into ~/bin, and non-executables elsewhere. – heynnema May 09 '17 at 14:25