Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Without going into too much detail, I need to execute one linux command on redhat with root user access. Red Hat Server 5.4 does not recognise the sudo command.

The command su can be used to switch to the root user on redhat, but su cannot be done in one line. For example the command:

su ; cd opt/storage/RootAccessFolder

will not work because this only switches you to root, then executes the cd command once you have logged out from the root user.

I guess what i'm looking for is like a..

sudo cd opt/storage/RootAccessFolder

but I say again, sudo doesn't work. Any ideas?

share|improve this question

migrated from Sep 11 '12 at 3:06

This question came from our site for professional and enthusiast programmers.

Move this question to Unix & Linux – Manula Waidyanatha Sep 10 '12 at 10:47

You can install sudo command or use the command below.

su -l root -c 'cd opt/storage/RootAccessFolder'

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.