Zum Hauptinhalt springen
Echtzeit-Radar & Feeds
Alle RSS Feeds ➔
👥 Community & Social
•
IT NachrichtenSamsung Galaxy S26 FE review: false economy(24.09.2026 um 22:07 Uhr)
••••••••••
IT NachrichtenSamsung Galaxy S26 FE review: false economy(24.09.2026 um 22:07 Uhr)
•••••••••
Intelligence View
⚡ tsecurity.de Intelligence

How to align columnar output in the terminal

In bioinformatics we are handling a lot of tabular data. Be it VCF files, tabular Blast output, or just creating a CSV or TSV samplesheet. Actually, one of my favorite tabular formats is by using SeqKit to convert Fasta or FastQ files to…

0
↗ Quelle (dev.to)
Reagiere als Erste:r — dein Feedback zählt!

In bioinformatics we are handling a lot of tabular data. Be it VCF files, tabular Blast output, or just creating a CSV or TSV samplesheet.



Actually, one of my favorite tabular formats is by using SeqKit to convert Fasta or FastQ files to tabular format, as this allows to do various filtering operations by row, using standard unix tools if so wished.



Scrolling through this type of data in the terminal can be messy to say the least though.



Although CSVs can of course be imported into a spreadsheet software for viewing, it would be very powerful to be able to view them comfortably right from the terminal, isn't it?



To take one example that fits within the code window of a blog post, let's take a selected set of columns from the CSV output from the Mykrobe tool. And to make it emulate another common problem with many csv formats, let's also use tr to convert the _:s in the headers into real spaces (Mykrobe does not do this, but many other tools do):




$ cat SOME_SAMPLE.csv | cut -d, -f 2,3,10,14,15,17,18 | tr '_' ' ' > selection.csv
$ cat selection.csv
"drug","susceptibility","kmer size","phylo group per covg","species per covg","phylo group depth","species depth"
"Amikacin","S","21","99.672","98.428","372","347"
"Capreomycin","S","21","99.672","98.428","372","347"
"Ciprofloxacin","S","21","99.672","98.428","372","347"
"Delamanid","S","21","99.672","98.428","372","347"
"Ethambutol","S","21","99.672","98.428","372","347"
"Ethionamide","S","21","99.672","98.428","372","347"
"Isoniazid","R","21","99.672","98.428","372","347"
"Kanamycin","S","21","99.672","98.428","372","347"
"Levofloxacin","S","21","99.672","98.428","372","347"
"Linezolid","S","21","99.672","98.428","372","347"
"Moxifloxacin","S","21","99.672","98.428","372","347"
"Ofloxacin","S","21","99.672","98.428","372","347"
"Pyrazinamide","S","21","99.672","98.428","372","347"
"Rifampicin","S","21","99.672","98.428","372","347"
"Streptomycin","R","21","99.672","98.428","372","347"






As you can see, here it is really not that easy to even follow individual columns, much less link headers to columns.



To improve the situation here a bit, we can convert the commas to tabs, using the tr command:




$ cat selection.csv | tr "," "\t"
"drug" "susceptibility" "kmer size" "phylo group per covg" "species per covg" "phylo group depth" "species depth"
"Amikacin" "S" "21" "99.672" "98.428" "372" "347"
"Capreomycin" "S" "21" "99.672" "98.428" "372" "347"
"Ciprofloxacin" "S" "21" "99.672" "98.428" "372" "347"
"Delamanid" "S" "21" "99.672" "98.428" "372" "347"
"Ethambutol" "S" "21" "99.672" "98.428" "372" "347"
"Ethionamide" "S" "21" "99.672" "98.428" "372" "347"
"Isoniazid" "R" "21" "99.672" "98.428" "372" "347"
"Kanamycin" "S" "21" "99.672" "98.428" "372" "347"
"Levofloxacin" "S" "21" "99.672" "98.428" "372" "347"
"Linezolid" "S" "21" "99.672" "98.428" "372" "347"
"Moxifloxacin" "S" "21" "99.672" "98.428" "372" "347"
"Ofloxacin" "S" "21" "99.672" "98.428" "372" "347"
"Pyrazinamide" "S" "21" "99.672" "98.428" "372" "347"
"Rifampicin" "S" "21" "99.672" "98.428" "372" "347"
"Streptomycin" "R" "21" "99.672" "98.428" "372" "347"






Well, now we at least can clearly follow individual columns. But the headers don't align that well.



To fix this, what we can do is use the column -t command, which will straighten up the columns for us nicely:




