Wednesday, November 17, 2010

Changing directory on linux?

http://www.keegy.co.uk/?p=54



Im trying to follow the instructions given in the link ago, and after downloading the package i extracted it to Desktop. How do I now change this to my directory?

$ cd Desktop/drivers

I thought it would be the above command line but it's not :-(Changing directory on linux?
Well, have you tried just ';cd ~/Desktop';? You don't say what directory you're starting in, so adding the ';~/'; starts in your HOME.



Why not install into another directory?Changing directory on linux?
you have to list the full path of the directory you are switching to. But since desktop is in your home folder there is a shortcut you can use. In the terminal ~ stands for the path to your home folder so the command you would use is cd ~/Desktop/drivers. I hope this helps.
With Unix you have to remember to have the exact path to the folder you want to access. There are shortcust you can use though:

~ =%26gt; this is your home directory (usually /home/%26lt;username%26gt;)

. =%26gt; the current directory your in

.. =%26gt; The parent directory to the directory your in



So using your Desktop example above, you need to use the command $ cd ~/Desktop/drivers or $ cd /home/%26lt;username%26gt;/Desktop/drivers or $ cd ./Desktop/drivers . remember that unix is case sensitive so you have to make sure the Desktop folder is named ';Desktop'; or ';desktop'; and you use the appropriate one.



A time saving trick is to use the Tab button to auto-complete commands and locations. Any time you press Tab and there is an obvious answer to what you want to put in, Linux will enter that for you. So in the above is you type in $ cd Desk and then hit Tab it should auto-complete to $cd Desktop/ . You can then type in $ cd Desktop/driv and hit Tab to get $ cd Desktop/drivers/ .

No comments:

Post a Comment