LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 06-17-2014, 05:47 PM   #1
coryromell
LQ Newbie
 
Registered: Jun 2014
Posts: 10

Rep: Reputation: Disabled
Linux lab questions help


Having issues with absolute and relative path changes in commands

Last edited by coryromell; 06-17-2014 at 06:28 PM.
 
Old 06-17-2014, 06:12 PM   #2
fang0654
Member
 
Registered: Oct 2003
Location: New York, NY
Distribution: Ubuntu
Posts: 110

Rep: Reputation: 28
I don't think anyone is going to do your lab for you!

If you need info to review the material, you can check out this:
http://linuxcommand.org/learning_the_shell.php
 
2 members found this post helpful.
Old 06-17-2014, 06:19 PM   #3
sag47
Senior Member
 
Registered: Sep 2009
Location: Orange County, CA
Distribution: Kubuntu x64, Raspbian, CentOS
Posts: 1,845
Blog Entries: 36

Rep: Reputation: 453Reputation: 453Reputation: 453Reputation: 453Reputation: 453
So, what do you need help with? What have you tried? You'll find most members on this forum will help you with the work but will not outright give the answer (myself included). Is there something in particular you're having trouble with?

SAM
 
Old 06-17-2014, 06:26 PM   #4
coryromell
LQ Newbie
 
Registered: Jun 2014
Posts: 10

Original Poster
Rep: Reputation: Disabled
I'm having trouble with the command line and how to put them in the correct order. like on the first question the to make it an absolute path name it would be /cd/home/etc
 
Old 06-17-2014, 07:15 PM   #5
sag47
Senior Member
 
Registered: Sep 2009
Location: Orange County, CA
Distribution: Kubuntu x64, Raspbian, CentOS
Posts: 1,845
Blog Entries: 36

Rep: Reputation: 453Reputation: 453Reputation: 453Reputation: 453Reputation: 453
Quote:
Originally Posted by coryromell View Post
I'm having trouble with the command line and how to put them in the correct order. like on the first question the to make it an absolute path name it would be /cd/home/etc
Please put up the original question as it was worded (as we work on the different parts). You're correct that /cd/home/etc is an absolute path. However the question was asking how do you *change directory* to the absolute path. Emphasis on the key words. What command in Linux will allow you to change directories? Imagine you had to change directory to /cd/home/etc on the terminal. How would you do that?

Last edited by sag47; 06-17-2014 at 07:18 PM.
 
Old 06-17-2014, 07:23 PM   #6
coryromell
LQ Newbie
 
Registered: Jun 2014
Posts: 10

Original Poster
Rep: Reputation: Disabled
1. Use an absolute path to change to the /etc/httpd/conf/ directory.
That was the original question

So since the directory is conf then it should be: /cd/home/etc/httpd.conf

And the relative path would be cd../../etc/httpd.conf
 
Old 06-17-2014, 07:26 PM   #7
sag47
Senior Member
 
Registered: Sep 2009
Location: Orange County, CA
Distribution: Kubuntu x64, Raspbian, CentOS
Posts: 1,845
Blog Entries: 36

Rep: Reputation: 453Reputation: 453Reputation: 453Reputation: 453Reputation: 453
Quote:
Originally Posted by coryromell View Post
1. Use an absolute path to change to the /etc/httpd/conf/ directory.
That was the original question

So since the directory is conf then it should be: /cd/home/etc/httpd.conf

And the relative path would be cd../../etc/httpd.conf
It's pretty much the same thing I said. Change directory are still the key words which can be used for google if in doubt. If the absolute path is /etc/httpd/conf then where do you get /cd/home/etc/httpd.conf? httpd.conf is typically a file, not a directory. You must have spaces in between the commands and the arguments.

So the directory is "/etc/httpd/conf/". What command is used to change directory and how would you use it to change the directory to /etc/httpd/conf/?
 
Old 06-17-2014, 07:38 PM   #8
coryromell
LQ Newbie
 
Registered: Jun 2014
Posts: 10

Original Poster
Rep: Reputation: Disabled
since that is the directory to change it to an absolute directory I would change it to /cd/home/etc/httpd/conf separating each command
 
Old 06-17-2014, 07:46 PM   #9
sag47
Senior Member
 
Registered: Sep 2009
Location: Orange County, CA
Distribution: Kubuntu x64, Raspbian, CentOS
Posts: 1,845
Blog Entries: 36

