How to use sudo to view a hidden directory?

Knute Johnson ubuntu at knutejohnson.com
Thu Sep 29 23:06:48 UTC 2011


On 9/29/2011 2:57 PM, Avi Greenbury wrote:
> Paul Sladen wrote:
>> But it's very rare in practice (in my workflows) that I'd need to do
>> this;  mostly a:
>>
>>    sudo ls -l /root
>>    sudo cp -a /root/hidden /root/other-hidden
>>
>> is sufficient.  If you need to cat into a root owned file, you can:
>>
>>    echo asdf | grep asdf | sudo tee -a /root/created-as-root
>>
>> all of these have the massive advantage of being logged and audited.
>
> I was under the impression that the shell started by
>
> sudo -s
>
> was similarly logged, is that not so? If so, that's substantially more
> humane (in my opinion) than adding five keystrokes to each command.
>

sudo -s cd /root works but you don't stay there once the shell is done. 
  sudo -s cd /root; ls works fine though, thanks for that tip.

Doesn't seem to log the commands though.

-- 

Knute Johnson




More information about the ubuntu-users mailing list