Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Stuck in Terminal Sessions!!

Okay, I've created this crazy situation where I've logged in (is that the right terminology? I'm such a noob at all this!), over and over again, as myself - 5 times now in fact. I didn't know how to exit the first load of sessions at the time, and so they're still all running and I just want to be done with them now!

To make this clearer, things look something like this:
23:47 up 12:40, 5 users, load averages: 0.10 0.12 0.11

then, we've got:
USER TTY FROM LOGIN@ IDLE WHAT
(myusername) console - (time) (time) -
(myusername) p1 - (time) - w
(myusername) p2 - (time) (time) -
(myusername) p3 - (time) (time) -
(myusername) p4 - (time) (time) -

Joke, huh? It's all me, all messing around, I'm not using FTP or SHH or anything like that, I just wanted to have a look at the Terminal. And now I've done this. How do I get out of it?

Also, there's no way no one else can hack all these 'me's', is there? I've got my firewall up and no sharing has been switched on.

Thank you ever so much (in advance) for any help you can give!

iMac, Mac OS X (10.4.11)

Posted on Feb 15, 2011 4:39 PM

Reply
8 replies

Feb 16, 2011 3:28 AM in response to Trueblue222

Welcome to the Apple Discussions.

Probably a reboot like Limnos suggests will clear things, however, what do you mean by "Stuck in Terminal Sessions"? Did you open a Terminal from Utilities? Is that what you are stuck in? If so, at the prompt, type exit and you will leave the terminal. If you are in the terminal, and it is showing the statements you listed, you can stop them one at a time by typing +kill -9 p4+ and just change from p4 to p3 to p2, and kill each process that way.

But a restart of the computer is very effective at terminating all processes that have been started when things get hung up and you are not sure of what you are doing.

Feb 16, 2011 1:29 PM in response to Ralph Landry1

@ Limnos: Ahh....that's interesting, they have all disappeared (I did as suggested, and restarted).

The reason I thought they wouldn't is this:

The day before yesterday, I set up 2 different sessions by accident (and so was told there were 3 users), and then, yesterday, when I went back into Terminal, it told me there were still 3 users. Obviously that gave me the impression these sessions were stuck with you!

Let me show you what came up yesterday morning when I came into Terminal to make what I've said more clear:

23:46 up 12:24, 3 users, load averages: 0.57 0.63 0.06
(username) console - 11:23 12:33 -
(username) 1 - 23:46 - w
(username) 2 - 14:59 8:46 -

What was going there...?

You can see evidence of this session-having-continued-from-the-night-before in my first post - the '23:47 up 12:40, 5 users, load averages: 0.10 0.12 0.11' part. Obviously '23:47' was from the day before, and I had since moved into a new day...Why didn't that extra session end when I shutdown and started my mac the next day?

@ *Ralph Landry1*: I did open a Terminal from Utilities, and lol, sorry my question was in any way unclear. I wasn't actually 'trapped' inside the prog, simply I didn't know how to end the, er, 'statements'. Thank you so much for telling me how to kill them off now, that's perfect! 🙂

Also - of great interest - where all those 'unresolved' sessions a security threat, do you know? (Firewall up and no sharing on as mentioned).

Thanks ever so much, everyone 🙂

Feb 16, 2011 2:03 PM in response to Trueblue222

Also - of great interest - where all those 'unresolved' sessions a security threat, do you know? (Firewall up and no sharing on as mentioned).


No. Not unless you were using Terminal, perhaps, for a telnet connection, which I don't think you were. Why are you thinking this has anything to do with security? Simply logging in to Terminal and leaving the session open wouldn't do anything. And, most things you might do in Terminal wouldn't either.

Feb 16, 2011 2:29 PM in response to WZZZ

@ wzzz: oh thank you so much, that's totally cleared that one up. No, definitely was not a telnet connection (just had to Google that to learn what it is, tbh), just trying to learn more about my computer. I can see now that was a bit of a silly question... ^^; which was kind of you to answer!

Hopefully the final 'why-didn't-shutting-down-kill-the-previous-session' mystery will be able to be solved, then all will be well...

While I'm at it, just want to thank *Ralph Landry1* for the welcome too, I'm really glad I came because this question/questions had been bugging me all day. And I'd been doing a lot of research on the matter of terminals as well...of course, as you've no doubt gathered, at a totally basic level.

Feb 16, 2011 3:52 PM in response to Trueblue222

Be careful using Terminal. You can probably do far more damage of the self inflicted kind using Terminal than from any of the known security threats. If you want to explore it, use only the most thoroughly vetted commands, and then only copy/paste them in; typos can be disastrous. Watch out, especially, using anything that requires rm (remove/delete -- no second chances with that one) or sudo, which gives you unfettered access to the System.

Feb 17, 2011 3:25 PM in response to WZZZ

Thanks for the warning, wzzz; as it is, I couldn't agree more. I've read plenty of cases where people have monkeyed up their systems with Terminal, so wouldn't dream of attempting to manage my mac through that means myself (leave that to the pros). I just wanted to check out what was going on with my network and the like - then leave it be.

I suppose the whole 'why didn't Terminal start again from scratch the next day' thing isn't important, just curious - maybe I'll have to put it down to the quirks of computers or something like that...

Feb 18, 2011 3:30 AM in response to Trueblue222

If you are truely curious about the inner workings of the operating system, I would encourage you to learn more about use of Terminal...actually the only way I interact with my Mac OS's...but to use Terminal effecively you need to get some basic knowledge of Unix. There are chapters on Unix commands in many of the manuals on Mac OS X...including the Missing Manual on Tiger. The Darwin kernel used by Mac OS X was brought over to Apple by Steve Jobs when he returned to the company. Darwin is the kernel from NeXT that he founded while outside Apple. Darwin is a FreeBSD kernel, aka Unix.

When you are operating in Terminal, you can use the full set, or almost the full set, of Unix commands which gives you a great deal of power over the system. Doing that gives you direct access and communication with the kernel, the heart of the operating system.

If this interests you, take the time to learn the basic Unix commands and how to use them. And don't worry too much about using commands like rm since the default configuration is interactive mode, i.e., it will ask you if you really want to remove before it does so. Unless you say rm -i, it will default to interactive. So never give any command with the opeator -i unless you are really sure of yourself and what you are doing at command level.

Ralph

Stuck in Terminal Sessions!!

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.