$ cat selection.csv | tr ',' ' ' |  column -t
"drug" "susceptibility" "kmer size" "phylo group per covg" "species per covg" "phylo group depth" "species depth"
"Amikacin" "S" "21" "99.672" "98.428" "372" "347"
"Capreomycin" "S" "21" "99.672" "98.428" "372" "347"
"Ciprofloxacin" "S" "21" "99.672" "98.428" "372" "347"
"Delamanid" "S" "21" "99.672" "98.428" "372" "347"
"Ethambutol" "S" "21" "99.672" "98.428" "372" "347"
"Ethionamide" "S" "21" "99.672" "98.428" "372" "347"
"Isoniazid" "R" "21" "99.672" "98.428" "372" "347"
"Kanamycin" "S" "21" "99.672" "98.428" "372" "347"
"Levofloxacin" "S" "21" "99.672" "98.428" "372" "347"
"Linezolid" "S" "21" "99.672" "98.428" "372" "347"
"Moxifloxacin" "S" "21" "99.672" "98.428" "372" "347"
"Ofloxacin" "S" "21" "99.672" "98.428" "372" "347"
"Pyrazinamide" "S" "21" "99.672" "98.428" "372" "347"
"Rifampicin" "S" "21" "99.672" "98.428" "372" "347"
"Streptomycin" "R" "21" "99.672" "98.428" "372" "347"






As you can see, column -t does not handle this situation very well, as it is separating columns based on plain spaces by default, something we have in our headers in many real world files.



To fix this, what we can do is make sure that column -t only separates based on real TAB characters. The problem with this is that specifying a proper TAB character on the commandline is not always straight-forward. Some tools, such as awk accepts a normal "\t" string for this, e.g. awk -F"\t" to tell awk to use TAB as a field separator, but column doesn't do that. Instead we need to specify it using $'\t', which should work in most newer Linuxes.



So all in all, we can do:




$ cat selection.csv | tr ',' '\t' | column -t -s $'\t'
"drug" "susceptibility" "kmer size" "phylo group per covg" "species per covg" "phylo group depth" "species depth"
"Amikacin" "S" "21" "99.672" "98.428" "372" "347"
"Capreomycin" "S" "21" "99.672" "98.428" "372" "347"
"Ciprofloxacin" "S" "21" "99.672" "98.428" "372" "347"
"Delamanid" "S" "21" "99.672" "98.428" "372" "347"
"Ethambutol" "S" "21" "99.672" "98.428" "372" "347"
"Ethionamide" "S" "21" "99.672" "98.428" "372" "347"
"Isoniazid" "R" "21" "99.672" "98.428" "372" "347"
"Kanamycin" "S" "21" "99.672" "98.428" "372" "347"
"Levofloxacin" "S" "21" "99.672" "98.428" "372" "347"
"Linezolid" "S" "21" "99.672" "98.428" "372" "347"
"Moxifloxacin" "S" "21" "99.672" "98.428" "372" "347"
"Ofloxacin" "S" "21" "99.672" "98.428" "372" "347"
"Pyrazinamide" "S" "21" "99.672" "98.428" "372" "347"
"Rifampicin" "S" "21" "99.672" "98.428" "372" "347"
"Streptomycin" "R" "21" "99.672" "98.428" "372" "347"






Since the terminal might sometimes be too small to view all the columns without breaking lines, I typically combine that with less -S:




$ cat selection.csv | tr ',' '\t' | column -t -s $'\t' | less -S
"drug" "susceptibility" "kmer size" "phylo group per covg" "species per covg" "phylo group depth" "species depth"
"Amikacin" "S" "21" "99.672" "98.428" "372" "347"
"Capreomycin" "S" "21" "99.672" "98.428" "372" "347"
"Ciprofloxacin" "S" "21" "99.672" "98.428" "372" "347"
"Delamanid" "S" "21" "99.672" "98.428" "372" "347"
"Ethambutol" "S" "21" "99.672" "98.428" "372" "347"
"Ethionamide" "S" "21" "99.672" "98.428" "372" "347"
"Isoniazid" "R" "21" "99.672" "98.428" "372" "347"
"Kanamycin" "S" "21" "99.672" "98.428" "372" "347"
"Levofloxacin" "S" "21" "99.672" "98.428" "372" "347"
"Linezolid" "S" "21" "99.672" "98.428" "372" "347"
"Moxifloxacin" "S" "21" "99.672" "98.428" "372" "347"
"Ofloxacin" "S" "21" "99.672" "98.428" "372" "347"
"Pyrazinamide" "S" "21" "99.672" "98.428" "372" "347"
"Rifampicin" "S" "21" "99.672" "98.428" "372" "347"
"Streptomycin" "R" "21" "99.672" "98.428" "372" "347"






This is quite the mess of a command though, so I have of course created some aliases in my ~/.bash_aliases file:




alias colt="column -t -s $'\t'"
alias s='less -S'






So now, in these situations, I can just do:




$ cat selection.csv | tr ',' '\t' | colt | s






One caveat in this specific example needs to be added, and that is that column -t can accept , as separator straight away, with column -t -s,, meaning that you don't necessarily need to convert commas to tabs in this specific example. But tab separated output is common enough that you will find yourself needing the commands above anyway.



Hope this helps!



(Cross-posted from livesys.se)

CTI Threat Relationship Graph2 Knoten / 1 Relationen
CVE / Incident Software MITRE ATT&CK CWE Weakness IoC
SOC Incident Playbook: Vulnerability Remediation & Verification
Syntax validiert (0 Fehler)
title: Detect Exploitation - How to align columnar output in the terminal
id: d34f04f2-c654-4db4-ab29-139c4e499641
status: experimental
description: Automatisch generierte SIEM-Erkennungsregel basierend auf CTI Intelligence
references:
  - https://tsecurity.de/
author: iShareStuff CTI Automated Detection Engine
date: 2026-09-24
logsource:
  category: network_connection
  product: any
detection:
  selection:
      CommandLine|contains:
        - 'exploit'
  condition: selection
falsepositives:
  - Legitime administrative Zugriffe oder Penetrationstests
level: high
tags:
  - attack.initial_access
Syntax validiert (0 Fehler)
rule CTI_Threat_Indicator {
    meta:
        author = "iShareStuff CTI Automated Detection Engine"
        date = "2026-09-24"
        description = "YARA Signature for "
    strings:
        $str = "How to align columnar output i" ascii wide
    condition:
        any of them
}
Syntax validiert (0 Fehler)
index=security sourcetype IN ("cisco:asa", "pan:traffic", "zeek_conn", "suricata", "WinEventLog:Security")
("How to align columnar output in the term")
| stats count earliest(_time) as first_seen latest(_time) as last_seen by src_ip, dest_ip, dest_host, signature
| eval first_seen=strftime(first_seen, "%Y-%m-%d %H:%M:%S"), last_seen=strftime(last_seen, "%Y-%m-%d %H:%M:%S")
| sort - count
Syntax validiert (0 Fehler)
message: "*How to align columnar output in the term*"
Syntax validiert (0 Fehler)
CommonSecurityLog
| where Message has "How to align columnar output in the term"
| summarize EventCount = count(), FirstSeen = min(TimeGenerated), LastSeen = max(TimeGenerated) by SourceIP, DestinationIP, DestinationPort, Activity
| extend DetectionRule = "iShareStuff-CTI-Compiled"
| sort by EventCount desc
🎯
MITRE ATT&CK Matrix Navigator 14 Taktiken
Reconnaissance
-
Resource Development
-
Initial Access
Execution
Persistence
-
Privilege Escalation
Defense Evasion
Credential Access
-
Discovery
-
Lateral Movement
-
Collection
-
Command and Control
Exfiltration
-
Impact
tsecurity.de Cognitive Threat RAG
Fokus-Vektor:

Kognitive Analyse für identifizierte Bedrohung: Erhöhte Bedrohungslage im Bereich How to align columnar output in the term.... Basierend auf 368k Vektor-Korrelationen werden sofortige Isolationsmaßnahmen für betroffene Endpunkte empfohlen.

🛡️ Angriffsfläche & Exposure

Netzwerk/Remote-Zugriff ohne Vorauthentifizierung möglich.

⚡ Empfohlene Sofortmaßnahmen
  • 1. Perimeter-Inspektion: Relevante Portfreigaben und exponierte Endpunkte unverzüglich scannen.
  • 2. Patch-Applikation: Hersteller-Hotfix einspielen oder betroffene Daemons in isolierte DMZ-Segmente überführen.
  • 3. Telemetrie & EDR-Alerts: Prozessaufrufe und Child-Processes auf anomale Shell-Spawns überwachen.
🔗 Semantisch verwandte Zero-Days MariaDB 11.7 VEC
Ähnliche Beiträge
🔍 Verwandte News

Auch interessante Nachrichten How to align columnar output in the terminal

Thematisch verwandte Begriffe: align, columnar, output, terminal · 6 Treffer

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Zum Aktualisieren ziehen
ZERO-DAY CVE-2026-81473 | Dell Rugged Control Center (RCC), versions prior to 5.2.206, contain an …
Advisory →
tsecurity.de Icon
Offline-Lesen, Eilmeldungen & 0ms Ladezeit

Installiere tsecurity.de direkt auf deinen Home-Bildschirm für das ultimative Vollbild-Magazinerlebnis ohne Browser-Leisten.

Nächster Beitrag
Themen-Radar & Intelligence Matrix
Echtzeit-Taxonomie nach Angriffsvektoren & Plattformen

tsecurity.de Live Threat Radar

🔴 LIVE RADAR
MONITORING
AKTIV
CVE-DATENBANK
LIVE
🔍
Community Radar & Live Chat
Sentinel Bot online • Live-Stream
Dein Cluster: Security Explorer
Match:
lädt…
Verbindung zum Community-Stream wird aufgebaut...
Bearbeitungsmodus — Senden überschreibt deine Nachricht
Community-Puls — was gerade passiert
lädt…
Aktivitäten deiner Analysten
lädt…
Neues Thema oder Eilmeldung einreichen

Reiche interessante Links, Zero-Days oder Debatten ein. Die Community entscheidet per Upvote über die Veröffentlichung.

Heiß diskutierte Einreichungen
📂 Keine gespeicherten Artikel vorhanden.
Zurück Ziehen Vor
Links: vorheriger Artikel • Rechts: nächster Artikel • unten: schließen
News NIS-2 Frühwarnung Tier-1 Intel TTP ⏱️ 3 Min vor 10 Min
Artikeldaten werden geladen...
↗ Original-Quelle