2026-03-05

· 👁 9 · 1336

...one of my #bash aliases: to count files here:

c() {
       ls -1 | wc -l
       # count files here

       history -d "$(history 1 | awk '{print $1}')"
       # delete from history
}

· 👁 9 · 1335

I use #bash history Ctrl-R a lot, also with #fzf and other helpers, and have bash aliases, that are just one letter, and I do not want to pollute my bash #history with it, so I found the solution - the bash function/alias that delete itself from the history, for example:

s() {
       git status

       history -d "$(history 1 | awk '{print $1}')"
       # delete from history
}

· 👁 9 · 1334

#bash

I love #cli, scripts, and sometimes I want my script to accept an argument that is the same as the folder name. How to pass that current folder name to the script?

upload.py file.pdf --category "${PWD##*/}"

Yep, it works.