Page 1 of 1

Change terminal directory

Posted: Mon Feb 24, 2014 3:16 pm
by GrandpaRobin
Have had Mint for a couple of months and I LOVE it! And it's FREE!

Anyway, the learning curve has been a little steep for me. I am taking a JAVA class and I save the exercises on my Google drive (using InSync). I'm doing good in the class (I used to write COBOL) but not so good learning Linux.

Is there some way to configure a terminal session to start in a particular directory? I can't find anything in profile preferences. I've tried to write a bash script (finally figured out how to and set execute permission) but it won't run cd or it won't recognize directories with spaces (i.e. "Google Drive"/"CIS 211") or I don't know how to format the command. I've spent a week trying to find an online tutorial I can understand but they all use terms I don't know yet. I'm still excited by Mint but I need a boost over some of the tyro hurdles. I know eventually I look back and say "DUH!". I know it's a stupid little thing but I'm tired of typing in the change every time.

Re: Change terminal directory

Posted: Mon Feb 24, 2014 4:25 pm
by karlchen
Hello, GrandpaRobin.

This here should be for you: Introduction to the commandline.
It is not as complicated as most people assume. And to a certain extent, it is all pretty logical.
Have fun!
Karl

Re: Change terminal directory

Posted: Mon Feb 24, 2014 4:37 pm
by karlchen
Hello, GrandpaRobin.

About ways to make a terminal open in a particular folder: Many ways lead to Rome. Here is one:
Use your favourite file-manager Nemo and navigate to the parent folder of the folder where you want the terminal window to open.
Example:
I want to open a terminal window in the folder ~/Downloads. ~/Downloads is the shorthand writing for /home/karl/Downloads.
So what I'll do is this:
  • Open Nemo.
  • Navigate to /home/karl or directly click on "Home Folder".
  • In the list of subfolders I select "Downloads" and right click it.
  • From the right-click context menu I select "Open in terminal".
  • VoilĂ , a terminal window opens and the command prompt proves, the current path is ~/Downloads. The $ sign is just the default command prompt for normal users.
These steps are convenient in all cases where I want to open terminal window in any folder which has just come up to my mind.

HTH,
Karl

Re: Change terminal directory

Posted: Wed Feb 26, 2014 8:26 pm
by GrandpaRobin
Thanks Karl! Two excellent suggestions! I thought 'start in terminal' was for executables. And I will definetly check out the command line reference.

Re: Change terminal directory

Posted: Fri Mar 21, 2014 9:08 pm
by grumpycrocodile
to change to my bin directory, from anywhere, i set an alias for p
alias "p"=cd\ ~/bin
seems to work so far, not sure if this is exactly what you want to do