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'm trying to update my APT sources list in terminal by using gedit. My question is once I reach this point I need the command prompt "root@bt:/ect/apt#" back. the line is just blank. How do I recall this line of code?

root@bt:~# cd
root@bt:~# cd /etc/apt/
root@bt:/etc/apt# ls
apt.conf.d     sources.list     sources.list.d     trusted.gpg
preferences.d  sources.list~  trusted.gpg~
secring.gpg  trustdb.gpg        trusted.gpg.d
root@bt:/etc/apt# gedit sources.list

I have tried googling this and I also checked the help file and I cant find anything on this. Any help would be appreciated.

share|improve this question
When you mean 'blank' you mean that you are typing and there is no text showing as input? – Rrjrjtlokrthjji Jun 19 '13 at 18:56
What do you see after Gedit has been closed? Have you tried hitting the Enter key? And what does Ctrl+C give you? – gertvdijk Jun 19 '13 at 19:00
Not to be that guy, but you are better off not operating as root. Stay as normal user, and when you have to do something as root, use sudo. Sounds trivial, but can save you a world of hurt in the future, trust me. – Drake Clarris Jun 19 '13 at 19:28

If you append a & at the end of the line for example

gedit somefile &

Then you are editing somefile but gedit is running in the background so you get your command prompt back before you close gedit

terminal image

you will notice that a number is returned in this case 2388. That's the taskID of the instance of gedit that is running.

If you close the terminal you will kill the running gedit as its a child process of the terminal so you need to keep the terminal open until you have finished editing but you can run other commands.

If you want to close the terminal however you can break the link using the disown command with the number that was returned. In this case

disown 2388

You can now close the terminal if you wish and gedit will keep running.

Note: this does not only apply to gedit it works with all programs regardless as to if they have a GUI or not

share|improve this answer

The shell is waiting for gedit to return. If you want to tell the shell to not wait at this point you can ctrl + z to background gedit (which "freezes it), to "unfreeze" gedit, you'd have to run the command "fg" on the prompt you just got back.

In the future you can also launch programs without waiting for them to return, by running "command &". For example, "gedit /etc/apt/sources.list &", will get you gedit without monopolizing your shell.

share|improve this answer
This was edited to read "fg" instead of "bg", both are bash builtins, but they operate differently. fg will return you to the situation in which you were originally, bg will "unfreeze" your program (gedit in this case), while leaving you with your terminal. – Joe Jun 20 '13 at 2:40

The Termninal won't return to root@bt:/etc/apt# until you close the running process. Which in this case is Gedit.

After saving your changes close Gedit and your terminal will return to how it appeared beforehand.

Before closing Gedit: enter image description here

After closing Gedit: enter image description here

share|improve this answer

If you press Ctrl + C This should close any running processes.

share|improve this answer
True, but it can lose your work in some cases, so use with caution with gedit, e.g.. – belacqua Jun 19 '13 at 19:58

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.