Sherpa Posted July 2, 2004 Report Share Posted July 2, 2004 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? Quote Link to comment Share on other sites More sharing options...
Jet2k5 Posted July 2, 2004 Report Share Posted July 2, 2004 (edited) 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. 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 Edited July 2, 2004 by Luis101 Quote Link to comment Share on other sites More sharing options...
scoopy Posted July 2, 2004 Report Share Posted July 2, 2004 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 Quote Link to comment Share on other sites More sharing options...
Jet2k5 Posted July 2, 2004 Report Share Posted July 2, 2004 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 Quote Link to comment Share on other sites More sharing options...
Sherpa Posted July 2, 2004 Author Report Share Posted July 2, 2004 thanks Luis ans scoopy the tab key is a great trick thanks..... Quote Link to comment Share on other sites More sharing options...
Jet2k5 Posted July 2, 2004 Report Share Posted July 2, 2004 Glad we can help! -Luis Quote Link to comment Share on other sites More sharing options...
theYinYeti Posted July 2, 2004 Report Share Posted July 2, 2004 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 Quote Link to comment Share on other sites More sharing options...
theYinYeti Posted July 2, 2004 Report Share Posted July 2, 2004 And I forgot: # cd ~/tmp # pwd /root/tmp # cd ~yves/tmp # pwd /home/yves/tmp # cd ~root/.mozilla # pwd /root/.mozilla Quote Link to comment Share on other sites More sharing options...
Qchem Posted July 2, 2004 Report Share Posted July 2, 2004 The usual default is that cd with no parameters will take you back to your home directory... Tips for the Uber-lazy Quote Link to comment Share on other sites More sharing options...
AussieJohn Posted July 2, 2004 Report Share Posted July 2, 2004 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. Quote Link to comment Share on other sites More sharing options...
Jet2k5 Posted July 2, 2004 Report Share Posted July 2, 2004 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 Quote Link to comment Share on other sites More sharing options...
bvc Posted July 2, 2004 Report Share Posted July 2, 2004 The usual default is that cd with no parameters will take you back to your home directory... Tips for the Uber-lazy that's me Quote Link to comment Share on other sites More sharing options...
iphitus Posted July 3, 2004 Report Share Posted July 3, 2004 For the even more lazy cd with no parameters, like so, will go to your home directory. now thats lazy :D Quote Link to comment Share on other sites More sharing options...
bvc Posted July 3, 2004 Report Share Posted July 3, 2004 is there an echo in here? :lol: iph....we just said that :unsure: Quote Link to comment Share on other sites More sharing options...
iphitus Posted July 3, 2004 Report Share Posted July 3, 2004 is there an echo in here? :lol: iph....we just said that :unsure: oooooooooops! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.