Tuesday, May 7, 2024
4
rated 0 times [  4] [ 0]  / answers: 1 / hits: 9252  / 1 Year ago, thu, march 30, 2023, 3:45:52

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:somefoldersubfolder" 
@cmd.exe /K


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


More From » command-line

 Answers
4

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]
Name=MyTerminal
Comment=open terminal in /mnt/hgfs/somefolder
Icon=utilities-terminal
Exec=gnome-terminal --working-directory=/mnt/hgfs/somefolder
Terminal=false
Type=Application


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.


[#27061] Thursday, March 30, 2023, 1 Year  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
ligdesig

Total Points: 164
Total Questions: 106
Total Answers: 114

Location: Japan
Member since Sat, Jun 6, 2020
4 Years ago
;