Stoppt die Vorratsdatenspeicherung! Jetzt klicken &handeln! Willst du auch an der Aktion teilnehmen? Hier findest du alle relevanten Infos und Materialien:
Jump to menu and information about this site.

Monday·29·November·2010

Useful but Unknown Unix Commandline Options of cat //at 14:04 //by abe

from the cats-can-do-more-than-you-may-expect dept.

Yesterday in Harald König’s commandline talk at LinuxDay.at, I first heard of cat’s -e option, and noticed that cat has quite some interesting options. From the man page of cat:

-A, --show-all
equivalent to -vET
-b, --number-nonblank
number nonempty output lines
-e
equivalent to -vE
-E, --show-ends
display $ at end of each line
-n, --number
number all output lines
-s, --squeeze-blank
suppress repeated empty output lines
-t
equivalent to -vT
-T, --show-tabs
display TAB characters as ^I
-v, --show-nonprinting
use ^ and M- notation, except for LFD and TAB

Some examples made on an UTF-8 terminal:

user@host:demo $ cat bla
ä  ö  ü ß   


abc
user@host:demo $ cat -Ab bla
     1  M-CM-$  M-CM-6  M-CM-<^IM-CM-^_   $
$
$
     2  abc$
user@host:demo $ cat -Ens bla
     1  ä  ö  ü ß   $
     2	$
     3  abc$
user@host:demo $ 

I hope this blog posting will reduce the percentage of “useless uses of cat” by raising the amount of “useful uses of cat”. :-)

Comments

Re: Useful but Unknown Unix Commandline Options of cat

Posted by: mirabilos
Website: http://cat-v.org/
Time: Tue, 30 Nov 2010 13:55

cat-v Considered harmful

Reply

Re: Useful but Unknown Unix Commandline Options of cat

Posted by: resume services
Website: http://cvresumewritingservices.org/
Time: Fri, 18 Mar 2011 17:50

Thanks, I've been looking for an easy way and here it is.

Reply

http://www.resumelines.com/

Posted by: Mark
Website: http://www.noone.org/blog/English/Computer/Debian/CoolTools/cat.futile
Time: Mon, 07 May 2012 15:28

I am new on Unix and I was used to use commands on windows to simplify my work. I had not found these commands till now. Thank you for sharing!

Reply

Re: Useful but Unknown Unix Commandline Options of cat

Posted by: Mark
Website: http://www.resumelines.com/
Time: Mon, 07 May 2012 15:29

I am new on Unix and I was used to use commands on windows to simplify my work. I had not found these commands till now. Thank you for sharing!

Reply

Your Comment

Spam Protection: To post a comment, you'll have to answer the following question: What is 42 minus 19?

Name:
URL or E-Mail: [http://... or mailto:you@example.com] (optional)
Title: (optional)
Spam Protection Answer:
Comment:

Tag Cloud

2CV, aha, Apache, APT, aptitude, ASUS, Automobiles, autossh, Berlin, bijou, Blogging, Blosxom, Blosxom Plugin, Browser, BSD, CDU, Chemnitz, Citroën, CLI, CLT, Conkeror, CSS, CX, deb, Debian, Doofe Parteien, E-Mail, eBay, EeePC, Emacs, Epiphany, Etch, ETH Zürich, Events, Experimental, Firefox, Fläsch, FreeBSD, Freitagstexter, FVWM, Galeon, Gecko, git, GitHub, GNOME, GNU, GNU Coreutils, GNU Screen, Google, GPL, grep, grml, gzip, Hackerfunk, Hacks, Hardware, Heise, HTML, identi.ca, IRC, irssi, Jabber, JavaShit, Kazehakase, Lenny, Liferea, Linux, LinuxTag, LUGS, Lynx, maol, Meme, Microsoft, Mozilla, Music, mutt, Myon, München, nemo, Nokia, nuggets, Open Source, Opera, packaging, Pentium I, Perl, Planet Debian, Planet Symlink, Quiz, Rant, ratpoison, Religion, RIP, Sarcasm, Sarge, Schweiz, screen, Shell, Sid, Spam, Squeeze, SSH, Stoeckchen, Stöckchen, SuSE, Symlink, Symlink-Artikel, Tagging, Talk, taz, Text Mode, ThinkPad, Ubuntu, USA, USB, UUUCO, UUUT, VCFe, Ventilator, Vintage, Wahlen, Wheezy, Wikipedia, Windows, WML, Woody, WTF, X, Xen, zsh, Zürich, ÖPNV

Calendar

 2010 
Months
Nov
 November 
Mo Tu We Th Fr Sa Su
29          

Tattletale Statistics

Blog postings by posting time
Blog posting times this month



Search


Advanced Search


Categories


Recent Postings

0 most recent of 0 postings total shown.


Recent Comments

Hackergotchi of Axel Beckert

About...

This is the blog or weblog of Axel Stefan Beckert (aka abe or XTaran) who thought, he would never start blogging... (He also once thought, that there is no reason to switch to this new ugly Netscape thing because Mosaïc works fine. That was about 1996.) Well, times change...

He was born 1975 at Villingen-Schwenningen, made his Abitur at Schwäbisch Hall, studied Computer Science with minor Biology at University of Saarland at Saarbrücken (Germany) and now lives in Zürich (Switzerland), working at the Network Security Group (NSG) of the Central IT Services (Informatikdienste) at ETH Zurich.

Links to internal pages are orange, links to related pages are blue, links to external resources are green and links to Wikipedia articles, Internet Movie Database (IMDb) entries or similar resources are bordeaux. Times are CET respective CEST (which means GMT +0100 respective +0200).


RSS Feeds


Identity Archipelago


Picture Gallery


Button Futility

Valid XHTML Valid CSS
Valid RSS Any Browser
This content is licensed under a Creative Commons License (SA 3.0 DE). Some rights reserved. Hacker Emblem
Get Mozilla Firefox! Powered by Linux!
Typed with GNU Emacs Listed at Tux Mobil
XFN Friendly Button Maker

Blogroll

People I know personally


Other blogs I like or read


Independent News


Interesting Planets


Web comics I like and read

Stalled Web comics I liked


Blogging Software

Blosxom Plugins I use

Bedside Reading

Just read

  • Bastian Sick: Der Dativ ist dem Genitiv sein Tod (Teile 1-3)
  • Neil Gaiman and Terry Pratchett: Good Omens (borrowed from Ermel)

Currently Reading

  • Douglas R. Hofstadter: Gödel, Escher, Bach
  • Neil Gaiman: Keine Panik (borrowed from Ermel)

Yet to read

  • Neil Stephenson: Cryptonomicon (borrowed from Ermel)

Always a good snack

  • Wolfgang Stoffels: Lokomotivbau und Dampftechnik (borrowed from Ermel)
  • Beverly Cole: Trains — The Early Years (getty images)

Postponed