[HLUG] cd command unknown in my system!

John Hedges john at drystone.co.uk
Sat Jan 14 15:00:34 GMT 2006


On Fri, Jan 13, 2006 at 11:41:50PM +0000, Julian Robbins wrote:
> Graham Cole wrote:
> 
> >Hi John
> >I'm trying to put in a link to get my djview (an essential viewer for
> >the 1837online website) working as a plugin after upgrading my Mozilla
> >browser. I have two commands to use for doing this, firstly
> >$ sudo cd /usr/lib/mozilla-firefox/plugins
> >That resulted in this error line: 
> >sudo: cd: command not found
> > 
> >
> I found something similar on Ubuntu. If you cd to a location owned by 
> root, you can do thsi without sudo. When using sudo with cd makes Ubuntu 
> complain.
> 
> I found it a bit strange too !!
> 
> Julian
> 
> 
> >Using that echo command gave:
> >gc1 at localhost:~ $ echo $SHELL
> >/bin/bash
> >
> >I'm puzzled.
> >
> >Thanks,
> >Graham

Hi Graham

I guess sudo doesn't invoke a shell. Perhaps 

$sudo -s cd /usr/lib/mozilla-firefox/plugins

but this would sudo, change directory and quit without doning anything
useful - root's current dir would be reset afterwards - ie would not be
/usr/lib/mozilla-firefox/plugins for the next sudo (I think).

$ sudo -s 'cd ... && ln -s ...'

might do the job. However I'd just use su to log in as root, do
root stuff and then log out again eg:

$ su
Password: *********
# cd /usr/lib/mozilla-firefox/plugins
# ln -s /wherever/the/plugin/lives
# quit
$

Cheers

John




More information about the Herefordshire mailing list