4

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
/bin/ls

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

ubuntu at host in ~
$ sudo pwd
/home/ubuntu

ubuntu at host in ~
$ sudo which pwd
/bin/pwd

ubuntu at host in ~
$ echo wtf
wtf

My dotfiles are here https://github.com/mike-spainhower/dotfiles

1 Answer 1

6

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.

2
  • 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, 2013 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. Oct 7, 2013 at 22:55

You must log in to answer this question.

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