cd command

I'm a student and trying to learn commands. Logged into my ded. test server (Centos) as root and tried to cd to the 'home' directory and then to a diectory where my website is. I get 'no such file or directory.' I'm missing a step, however I don't know what.

Thanks,
James

James,

Can you post the exact commands you entered and the responses you get. Also say what directory you are trying to get to.

When I log into the server I'm at root@server [~]# Need to get to the home directory that has the website accounts.

Tried all kinds of variations of the 'cd" command, eg., cd home etc, but get 'no such file or directory.' I'm missing a step (?) to get to the home dir.?

Thanks

I don't have redhat installed at the moment but I think the default location for web pages (assuming you've got apache) is /usr/local/apache/htdocs so try

cd /usr/local/apache/htdocs

If that doesn't work look in your conf file for where the documentroot is pointing at:

grep DocumentRoot /etc/httpd/conf/httpd.conf

and whatever that comes back with is where you need to cd to.

"grep DocumentRoot /etc/httpd/conf/httpd.conf" worked :slight_smile:

Appreciate your help, Mark. Now, I'm off to see what trouble I can get into. Most likely will have other Q's.

FWIW:
If you try commands as the root user you will get into trouble. You are far better off piddling around as a non-priv user. Unless you enjoy completely rebuilding your system....

Thanks Jim.

I have a lower priced test server with no live websites, so if I mess up, it's just another learning experience :slight_smile: Plan on wiping the O/S and reinstalling along with learning some things about security. Lots of trial and error, but I seem to learn best that way. It's a new world to me and I find it most intriguing.

Your mistake, above was when you tried to "cd home" You need to cd /home, because home was not relative to where you were. Your root user probably was in HIS home, which is /root. You need the preceding slash / before going to a non relative path (a place not in your current directory)

Ah, thank you, Mark. Just tried your suggestion...worked and makes things much clearer for me :slight_smile:

Appreciated

No problem. I would suggest you check out this site. It is a bit out of date, but about 90% of it should still give you what you need in order to be proficient in Linux usage.

http://rute.2038bug.com/rute.html.gz

Your browser should be able to expand this to straight HTML web pages.

Thanks again, Mark. I'm off this afternoon, so I will take a look. Yes, they expand to HTML pages.

Regards