1

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

2
  • 3
    Please add more information. Which user account are you using, and are you using sudo. May 9, 2017 at 0: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 9, 2017 at 14:23

1 Answer 1

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
1
  • 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 9, 2017 at 14:25

Not the answer you're looking for? Browse other questions tagged .