Server Fault is a question and answer site for system and network administrators. 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

On Ubuntu 13.04 running in EC2, all commands through sudo work fine except ls. Here are some example commands to illustrate the issue:

ubuntu at host in ~
$ sudo ls
sudo: command: command not found

ubuntu at host in ~
 1 $ sudo which ls

ubuntu at host in ~
$ sudo /bin/ls
bin  dotfiles  init  npm  tmp

ubuntu at host in ~
$ sudo pwd

ubuntu at host in ~
$ sudo which pwd

ubuntu at host in ~
$ echo wtf

My dotfiles are here

share|improve this question
up vote 6 down vote accepted

Line 40 of your .aliases is aliasing ls to a command called 'command'. Your system can't find this program named 'command'.

You can tell from your first sample error: the first instance of the word 'command' is the system naming the program it failed to find.

share|improve this answer
Derp. Thank you for finding that. I guess the question for me now is why access to command is not allowed via sudo. It works as root and there is no indication in visudo nor /etc/sudoers.d that it's disallowed (ALL is used for commands) – Mike S Oct 7 '13 at 15:40
command is a bash built-in, not a program per se. You can see the same behavior with sudo cd. In general, sudo against built-ins usually doesn't accomplish what you think it would. – Joshua Miller Oct 7 '13 at 22:55

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.