6

My terminal always opens in home directory no matter where I open it. I also tried opening another terminal in the different directory but it's not working

gnome-terminal --working-directory=Downloads
gnome-terminal --working-directory Downloads
gnome-terminal --working-directory /home/avil/Downloads

I have also reinstalled both open in terminal extension and gnome-terminal but it's still not workingenter image description here

  • https://vitux.com/how-to-open-folders-in-ubuntu/ outlines multiple ways to do that. – K7AAY Nov 11 '19 at 22:41
  • thanks for the reply but that's not what I m asking I know how to change directories I am asking My terminal is not opening in the directory in which iam currently in nautilus. For eg I am in Download folder I choose open in terminal from context menu terminal will open in home directory – aviral dobhal Nov 12 '19 at 04:20
  • 1
    Try passing full pathname, e.g. /home/avil/Downloads. (Note that if you use the shorthand ~/Downloads then you need to replace the preceding = sign with a space because bash doesn't perform tilde-expansion after the equals sign.) – egmont Nov 12 '19 at 09:12
  • @egmont it's not working in either way I have ubuntu in my VM and its works! but I don't know why it's not working here. – aviral dobhal Nov 12 '19 at 13:45
  • do you have cd ~ or similar in your .bashrc ? – pLumo Nov 12 '19 at 15:05
  • @pLumo I don't have cd ~ in my .bashrc – aviral dobhal Nov 13 '19 at 13:34
  • I am also in 19.10, but I do not have this problem. Did you try something simple like this: gnome-terminal --working-directory=/ – FedKad Nov 20 '19 at 16:20
  • yes it did not worked – aviral dobhal Nov 21 '19 at 14:11
  • If the directory / works, but /home/avil/Downloads does NOT, there may be a permission problem. Are you sure that the directory Downloads exists? Please paste ls -dl ~/Downloads output. – FedKad Nov 21 '19 at 14:30
  • @FendonKadifeli /also didnt work and Download has permission of rwx-rx-rx so it has permission – aviral dobhal Nov 22 '19 at 15:03
  • @starkus nautilus . and nautilus .. is working fine for me its opening in correct directory. I will try to debug the terminal thanks for the answer – aviral dobhal Nov 22 '19 at 15:05

5 Answers5

3

First launch terminal go to Edit -> Profile Preferences -> Command and uncheck the option saying Run a custom command instead of my shell. It will not working with Desktop, but if you're browsing the Desktop as a folder inside nautilus, it will works fine.

Tejas Lotlikar
  • 2,945
  • 5
  • 17
  • 26
1

I don't have this problem with Ubuntu 16.04 and only have 19.04 installed on another partition which I haven't upgraded to 19.10 yet to test.

Your problem does sound like this one though:

Please read the entire Q&A but to summarize the answer:

You need to install gnome-terminal-nautilus or create a custom script.

Then the follow up answer:

ok, solved, I have change execute command in profile in to gnome-shell. Not very intuitive

  • hi thanks for reply but this didn't work for me. 1 Unable to locate package gnome-terminal-nautilus and i have also done the steps but its still not working – aviral dobhal Nov 18 '19 at 13:21
1
  • Open terminal
  • Go to Preferences
  • To your profile of the terminal(if you don't have any, create one)
  • In the menu of profile go to Command
  • Preserve working directory make it Always This fixed for me. Check the picture for more details.

If you want to open terminal in folder with command keys than :
shift + F10 E
or
Right click with mouse than press E

enter image description here

0

According to this answer How to add "Open terminal here" to Nautilus' context menu?

If you have a up to 15.04 Ubuntu distro version you have to install nautilus-open-terminal package. In my 19.10 Ubuntu I can't find it, though, because it is already included since version 15.10.

You could also try to reinstall nautilus, after updating your system, if you have a newer distro with sudo apt install --reinstall nautilus command.

thiggy01
  • 431
0

There's an "Open in Terminal" command in the context menu of any folder in Nautilus. Right-click on the folder and choose the Open in Terminal option (between Revert to Previous Version... and Star.

ox15
  • 41