dapper sudo
Alexander Skwar
listen at alexander.skwar.name
Thu Jul 6 12:48:25 UTC 2006
boricua wrote:
> a little of the list,
>
> but i just tried sudo cd /var/lib/mysql/wordpress
>
> and i get command not found
>
> wordpress is own mby mysql.mysql
>
> i thought sudo becomes root which can cd into any directory
It can, but read the error message you got. "command not found".
That's because sudo can only execute external programs and
cd is a shell builtin. "which cd" and "type cd" would've told
you that.
[12:56:33 vz6tml at dewup-ww02:~] $ type cd
cd is a shell builtin
[14:44:20 vz6tml at dewup-ww02:~] $ which cd
which: no cd in
(/usr/local/bin:/usr/bin:/bin:/opt/bin:/opt/ICAClient:/opt/sun-jdk-1.4.2.12/bin:/opt/sun-jdk-1.4.2.12/jre/bin:/opt/sun-jdk-1.4.2.12/jre/javaws:/usr/kde/3.5/bin:/usr/qt/3/bin:/opt/flexlm/bin:/u/vz6tml/bin:/u/vz6tml/bin/iman:/u/vz6tml/lbin:/usr/sbin:/sbin)
Can't you change into that directory with a normal account? Hm -
it's under mysql, and if the perms for /var/lib/mysql are like
on Gentoo (drwxr-x--- 5 mysql mysql 488 26. Apr 12:36 /var/lib/mysql/)
then you can't change into that directory. Why do you want to change
into that directory in the first place? If you absolutely *MUST*
change into that directory (again: Why?), then you need to start
a shell. See "man sudo" for that.
Alexander Skwar
--
The more laws and order are made prominent, the more thieves and
robbers there will be.
-- Lao Tsu
More information about the ubuntu-users
mailing list