Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a ubuntu running in vmware, and the folder is mnt/hgfs/somefolder (shared folder from VMWARE).

How can i create a shortcut to open a terminal with this path (mnt/hgfs/somefolder) without need to type everytime cd mnt/hgfs/somefolder?

on windows I use a file somefile.bat with this code:

@cd /d "z:\somefolder\subfolder" 
@cmd.exe /K

It is possible to add some arguments to open in root mode?

share|improve this question
up vote 3 down vote accepted

The command to open a terminal in a specific folder is

gnome-terminal --working-directory=/path/to/folder

One can create a .desktop file containing the following details to have a shortcut for this,

[Desktop Entry]
Comment=open terminal in /mnt/hgfs/somefolder
Exec=gnome-terminal --working-directory=/mnt/hgfs/somefolder

Give it execution permission, as

chmod +x /path/to/MyTerminal.desktop

It will create a shortcut named MyTerminal, now double click on it to open a terminal in your desired location.

share|improve this answer
To be root at that location use sudo su in the terminal. – souravc Feb 11 '14 at 14:24

Open the .bashrc file ,

gedit .bashrc

Add the below line at the bottom of the file and then save it,

cd /mnt/hgfs/somefolder

Then source the .bashrc file to work,

source .bashrc

Now whenever you open the terminal,it directly cd(goes) into the /mnt/hgfs/somefolder directory.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.