gnome terminal: YASN (yet another stoopid newbie)

hi all,

at long last i’ve finally got a NIX environment…yipee! Installed opensuse 11.2 in a dual boot with windoze with no problem whatsoever.

unfortunately, my NIX skills are sadly dated or maybe things have changed or both. in any case, i have a rather trivial problem that i have not been able to figure out.

i go to gnome terminal to get to the bash shell, no problem except when i do things like cat, less and so on. the commands do what they do then when done the last line output is “some text” and “(END)” - at the completion of the command it does not return to the bash shell. i’ve tried ctrl-everything, enter, escape, actually all keystrokes i can think of to get back to the bash shell…no luck. man and docs have not been helpful or i simply missed the answer (i’m a little saturated at this point).

the only thing i’ve been able to do to solve my dilema is close the terminal an start a new instance, not elegant but works.

could anyone help make this stoopid newbie be a little more elegant?

tia!

I think you’ve got us confused. If you open a G-terminal, do you see a prompt like:


yourusername@yourcomputername:~>

If not, something is terribly wrong.

Post some output from your terminal window.

It depends. I find that for some things Ctrl+c goes back to the shell, for others it’s Ctrl+z, and even Ctrl+x I think…

For instance, with “man” Ctrl+z goes back to the shell (after, say, “man zypper”).

Good point twelveeighty, my post was not of the best form.

Okay, let’s walk through a example of my difficulty. First, I open Gnome Terminal and the result is the expected shell prompt as follows:

warren@linux-frl2:~>

So let’s do a simple pwd command:

warren@linux-frl2:~> pwd
/home/warren
warren@linux-frl2:~>

Everything works as expected, pwd gives the working directory and returns to the shell prompt.

Now let’s look at my problem, for example, viewing the contents of the GRUB menu.lst file with less (or cat). Since this file is owned by root let’s go there:

warren@linux-frl2:~> su -l
Password:
linux-frl2:~ #

Okay, now I have the powers of the universe so I next less on menu.lst as follows:

Modified by YaST2. Last modification on Mon Mar 15 22:44:33 EDT 2010

THIS FILE WILL BE PARTIALLY OVERWRITTEN by perl-Bootloader

Configure custom boot parameters for updated kernels in /etc/sysconfig/bootloa

der

default 0
timeout 8
gfxmenu (hd0,0)/message

###Don’t change this comment - YaST2 identifier: Original name: linux###
title openSUSE 11.2 - 2.6.31.5-0.1
root (hd0,0)
kernel /vmlinuz-2.6.31.5-0.1-default root=/dev/disk/by-id/ata-WDC_WD5000AAKB
-00H8A0_WD-WCASY8802778-part6 resume=/dev/disk/by-id/ata-WDC_WD5000AAKB-00H8A0_W
D-WCASY8802778-part2 splash=silent quiet showopts vga=0x31a
initrd /initrd-2.6.31.5-0.1-default

###Don’t change this comment - YaST2 identifier: Original name: failsafe###
title Failsafe – openSUSE 11.2 - 2.6.31.5-0.1
root (hd0,0)
kernel /vmlinuz-2.6.31.5-0.1-default root=/dev/disk/by-id/ata-WDC_WD5000AAKB-00H8A0_WD-WCASY8802778-part6 showopts apm=off noresume nosmp maxcpus=0 edd=off powersaved=off nohz=off highres=off processor.max_cstate=1 x11failsafe vga=0x31a
initrd /initrd-2.6.31.5-0.1-default

###Don’t change this comment - YaST2 identifier: Original name: windows###
title Windows
map (hd1) (hd0)
map (hd0) (hd1)
rootnoverify (hd1,0)
makeactive
chainloader +1

###Don’t change this comment - YaST2 identifier: Original name: floppy###
title Floppy
rootnoverify (hd0,0)
chainloader +1
/boot/grub/menu.lst lines 12-32/32 (END)

less does what it is suppose to an lists the file page at a time. Where I get stuck is how to get back to the shell prompt when the file has been listed, that is, at the line:

/boot/grub/menu.lst lines 12-32/32 (END)

Now, while doing this example, I inadvertanly found the solution - type ctrl-z and I get back to the shell prompt (thanks to elkikin’s reply jogging the cobwebs in the memory).

So now I need to reframe my question but it is basically the same issue. My last contact with the UNIX environment was 1996 so no doubt some things have changed. My recollection is that there was no consistency in the various shell commands in terminating or exiting programs such a less and cat (and others) back to the shell prompt. Is this true?

My first response to difficulty was the less man page which was not helpful. Then the various docs on the system with still no help. A quick google did not help. So the question becomes where can I look in general for this information?

With elkikin’s help ctrl-z has returned from the fog of years. I do recall the somewhat universal kill command: ctrl-c. Also recall a lot of ctrl-d, ctrl-x, and ctrl-something usage but for what…hmmm.

What I’m asking is very elementary shell stuff but I have not found any comprehensive resource, or even resource, on the subject. Any pointers?

Thanks.

Here’s a handy list of bash hotkeys: Keyboard Shortcuts for Bash ( Command Shell for Ubuntu, Debian, Suse, Redhat, Linux, etc) - How-To Geek

And here’s a more thorough guide: Guide to Linux File Command Mastery

It seems that besides Ctrl+z, simply pressing “q” also exits back to the shell from processes such as “less” or “man”.

Hope it helps.

just hit q (as in quit) when you see boot/grub/menu.lst lines 12-32/32 (END), this also works for man and more. :slight_smile:

edit: oops, elkikin already said that.

Thanks elkikin and Xilanaz, exactly what I was looking for!

Another tip: a lot of commands like less, more, etc., you hit the ‘h’ or ‘?’, you get a set of help commands.

If everything else fails, use Ctrl-C. Not to be confused with “clipboard-copy” Ctrl-C - which is typically Shift-Ctrl-C in a terminal.

You also would want to get familiar with the *nix way of highlight-yank-paste: highlight some text in a terminal window (not executing a ‘less’ or any other command), and then middle-Click or right-click your mouse - whatever text you had selected gets pasted to where the cursor is.

On Thu, 18 Mar 2010 01:06:01 GMT, fosdex <fosdex@no-mx.forums.opensuse.org> wrote:

>
>hi all,
>
>at long last i’ve finally got a NIX environment…yipee! Installed
>opensuse 11.2 in a dual boot with windoze with no problem whatsoever.
>
>unfortunately, my NIX skills are sadly dated or maybe things have
>changed or both. in any case, i have a rather trivial problem that i
>have not been able to figure out.
>
>i go to gnome terminal to get to the bash shell, no problem except when
>i do things like cat, less and so on. the commands do what they do then
>when done the last line output is “some text” and “(END)” - at the
>completion of the command it does not return to the bash shell. i’ve
>tried ctrl-everything, enter, escape, actually all keystrokes i can
>think of to get back to the bash shell…no luck. man and docs have not
>been helpful or i simply missed the answer (i’m a little saturated at
>this point).
>
>the only thing i’ve been able to do to solve my dilema is close the
>terminal an start a new instance, not elegant but works.
>
>could anyone help make this stoopid newbie be a little more elegant?
>
>tia!

Well you have hit one of the things that have changed, to terminate less
(and by concatenation man) you use the “Q” key (shift may not matter).
While i would not write a file with cat it still terminates on control-z.
The old editors sed, vi, and emacs are all still with us. Though if i had
a GUI running i would likely run kate or similar to edit things like
/etc/fstab.

HTH

Now let’s see what others had to say.