LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 09-21-2014, 09:57 PM   #1
Wyght
LQ Newbie
 
Registered: Sep 2013
Location: Canada
Distribution: Mint 14 (want to learn Debian)
Posts: 7

Rep: Reputation: Disabled
Pipe ¨ NOT | why?


Hi

I am trying to learn how to use the Terminal, I am learning how to cat .txt files. I read that if the .txt file is large enough that it scrolls off the page you can pipe the output.

Code:
    cat doc.txt | more
which will only print one screen full and you hit enter to get the next screen of text until finished. My problem is when I use the "|" or pipe key while in
Mint 17 terminal this character ¨ is printed to screen, which of course will not work. If I use gedit 2.30.4 to type in cat doc.txt | more copy that
and paste in Terminal this is what is pasted cat doc.txt ¨ more

Can anyone tell me what I am doing wrong or where to go to read what I am doing wrong.

Thanks
 
Old 09-21-2014, 10:19 PM   #2
btmiller
Senior Member
 
Registered: May 2004
Location: In the DC 'burbs
Distribution: Arch, Scientific Linux, Debian, Ubuntu
Posts: 4,284

Rep: Reputation: 371Reputation: 371Reputation: 371Reputation: 371
Sounds like you have an incorrect keymap set up somewhere, but it's odd that it just happens in the terminal and not in gedit. Which terminal emulator are you using? Does it have a settings menu where you can select keyboard mapping?

BTW, in your case (just viewing a single file), you can simply type:

Code:
more doc.txt
or even better

Code:
less doc.txt
 
Old 09-21-2014, 10:46 PM   #3
sgosnell
Senior Member
 
Registered: Jan 2008
Location: Baja Oklahoma
Distribution: Debian
Posts: 1,054

Rep: Reputation: 276Reputation: 276Reputation: 276
Sounds like you might have either an incorrect keyboard layout or non-standard keymapping. I don't know what the UK keyboard layout gives for |, possibly | or perhaps something else. I know there are several keys that are different from the US layout, as are many other layouts. And it's also possible to map any key to practically any character.
 
Old 09-21-2014, 10:53 PM   #4
Wyght
LQ Newbie
 
Registered: Sep 2013
Location: Canada
Distribution: Mint 14 (want to learn Debian)
Posts: 7

Original Poster
Rep: Reputation: Disabled
Quote:
BTW, in your case (just viewing a single file), you can simply type:

Code:
more doc.txt
or even better

Code:
less doc.txt
Thanks for this idea, I tried it and it works great. As for the type of Terminal, I don't know how to find out as there is no menu, no name nothing really other than a frame and text area. It is the one that Mint 17 automatically installs. It is weird that the | only messes up in that Terminal it works here fine and in gedit.

Thanks again
 
Old 09-21-2014, 10:58 PM   #5
Wyght
LQ Newbie
 
Registered: Sep 2013
Location: Canada
Distribution: Mint 14 (want to learn Debian)
Posts: 7

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by sgosnell View Post
Sounds like you might have either an incorrect keyboard layout or non-standard keymapping. ... I know there are several keys that are different from the US layout, as are many other layouts. And it's also possible to map any key to practically any character.
My keyboard layout is English US using same layout for all windows, the pipe '|' key works on everywhere else even on gedit.

Where do I learn to map a key to a specific key?

Thanks
 
Old 09-22-2014, 12:58 AM   #6
pan64
LQ Guru
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 8,651

Rep: Reputation: 2501Reputation: 2501Reputation: 2501Reputation: 2501Reputation: 2501Reputation: 2501Reputation: 2501Reputation: 2501Reputation: 2501Reputation: 2501Reputation: 2501
there are several ways, but first would be nice to know the real name of that terminal emulator.
 
Old 09-22-2014, 01:07 AM   #7
Wyght
LQ Newbie
 
Registered: Sep 2013
Location: Canada
Distribution: Mint 14 (want to learn Debian)
Posts: 7

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by pan64 View Post
there are several ways, but first would be nice to know the real name of that terminal emulator.
GNOME Terminal 3.6.2

