Does Ctl-Alt-F1 kill X, or just put in background?
Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Does Ctl-Alt-F1 kill X, or just put in background?
First off, thanks to all the people that are smarter than me that post here - I've been using Fedora for about a month now, and have a game server, web server, file server, and all the basic apps running smoothly - thanks mostly to this forum and it's great members.
Now that the mushy stuff is out of the way...
I have looked but can't find a basic answer to this question...if I am in X Gui, when I hit ctl-alt-F1, does it kill the X gui, or is it still running in the background (and still using resources)?.
The reason I ask...I only have a 933mhz machine with 512 RAM, and want to use all the resources for running the above servers, and am learning how to do stuff from the shell so I don't use any of my computer's resources with the GUI.
So can I do ctl-alt-F1 to kill the gui, or is it better to change to init 3 and then back to init 5 when I want to work in the gui? Also, does it make a difference if I kill the gui as opposed to rebooting in init 3 when it comes to recovering available resources? (From all I have learned about how Linux uses resources I think the answer to this is no, but....not sure). Or is there an easier way to do it that I don't know about yet?
Ctrl-Alt-F1 merely switches to one of the other ttys.
By default Ctrl-Alt-(F1-F6) are the text based ttys, with X running on the 7th (Ctrl-Alt-F7)
If you are concerned with resources, it is far better to switch to runlevel 3 vs. simply killing X as there are other processes that start in support of the X environment.
Perhaps ideally you might want to change your default boot runlevel from 5 to 3:
Look for this line in /etc/inittab:
id:5:initdefault:
and simply change the 5 to a 3.
After doing so your machine will simply boot to a text based login. After you're logged in you can start X simply by typing 'startx', and when you log out of Gnome/KDE you'll be back to the text tty.
Distribution: openSuSE Tumbleweed-KDE, Mint 21, MX-21, Manjaro
Posts: 4,629
Rep:
You stop X with <Ctrl>+<Alt>+<Backspace>. Try that and list the processes still alive with ps -a (man ps ) or top. Then look at your free resources. (I have 700 MHz and 640 MB and use frequently three users with their separate GUIs with no problems).
Startx has more possibilities:
When you set initdefault 3 do e.g.
login as root
startx
(that gives root his default GUI under <Ctrl>+<Alt>+<F7>)
<Ctrl>+<Alt>+<F2>
login as user #1
startx -- :2
[with the blanks exactly as shown above]
(that gives user #1 his default GUI under <Ctrl>+<Alt>+<F8>)
<Ctrl>+<Alt>+<F3>
login as user #2
startx -- :3
[with the blanks exactly as shown above]
(that gives user #2 his default GUI under <Ctrl>+<Alt>+<F9>)
You can also change the GUI with the startx-command with something like
startx -gnomestart :3
but here I am not sure of the syntax.
An Ampersand at the end of the startx commands like
startx -- :3 &
will spawn the GUI as background job and you can use the text-terminal as usual without it being blocked by the startx command.
ctrl-alt-bksp actually crashes the X server, you should only do this as a last resort as opposed to using sys rq or pulling the plug out of the wall socket. Log off if you are ending your X session.
kill -9 would be about the same thing as ctrl-alt-bksp
init 3
That's a different story, it depends on your init scripts, how you started X in the first place, and what the runlevel is when you run startx. Also it would matter if you are using a login manager for X and are in runlevel 5.
It could very well do nothing at all.
People who get out of X would be better off starting up in runlevel three and using startx.
Just log off.
Last edited by DavidPhillips; 03-22-2004 at 09:23 PM.
I just saw this, which explains some more on using kill -9
Don't use kill -9.
It doesn't give the process a chance to cleanly:
1) shut down socket connections
2) clean up temp files
3) inform its children that it is going away
4) reset its terminal characteristics
and so on and so on and so on.
Generally, send 15, and wait a second or two, and if that doesn't
work, send 2, and if that doesn't work, send 1. If that doesn't,
REMOVE THE BINARY because the program is badly behaved!
Don't use kill -9. Don't bring out the combine harvester just to tidy
up the flower pot.
I don't know who wrote it, I found it here.. (with other stuff I'm guilty of)
I think I should have won the useless use of cat award a few times. For some unknown reason it seems like more fun to use `cat filename| less` than `less filename`. If you don't use cat you would not need a pipe.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.