56
top 8 comments
sorted by: hot top controversial new old
[-] vort3@lemmy.ml 27 points 1 day ago* (last edited 1 day ago)

I comment the commands that I want and then use vim to remove ones without comments.

For example, I run:

longandannoyingcommand -f1 -f2 -f3 # keep, does something useful

Usually comment explains what the command does so I can find it by description using fzf history search. And then you can easily find all lines that contain (or do not contain "# keep") in your history to remove or keep.

[-] grrgyle@slrpnk.net 7 points 16 hours ago

We are same. I sometimes use comments as kind of tags, like

xinput --disable $(xinput --list | grep -i touchpad | grep 'id=[0-9]\+' -o | cut -d= -f2)  # Disable synaptic touchpad trackpad pointer

or

python3 -c 'from ctypes import *; X11 = cdll.LoadLibrary("libX11.so.6"); X11.XOpenDisplay.restype = POINTER(c_ubyte); display = X11.XOpenDisplay(None); X11.XkbLockModifiers(display, c_uint(0x0100), c_uint(2), c_uint(0)); X11.XCloseDisplay(display)' # swap caps CAPS CAPSLOCK

or sometimes I'll add # works at the end of a long string of attempts (usually involving dialing into a regexp), like

xdpyinfo|grep dimensions|grep -Eow '\d'
xdpyinfo|grep dimensions|grep -Eow '(\d)'
xdpyinfo|grep dimensions|grep -ow '(\d)'
xdpyinfo|grep dimensions|grep -o '(\d)'
xdpyinfo|grep dimensions
xdpyinfo|grep dimensions|grep '1920x1080'
xdpyinfo|grep dimensions|grep -o '1920x1080'
xdpyinfo|grep dimensions|grep -o '\d920x1080'
xdpyinfo|grep dimensions|grep -Po '\d920x1080'
xdpyinfo|grep dimensions|grep -Po '\d+x1080'
xdpyinfo|grep dimensions|grep -Po '\d+x\d+'
xdpyinfo|grep dimensions|grep -Po '(\d+x\d+)'
xdpyinfo|grep dimensions|grep -Po '(\d+x\d+) pixels'
xdpyinfo|grep dimensions|grep -Po '(\d+x\d+) pixels'|cut
xdpyinfo|grep dimensions|grep -Po '(\d+x\d+) pixels'|cut -f1
xdpyinfo|grep dimensions|grep -Po '(\d+x\d+) pixels'|cut -d\ -f1
xdpyinfo|grep dimensions|grep -Po '(\d+x\d+) pixels'|cut -d'' -f1
scrot --quality 1 --compression 0 --format jpg - | convert -scale 10% -scale 1000% -quality 100 - RGB:- | i3lock --image /dev/stdin --raw 3840x1818:rgb --nofork
xdpyinfo|grep dimensions|grep -Po '(\d+x\d+) pixels'|cut -d' ' -f1
xdpyinfo|grep dimensions|grep -Po '(\d+x\d+) pixels'|cut -d' ' -f1 # works
[-] Jinna@lemmy.blahaj.zone 12 points 1 day ago

Atuin (by @ellie@hachyderm.io) makes the history storage and management side much easier and portable, but could perhaps use a "smite mode" to make deletion interactively easier. The current interactive implementation prioritizes safety over expediency which is fine, but a "today I clean things" option could perhaps instead prioritize the other way around and enable one key delete w/ undo instead.

[-] PotatoesFall@discuss.tchncs.de 3 points 1 day ago

Is this some sort of bash/zsh joke that I'm too fish to understand?

Okay I can see how curating could work. But if you're lazy like me, I recommend this:

https://github.com/PatrickF1/fzf.fish

[-] karpintero@lemmy.world 2 points 1 day ago* (last edited 1 day ago)

I might try this. Normally would just pipe history into grep to search or scroll till I found the right command. Also smite is a great name for that function.

[-] elmicha@feddit.org 10 points 1 day ago
[-] utopiah@lemmy.ml 2 points 8 hours ago

Right, I was starting to think "Oh yeah and maybe I could fzf history..." then wait, I already do that reverse-i-search then edit. If I use that often enough, alias in ~/.bashrc or even function to make it composable.

[-] karpintero@lemmy.world 2 points 20 hours ago

Excellent, thanks

this post was submitted on 15 Jun 2025
56 points (98.3% liked)

Linux

55319 readers
1289 users here now

From Wikipedia, the free encyclopedia

Linux is a family of open source Unix-like operating systems based on the Linux kernel, an operating system kernel first released on September 17, 1991 by Linus Torvalds. Linux is typically packaged in a Linux distribution (or distro for short).

Distributions include the Linux kernel and supporting system software and libraries, many of which are provided by the GNU Project. Many Linux distributions use the word "Linux" in their name, but the Free Software Foundation uses the name GNU/Linux to emphasize the importance of GNU software, causing some controversy.

Rules

Related Communities

Community icon by Alpár-Etele Méder, licensed under CC BY 3.0

founded 6 years ago
MODERATORS