Rep: Reputation: 453Reputation: 453Reputation: 453Reputation: 453Reputation: 453
Quote:
Originally Posted by coryromell View Post
since that is the directory to change it to an absolute directory I would change it to /cd/home/etc/httpd/conf separating each command
No you seem to misunderstand the question. Since you're likely used to another OS that has a GUI perhaps I can shed some light on what the question actually means. Take for example you're using Windows Explorer to view a folder. Let's say for example you have Explorer opened to "C:\Users\myuser". You can see the files located inside that directory. Your current working directory is "C:\Users\myuser". Let's say you must change directory to "C:\Program Files\httpd\conf". That means you must browse to the root of the C: drive in Explorer, enter "Program Files", enter httpd, and then enter the conf folder. You have changed the directory from "C:\Users\myuser" to "C:\Program Files\httpd".

So what the question means by changing directory is by changing your current working directory to a new path. Let's pretend on Linux you're currently in "/home/user" but you want to change your current working directory to "/etc/httpd/conf". What command would you use to change the directory to "/etc/httpd/conf"? Hopefully that's clear enough. Hint: in the link fang0654 provided, the command is located under #2 "Navigation".

Last edited by sag47; 06-17-2014 at 07:48 PM.
 
Old 06-17-2014, 07:51 PM   #10
coryromell
LQ Newbie
 
Registered: Jun 2014
Posts: 10

Original Poster
Rep: Reputation: Disabled
oh ok i would then use cd/root/
 
Old 06-17-2014, 07:58 PM   #11
sag47
Senior Member
 
Registered: Sep 2009
Location: Orange County, CA
Distribution: Kubuntu x64, Raspbian, CentOS
Posts: 1,845
Blog Entries: 36

Rep: Reputation: 453Reputation: 453Reputation: 453Reputation: 453Reputation: 453
Quote:
Originally Posted by coryromell View Post
oh ok i would then use cd/root/
Incorrect, I'll take an example from this link. To change the directory using the full path to /usr/X11R6/bin you would use the following command.

Code:
cd /usr/X11R6/bin
To change the directory using the full path to /etc/httpd/conf/ what command would you use? Hint: I already gave you the answer in this post.
 
Old 06-17-2014, 07:59 PM   #12
coryromell
LQ Newbie
 
Registered: Jun 2014
Posts: 10

Original Poster
Rep: Reputation: Disabled
I would do cd /etc to change to the etc directory
 
Old 06-17-2014, 08:02 PM   #13
sag47
Senior Member
 
Registered: Sep 2009
Location: Orange County, CA
Distribution: Kubuntu x64, Raspbian, CentOS
Posts: 1,845
Blog Entries: 36

Rep: Reputation: 453Reputation: 453Reputation: 453Reputation: 453Reputation: 453
Quote:
Originally Posted by coryromell View Post
I would do cd /etc to change to the etc directory
Yes but your original question isn't asking you to change to the /etc directory.
 
Old 06-17-2014, 08:02 PM   #14
coryromell
LQ Newbie
 
Registered: Jun 2014
Posts: 10

Original Poster
Rep: Reputation: Disabled
so i would use cd /etc/httpd/conf
 
Old 06-17-2014, 08:03 PM   #15
sag47
Senior Member
 
Registered: Sep 2009
Location: Orange County, CA
Distribution: Kubuntu x64, Raspbian, CentOS
Posts: 1,845
Blog Entries: 36

Rep: Reputation: 453Reputation: 453Reputation: 453Reputation: 453Reputation: 453
Quote:
Originally Posted by coryromell View Post
so i would use cd /etc/httpd/conf
That is the correct answer to your first lab question. Do you understand why?
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: Black Lab Linux Education 4.2.5 and Black Lab Professional Desktop 4.2.5 released LXer Syndicated Linux News 0 03-10-2014 01:00 PM
LXer: Black Lab Enterprise Linux 4.2 and Black Lab Linux 4.2 for free download LXer Syndicated Linux News 0 01-23-2014 02:30 PM
LXer: FSF Compliance Lab online meeting addresses license questions LXer Syndicated Linux News 0 10-26-2007 04:40 AM
designing linux LAB cranium2004 Linux - Networking 2 11-19-2004 10:52 PM
Linux Redhat Lab Sarah Linux - Networking 1 02-27-2002 09:21 AM


All times are GMT -5. The time now is 04:13 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration