This commit is contained in:
Yan Lin 2026-01-30 16:55:01 +01:00
parent 9380ddf4d1
commit 485e2efa1a
5 changed files with 86 additions and 9 deletions

View file

@ -0,0 +1,51 @@
+++
title = "Modern Unix Commands"
date = 2026-01-29
description = "Modern alternatives to classic Unix commands"
+++
There might be dozens of "modern alternatives" to every classic Unix command if you look into them;
I am not a big fan of reinventing wheels, but some of these alternatives are indeed nice and more user-friendly than their classic counterparts.
## `cd` -> `zoxide`
`cd` needs the exact absolute or relative path to work.
[`zoxide`](https://github.com/ajeetdsouza/zoxide) will remember the directories I visited, and I can quickly jump back to those directories with fuzzy path matching.
Let's say I am currently in `~/Documents/Projects/personal-blog` and I want to jump to `~/.config/nix`.
With the classic `cd`, I will have to type the whole path.
With `cd` aliased to `zoxide`, I only need to type `cd n` (supposing that `~/.config/nix` is the most frequently visited directory among all matched directories).
Internally `zoxide` records my visits to directories in a SQLite database and sorts them based on frequency. If the first hit is not what I want, I can also interactively select from the matched list.
## `du` -> `ncdu`
`du` is quite basic, and I usually need to add several arguments to make it somewhat usable. For example, `-d 1` to control the depth, `-h` to make the size human-readable.
[`ncdu`](https://dev.yorhel.nl/ncdu) is an interactive alternative to `du`, and is very usable out of the box. Interestingly, I also feel it is a touch faster than `du`.
It can totally be an alternative to those fancy disk space analyzers as well.
## `top` -> `btop`
`top` is quite basic and looks "unexciting". `htop` also ships with most Unix/Linux systems and looks better.
[`btop`](https://github.com/aristocratos/btop) might be the most "nerdy-looking" `top` alternative out of the box. It can be a handy tool if you are trying to make people believe you are a hacker.
At the same time, it is very feature-rich and configurable. To some extent, it is also an alternative to bandwidth monitoring tools like `iftop` and disk utilization tools like `df`.
## `ls` -> `eza`
I think there is nothing wrong with the classic `ls`. So, as an alternative, [`eza`](https://github.com/eza-community/eza) just has a few quality-of-life improvements, like file type icons, Git status, and (based on personal taste) prettier colors.
It can replace the `tree` command as well.
## `vim` -> `nvim`
Many people still haven't overcome the biggest `vim` challenge to this day: exit `vim` without turning off your computer.
It took me some effort to get familiar with `vim` keybindings back when I was an undergraduate, but I am definitely not going back.
You can simply use `vim` keybindings in many editors or IDEs. `vim` itself can feel a bit restrictive serving as a fully-featured code editor.
[`neovim`](https://neovim.io/) is a rabbit hole that I won't be trying to comprehensively cover in this post (nor could I).
To put it simply, it is a TUI editor that can truly be your only text editor. With countless plugins and ways to configure it, it can be a basic text editor, or a fully-featured development IDE, or anything in-between.
Syntax highlighting, file browser, fuzzy search, intelligent autocompletion, debugging, AI™ integration. You name it, `neovim` has it.

View file

@ -50,15 +50,24 @@ a {
header nav {
display: flex;
gap: 1.5rem;
flex-wrap: wrap;
align-items: baseline;
gap: 1rem 1.5rem;
margin-bottom: 3rem;
padding-bottom: 1rem;
border-bottom: 1px solid var(--border);
.site-title {
font-size: 1.25rem;
font-weight: 600;
margin-right: auto;
}
@media (max-width: 600px) {
.site-title {
flex-basis: 100%;
}
}
}
main {

View file

@ -22,9 +22,11 @@
<header>
<nav>
<a href="{{ get_url(path='/') }}" class="site-title">{{ config.title }}</a>
<a href="{{ get_url(path='ais') }}">AI Systems</a>
<a href="{{ get_url(path='homelab') }}">Homelab</a>
<a href="{{ get_url(path='ml-tech') }}">ML Tech</a>
{% set root = get_section(path="_index.md") %}
{% for path in root.subsections %}
{% set s = get_section(path=path) %}
<a href="{{ s.permalink }}">{{ s.title }}</a>
{% endfor %}
</nav>
</header>
<main>

View file

@ -7,10 +7,20 @@
<section class="recent-posts">
<h2>Recent Posts</h2>
{% set ais = get_section(path="ais/_index.md") %}
{% set homelab = get_section(path="homelab/_index.md") %}
{% set ml_tech = get_section(path="ml-tech/_index.md") %}
{% set all_pages = ais.pages | concat(with=homelab.pages) | concat(with=ml_tech.pages) %}
{% set root = get_section(path="_index.md") %}
{% set all_pages = [] %}
{% if root.subsections[0] is defined %}
{% set s0 = get_section(path=root.subsections[0]) %}
{% set all_pages = all_pages | concat(with=s0.pages) %}
{% endif %}
{% if root.subsections[1] is defined %}
{% set s1 = get_section(path=root.subsections[1]) %}
{% set all_pages = all_pages | concat(with=s1.pages) %}
{% endif %}
{% if root.subsections[2] is defined %}
{% set s2 = get_section(path=root.subsections[2]) %}
{% set all_pages = all_pages | concat(with=s2.pages) %}
{% endif %}
<ul class="post-list">
{% for page in all_pages | sort(attribute="date") | reverse | slice(end=5) %}
<li>

View file

@ -12,7 +12,12 @@
{% endif %}
<ul class="post-list">
{% for page in section.pages %}
{% if paginator %}
{% set pages = paginator.pages %}
{% else %}
{% set pages = section.pages %}
{% endif %}
{% for page in pages %}
<li>
<time datetime="{{ page.date }}">{{ page.date | date(format="%Y-%m-%d") }}</time>
<a href="{{ page.permalink }}">{{ page.title }}</a>