D&C GLug - Home Page

[ Date Index ] [ Thread Index ] [ <= Previous by date / thread ] [ Next by date / thread => ]

Re: [LUG] New distro - and logging off

 

On 17/11/12 18:27, bad apple wrote:

Now I must think of the best way to short cut this so I don't have to
type all that out every time. (OK so I am lazy.)



Well, it's in your command history, so you could always just do CTRL+R
and retype part of the command: by the time you've typed as far as "shu"
or just "-h" or any other distinctive part of the line then bash will
find it and you can just hit return to execute it again. This of course
presumes that you both have a shell open and you're using bash/dash
instead of something more funky like tcsh. Or you could just set it up a
shortcut key as someone else mentioned.

I am using bash version 4.2.24


However, I'm not convinced this is a good idea: when you issue as a
privileged user (as root or via sudo/su) one of the various shutdown
commands, your box is going to unilaterally go down *immediately* with
no warnings, no second chances and no checks. Not a good time to realise
you didn't unmount a NFS share, or had an important SSH session still
connected, or an unsaved document or backgrounded jobs... Most modern
distros are doing helpful things behind the scenes as well, maybe
packagekit is grabbing the latest list of software updates for example.
When you choose to logout and shutdown from any decent desktop GUI, your
system is checking for stuff like unsaved files, shutting down services
nice and sanely, etc: what's not to like about that? Sure, I routinely
issue "shutdown -hP now" on my boxes but I'm not exactly your typical
user and even so, I rotate through all my workspaces first and manually
check I've not left anything unsaved or remote sessions logged in and so
on. And who cares if your box takes 60 seconds to shut down from the
menu? I can definitely understand people wanting to shave every last
possible second off booting *up* because you're sat in front of your
machine with the first coffee of the day and you want to get started as
soon as possible, but shutting down? Surely at that point, you're done
with it so you click the shutdown icon and then just walk away from it.
Clicking the shutdown icon definitely takes less time than starting a
shell (Neil, you don't strike me as the type of guy who usually even has
a shell open!),

I do use the terminal quite often, I was brought up using DOS so I am quite happy typing in commands.

 typing your manual shutdown command and entering a sudo
password! Once the process has started, who cares if it takes 5 or 50
seconds, you're already walking away.

I have been wondering just this. I am not so much worrying about the 55 secs or so it is taking to shut down. I am wondering just what the machine is doing all that time. And how I can find out, it may be something that needs to be sorted out.


Fair play about being lazy though - all good computer users are lazy: we
automate everything, so we never have to waste effort duplicating it
later. For the same reason I always modify my .bashrc HISTORY entries to
retain a *massive* amount of my history (basically, all of it) so I
barely ever have to waste time remembering some complicated stanza from
three years ago: just good old CTRL+R or hgrep (which I've aliased to
"history | grep -i ", again in .bashrc) and I've instantly got it back
again. I hate having to retype stuff - I'm lazy too!

Cheers


Thanks yet again for all your help,

Neil

--
The Mailing List for the Devon & Cornwall LUG
http://mailman.dclug.org.uk/listinfo/list
FAQ: http://www.dcglug.org.uk/listfaq