Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top
cd ~/mosesdecoder/sample-models
~/mosesdecoder/bin/moses -f phrase-model/moses.ini < phrase-model/in > out

I’m having an issue running this on the command line it gives me a permission denied error, is there anyway around it? I tried adding sudo in front but that didn't help, I'm a novice user trying to run a program on the command line and I tried doing it through the root level access but I am unable to locate this directory that way because it tries to do everything in the root directory.

share|improve this question
you can do it with root by using cd / and then to your home directory . – Raja Jun 21 '12 at 16:15
Please edit your question and specify the exact error message after you run the command. Then we'll be able to help you better! :) – SirCharlo Jun 21 '12 at 16:21
Probably the problem you are running into when you use sudo is that the shell is running moses as the superuser, but the redirects (< and >) are with your own privileges. I would login as the superuser with sudo -i and then cd ~YOURUSERNAME (so in my case, that would be cd ~zpletan). – zpletan Jun 21 '12 at 16:27
Why should sudo be required when running from your own personal home directory? Is root somehow the owner of the directory it's in, or the "phrase-model" directory? – Marty Fried Jun 21 '12 at 17:02
Thank you all your suggestions helped me find my way to the solution. SirCharlo the actual error was Permission Denied so thats why I didn't copy paste it. The problem was that since I was logged in as root I was using the wrong syntax, removing the space after the '<' actually did the trick. Thank you all again. – Ferdinand Jun 21 '12 at 17:27
up vote 2 down vote accepted

Since I was running in root I was using ~ in my syntax and when in root that is not requires so I did it without any ~, and also removed a space after '<' and that did the job.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.