Announcement

Collapse
No announcement yet.

directory nog accessible ( sudo cd )

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    directory nog accessible ( sudo cd )

    Hi all,

    I have this issue... I extracted a couple of directories from a zipfile and they are owned by root:root . and not available for others. The problem is that I cannot use sudo to get into these directories because when I do a
    Code:
    sudo cd backupdir
    it says :
    Code:
    sudo: cd: command not found
    Ofcourse I can always use chmod and chown to get access, which is what I did... but It's odd that sudo , which gives you root privileges, cannot cd to a directory that is owned by root.
    Anybody know if this is either a bug or a design flaw, or if I just messed up my install? ;-) Or maybe there is a very good reason for not having cd available to sudo .. please explain.

    #2
    Re: directory nog accessible ( sudo cd )

    Hi,

    For me it's quite natural not to have access to cd command. I explain myself :
    sudo is not a shell, it's making one shot commands without keeping notes of where you are, if you would do :
    you're in /home folder and you type :
    sudo cd toto
    sudo ls -l
    you would still be in /home
    If you want to behave like in shell, you should sudo sh
    and then it will be a root shell (so handle with care)

    Cheers

    Comment


      #3
      Re: directory nog accessible ( sudo cd )

      Thanx.. it makes so much sense I'm almost embarrased I asked LOL
      Always used to login in as root for admin tasks.... where ofcourse you have the shell and commands like cd available.
      Thanx again !

      Comment


        #4
        Re: directory nog accessible ( sudo cd )

        A question is never bad, it's good to get clear ideas of concepts like this

        Cheers

        Comment

        Working...
        X