Jump to content

CD???


Sherpa
 Share

Recommended Posts

ok i know this may seem like a stupid question but...

lets say i was looking in my home directory and i have a .tar.gz file, so i open a terminal and cd, to my home directory, and then extract the file, then cd into the new dir that is made, right?

 

well what if i wanted to come out of the new directory and back to the home directory? would i have to retype the whole address? or is there a command that takes you back to the previous dir?

Link to comment
Share on other sites

I'm new to this so I think that the command that takes you back to your home directory is

 

cd ~/

 

and to back to the last directory is this

 

cd ../

 

Try both of them I think they just worked for me.

 

-Luis

 

P.S Hey Liquidzoo tell me if this info is right. :thumbs: I want to help people but I don't want to give the the wrong information, I read a Tutorial on command line. I just tried it and it works, post if anything is wrong with it or if there is another way :thumbs:

Edited by Luis101
Link to comment
Share on other sites

Those work for me... (but I don't use the slash).

$cd ..
$cd ~

I also like to use the <tab> key to auto complete the path. Say you have a folder named downloads in your home directory.

[user@localhost home]$cd dow<tab>

becomes

[user@localhost home]$cd downloads

Real handy for long names or those with spaces in them. Also confirms you got the path correct.

:D

Link to comment
Share on other sites

Perfect just what I wanted to hear, hope all this helps Sherpa. I wish I can help you on more of your posts but I'm new and learning so I can only help with the stuff that I know or have experience my self.

 

-Luis

Link to comment
Share on other sites

As said, "~" is $HOME, and ".." is parent directory.

One more usefull: "-" is previous directory. Example:

$ cd /usr/src/linux
$ pwd
/usr/src/linux
$ cd ~/Documents
$ pwd
/home/yves/Documents
$ cd -
$ pwd
/usr/src/linux
$ cd ../RPM
$ cd SRPMS
$ cd -
$ pwd
/usr/src/RPM

Link to comment
Share on other sites

Don't forget that you can use the UP ARROW key to go back to previous actions in a console and then press Enter again. It saves a lot of typing and remembering stuff.

 

Cheers. John.

Link to comment
Share on other sites

Yeah that TAB trick is great I just started using it and I can't tell you helpfull it is to install some of those tar.gz files. Instead of typing it and getting typos then I can just hit the TAB key and it puts it in for me, great trick too bad it didn't say anything about it that tutorial that I took on command line.

 

-Luis

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...