turns out there is a menuBar, its turned off by default and I did not check. OS is Mint 17 Cinnamon 64 bit
 
Old 09-22-2014, 02:31 AM   #8
pan64
LQ Guru
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 8,651

Rep: Reputation: 2501Reputation: 2501Reputation: 2501Reputation: 2501Reputation: 2501Reputation: 2501Reputation: 2501Reputation: 2501Reputation: 2501Reputation: 2501Reputation: 2501
in gnome terminal there is a menu Terminal->Set character encoding-> choose what you want or you can add additional sets
 
Old 09-22-2014, 02:18 PM   #9
sgosnell
Senior Member
 
Registered: Jan 2008
Location: Baja Oklahoma
Distribution: Debian
Posts: 1,054

Rep: Reputation: 276Reputation: 276Reputation: 276
I don't run gnome, and I can't recall the keyboard mapping methods there. Google should find it, if your Google Foo is good enough.
 
Old 09-22-2014, 03:56 PM   #10
suicidaleggroll
LQ Guru
 
Registered: Nov 2010
Location: Colorado
Distribution: OpenSUSE, CentOS
Posts: 5,396

Rep: Reputation: 2017Reputation: 2017Reputation: 2017Reputation: 2017Reputation: 2017Reputation: 2017Reputation: 2017Reputation: 2017Reputation: 2017Reputation: 2017Reputation: 2017
I use GNOME Terminal on my system with the character encoding set to "Unicode (UTF-8)", and everything works well.
 
Old 09-22-2014, 05:39 PM   #11
Smokey_justme
Member
 
Registered: Oct 2009
Distribution: Slackware
Posts: 534

Rep: Reputation: 203Reputation: 203Reputation: 203
Since "|" is well in the first 127 ASCII characters, most likely the terminal is set to use stuff like UTF-16 or some weird encoding.. Switch anything you find in the terminal emulator settings about character encoding to UTF-8 (as someone already said above) and everything should work again... Weird that this happend by default...
 
Old 09-22-2014, 08:35 PM   #12
Fred Caro
Member
 
Registered: May 2007
Posts: 999

Rep: Reputation: 166Reputation: 166
On uk quatry keyboard pipe is above the \ symbol; on a us keyboard layout(software
) it is often elsewhere, especialy if the pc is meant for the uk. You could try pluging in a USB keyboard and see if that gives you different results. The pipe key results seems to differ more than most.

Fred.
 
Old 09-23-2014, 02:08 AM   #13
Beryllos
Member
 
Registered: Apr 2013
Location: Massachusetts
Distribution: Debian
Posts: 316

Rep: Reputation: 123Reputation: 123
Could it be due to the font?

I have gnome terminal 3.4.1.1 in which I can select the display font (in the menu, Edit -> Profile Preferences, then select the General tab). Currently a check box is checked to "Use the system fixed width font." If I uncheck that, I can select another font. If I wished to change it, I would choose a monospace font. Courier is a monospace font. Other monospace fonts usually have "Mono" in the name.

Since you know it displays correctly in gedit, you should also inspect which font is used in gedit (in the gedit 3.4.2 menu, Edit -> Preferences, then select the Font & Colors tab). In my gedit preferences, the checkbox for "Use the system fixed width font (Monospace 11)" is checked. If I uncheck it, I can choose another font.

By the way, the title of your thread reminds me of this painting:
Click image for larger version

Name:	300px-MagrittePipe.jpg
Views:	8
Size:	10.8 KB
ID:	16492
The Treachery of Images, by RenÚ Magritte
in which it is written "This is not a pipe."

(click on image to magnify it)

Source: http://en.wikipedia.org/wiki/The_Treachery_of_Images

Last edited by Beryllos; 09-23-2014 at 02:21 AM. Reason: added reference to art
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to ignore Pipe in Pipe delimited file? rohit_shinez Programming 29 08-13-2013 11:53 PM
[SOLVED] How to handle a broken pipe exception (SIGPIPE) in FIFO pipe? zyroot998 Programming 5 03-03-2011 08:10 PM


All times are GMT -5. The time now is 12:17 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration