40
submitted 2 days ago by thingsiplay@lemmy.ml to c/linux@lemmy.ml

It can't hurt to share some of you current helpers. Either someone else might get inspired by or in some cases you get suggestions how to make it better. Bash, Zsh, Fish or whatever shell script, command or alias (or abbreviation) you have, share here. Always fun to do so! I share mine in the comments, just like everybody else.

you are viewing a single comment's thread
view the rest of the comments
[-] thingsiplay@lemmy.ml 7 points 2 days ago

There is a bit to unpack here. I particularly like the m() function here, to search for specific options in a man page. The grep_browser() is quiet involved and need to test it out myself. Meanwhile here is an "old" function of mine related to man pages, just searching all available pages, not their content:

woman

#!/bin/env bash

# Lookup section meaning in `man man`.
sections='1,8,6,5,7'

show_manual () {
    man -- "${1%% *}" 2> /dev/null
}
export -f show_manual

if selection=$(man -k . --sections="${sections}" \
               | sort -t ' ' -k 2,2 -k 1,1 \
               | fzf -q "${*}" \
                     --cycle \
                     --border=none \
                     --bind change:first \
                     --bind tab:down \
                     --bind shift-tab:up \
                     --bind esc:cancel+clear-selection \
                     --tiebreak=begin,chunk,length \
                     --reverse \
                     --preview='show_manual {}' \
                     --preview-window=down:70%:wrap:border-rounded)
then
    show_manual "${selection}"
fi
this post was submitted on 02 Dec 2026
40 points (97.6% liked)

Linux

69006 readers
446 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 7 years ago
MODERATORS