Find the answer to your Linux question:
Page 1 of 2 1 2 LastLast
Results 1 to 10 of 14
How the heck do i change the directory in the terminal? I dont know if it is just different than it is in fc/rh but i know that in those ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Linux Newbie Van Halen Man's Avatar
    Join Date
    Sep 2006
    Location
    N. Canton Ohio
    Posts
    208

    Change Directory in Terminal?


    How the heck do i change the directory in the terminal? I dont know if it is just different than it is in fc/rh but i know that in those two it is ch /(directory) or somethin like that. When i press help and the list of all the possible commands comes up it says something like this for cd:
    Code:
    cd [-L] [-P] [dir]
    and i dont know what it means buy the -L and the -P some help would be great. Thanks.

  2. #2
    Linux Guru antidrugue's Avatar
    Join Date
    Oct 2005
    Location
    Montreal, Canada
    Posts
    3,211
    You can just use plain cd :
    Code:
    cd directory_name
    Try this tutorial for more command line tips :
    http://www.ee.surrey.ac.uk/Teaching/Unix/
    "To express yourself in freedom, you must die to everything of yesterday. From the 'old', you derive security; from the 'new', you gain the flow."

    -Bruce Lee

  3. #3
    Linux Enthusiast aysiu's Avatar
    Join Date
    Jul 2005
    Posts
    633
    cd changes directory.

    So let's say you want to go to /usr/bin. You type
    Code:
    cd /usr/bin
    Now you're in /usr/bin

    Or let's say you're in your home directory but now want to go one directory down to your desktop. You'd type
    Code:
    cd Desktop
    Notice how if you're going one directory down, you don't need the forward slash, but if you're changing to a totally different directory, you do.

  4. $spacer_open
    $spacer_close
  5. #4
    Linux Newbie Van Halen Man's Avatar
    Join Date
    Sep 2006
    Location
    N. Canton Ohio
    Posts
    208
    So if i am in the home folder and i want to go to another foler in there do i still need the "/"?
    and do i need "_" for spaces?

    and if i am already in the home folder do i still need the /home? or can i just continue from there without having to type it again?

  6. #5
    Super Moderator devils casper's Avatar
    Join Date
    Jun 2006
    Location
    Chandigarh, India
    Posts
    24,729
    i would suggest you to check www.linuxcommand.org first. you will learn a lot of stuff from there.







    Casper
    It is amazing what you can accomplish if you do not care who gets the credit.
    New Users: Read This First

  7. #6
    Linux Newbie Van Halen Man's Avatar
    Join Date
    Sep 2006
    Location
    N. Canton Ohio
    Posts
    208
    ok thanks i will take a look at this.

  8. #7
    Linux Enthusiast aysiu's Avatar
    Join Date
    Jul 2005
    Posts
    633
    Quote Originally Posted by Van Halen Man
    So if i am in the home folder and i want to go to another foler in there do i still need the "/"?
    and do i need "_" for spaces?

    and if i am already in the home folder do i still need the /home? or can i just continue from there without having to type it again?
    Well, it depends whether the folder you want to go to is inside the home folder or not.

    For example, let's say you're in /home/vanhalen and want to go to /home/vanhalen/music. In that case, you'd do
    Code:
    cd music
    If, however, you were in /home/vanhalen but wanted to go to /home/aerosmith, you'd have to do
    Code:
    cd /home/aerosmith

  9. #8
    Linux Newbie Van Halen Man's Avatar
    Join Date
    Sep 2006
    Location
    N. Canton Ohio
    Posts
    208
    I am not sure i see the difference between those 2. They are both in the home folder so why the slashes for aerosmiths folder?

  10. #9
    Banned
    Join Date
    Jan 2007
    Posts
    7
    the difference is where you are.
    If you are in /mystuff/sound/music/ any file/directory in there with you is directly available to you. So sub-directorys dont need the /.

    If you are in /sound/music/eddievh/ the contents of /music/ are no longer directly available so you need to give the address /mystuff/sound/music/ to the cd command - cd /home/mystuff/sound/music/

    you can also cd.. up as in DOS

  11. #10
    Linux Enthusiast aysiu's Avatar
    Join Date
    Jul 2005
    Posts
    633
    Well, you didn't start off in the /home folder, though. You started off in /home/vanhalen

    If you had started in /home, there would be no difference. You could do
    Code:
    cd vanhalen
    to get to /home/vanhalen or
    Code:
    cd aerosmith
    to get to /home/aerosmith

Page 1 of 2 1 2 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •