Zum Hauptinhalt springen
tsecurity.de LIVE
Echtzeit-Radar & Feeds
Alle RSS Feeds
👥 Community & Social
AI & KI NachrichtenIs the AI industry really ready to slow down?(20.09.2026 um 20:56 Uhr)
Sichere ProgrammierungThe audio bugs nobody warns you about when you build a mobile looper(20.09.2026 um 20:18 Uhr)
Sichere ProgrammierungA Successful Response Can Still Belong to the Wrong Screen(20.09.2026 um 20:23 Uhr)
Sichere ProgrammierungGzip 1.15 fixes a wrong-file deletion race(20.09.2026 um 20:32 Uhr)
Sichere ProgrammierungWhen SQL Has Nothing to Say: Handling NULLs(20.09.2026 um 20:35 Uhr)
Sichere ProgrammierungWeb Programming in C++ with WFC(20.09.2026 um 20:37 Uhr)
AI & KI NachrichtenIs the AI industry really ready to slow down?(20.09.2026 um 20:56 Uhr)
Sichere ProgrammierungThe audio bugs nobody warns you about when you build a mobile looper(20.09.2026 um 20:18 Uhr)
Sichere ProgrammierungA Successful Response Can Still Belong to the Wrong Screen(20.09.2026 um 20:23 Uhr)
Sichere ProgrammierungGzip 1.15 fixes a wrong-file deletion race(20.09.2026 um 20:32 Uhr)
Sichere ProgrammierungWhen SQL Has Nothing to Say: Handling NULLs(20.09.2026 um 20:35 Uhr)
Sichere ProgrammierungWeb Programming in C++ with WFC(20.09.2026 um 20:37 Uhr)
Intelligence View
⚡ tsecurity.de Intelligence

Shell Cacophony

Reagiere als Erste:r — dein Feedback zählt!

I am using jq, qsv, uplot quite often. This post is to make sure that you know and use them, too. I hope you will waste as much time as I do, especially with uplot.

Motivation

This post is for people like me who are facing a problem, reaching out to the terminal and piping random UNIX commands to solve it, but eventually regret not starting with Python or some other programming language in the first place.

I just want to make sure that we have some more shell goodies in our toolbox so that we keep doing the same thing over and over again: jq, qsv, uplot.

jq

I am pretty sure that you have heard about jq before, and most of you are already using it. But for those who are not familiar with it, jq is a lightweight and command-line JSON processor, sort of like sed for JSON data.

For example, use xColors API to generate 10 random colors and extract the hex codes to print them:

curl -s "https://x-colors.yurace.pro/api/random?number=10" |
  jq -r ".[]|.hex"

qsv

qsv is a command-line tool to work with CSV files. It is the successor of xsv and is written in Rust. Current progress is quite impressive as qsv now has SQL and Lua support.

For example, if we want to tabulate bird emojis from EmojiHub API:

curl -s "https://emojihub.yurace.pro/api/all/group/animal-bird" |
  jq -r ".[]|[.name,.category,.group,.unicode[0]]|@csv" |
  qsv rename --no-headers name,category,group,unicode |
  qsv table

Here, we are using jq to extract the necessary fields and output records as CSV. Then, we are using qsv to add column names and finally tabulate.

uplot

uplot is a command-line tool to plot data on the terminal. Be warned that it is quite addictive.

Let's check the number of important (p <= 3) journald entries per day over the last 1 week:

journalctl --no-pager --since="1 week ago" --priority=3 --output=json --output-fields=__REALTIME_TIMESTAMP |
  jq -r .__REALTIME_TIMESTAMP |
  cut -c 1-10 |
  xargs -I{} date --utc -d @{} +%Y-%m-%d |
  uniq -c |
  awk '{print $2","$1}' |
  uplot bar -d,

Here, we are using journalctl to get the entries with priority less than or equal to 3 in JSON format with realtime timestamp information only. Then, we are using jq to extract the timestamp, cut to get the date first 10 digits of the timestamp (in microseconds), xargs to convert the timestamp to date format using date, uniq to count the number of entries per day, awk to format the output as CSV, and finally uplot to plot the data.

The output looks like this (trust me, it will look much nicer and colourful on your terminal):

           ┌                                        ┐
2024-08-22 ┤■ 1.0
2024-08-23 ┤■■■■■■■■■■■■■■■■■■■■■■■■■■■■ 44.0
2024-08-24 ┤■■■■■ 8.0
2024-08-25 ┤■■■■■■■■■■■■■■■■■■■■■ 33.0
2024-08-26 ┤■■■■■■■■■■■■■■■■ 25.0
2024-08-27 ┤■■■■■■■■■■■■ 18.0
2024-08-28 ┤■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■ 53.0
2024-08-29 ┤■■■■■■ 10.0
           └                                        ┘

Likewise, we can get the number of entries by unit since yesterday:

journalctl --no-pager --since=yesterday --priority=3 --output=json --output-fields=_SYSTEMD_UNIT |
  jq -r ._SYSTEMD_UNIT |
  sort |
  uniq -c |
  awk '{print $2","$1}' |
  uplot bar -d,

... which produces the following completely unsurprising output:

                                    ┌                                        ┐
                  bluetooth.service ┤■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■ 58.0
                       cups.service ┤■ 1.0
                                    ⋮
                               null ┤■■ 4.0
[email protected] ┤■ 1.0
                                    ⋮
                                    └                                        ┘

Conclusion

I hope you find these tools useful.

Closing with our motto: Stick to the terminal and keep piping random UNIX commands to (not) solve our problems!

Bonus

qsv is currently not available on nixpkgs. So, I fixed it for you:

{ stdenv
, lib
, fetchzip
, autoPatchelfHook
}:

stdenv.mkDerivation rec {
  pname = "qsv";
  version = "0.132.0";

  src = fetchzip {
    url = "https://github.com/jqnatividad/qsv/releases/download/${version}/qsv-${version}-x86_64-unknown-linux-gnu.zip";
    hash = "sha256-yko+wTSGxOZWU1cJS17sPYPQeBcfyeiwQUu6dPhpL1s=";
    stripRoot = false;
  };

  nativeBuildInputs = [
    autoPatchelfHook
    stdenv.cc.cc.lib
  ];

  buildInputs = [ ];

  sourceRoot = ".";

  installPhase = ''
    runHook preInstall
    install -m755 -D source/qsvp $out/bin/qsv
    runHook postInstall
  '';

  meta = with lib; {
    homepage = "https://github.com/jqnatividad/qsv";
    description = "CSVs sliced, diced & analyzed.";
    platforms = platforms.linux;
  };
}
Ähnliche Beiträge
🔍 Verwandte News

Auch interessante Nachrichten Shell Cacophony

Thematisch verwandte Begriffe: Shell, Cacophony · 6 Treffer

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-93956 | A flaw has been found in olivier-ls PHP-FTS up to 1.1.2. Affected by thi…
Advisory →
TTS Reader • tsecurity.de Voice
tsecurity.de Icon
tsecurity.de App
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
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
🔖 Gespeicherte Artikel
📂 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 ⏱️ 3 Min vor 10 Min
Artikeldaten werden geladen...

Zurück: vorheriger Vor: nächster
↗ Original-Quelle
Social Reaktionen Deine Reaktion zählt
Einstufung & Relevanz-Poll 0 Stimmen
In sozialen Netzwerken teilen 1-Klick