Change terminal directory

Forum rules
Before you post please read this

Change terminal directory

Postby GrandpaRobin on Mon Feb 24, 2014 3:16 pm

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.
GrandpaRobin
Level 1
Level 1
 
Posts: 2
Joined: Mon Feb 24, 2014 2:51 pm

Linux Mint is funded by ads and donations.
 

Re: Change terminal directory

Postby karlchen on Mon Feb 24, 2014 4:25 pm

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
User avatar
karlchen
Level 11
Level 11
 
Posts: 3772
Joined: Sat Dec 31, 2011 7:21 am

Re: Change terminal directory

Postby karlchen on Mon Feb 24, 2014 4:37 pm

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
User avatar
karlchen
Level 11
Level 11
 
Posts: 3772
Joined: Sat Dec 31, 2011 7:21 am

Re: Change terminal directory

Postby GrandpaRobin on Wed Feb 26, 2014 8:26 pm

Thanks Karl! Two excellent suggestions! I thought 'start in terminal' was for executables. And I will definetly check out the command line reference.
GrandpaRobin
Level 1
Level 1
 
Posts: 2
Joined: Mon Feb 24, 2014 2:51 pm

Re: Change terminal directory

Postby grumpycrocodile on Fri Mar 21, 2014 9:08 pm

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
grumpycrocodile
Level 1
Level 1
 
Posts: 1
Joined: Thu Jan 30, 2014 7:59 am


Return to Scripts & Bash

Who is online

Users browsing this forum: No registered users and 1 guest