this post was submitted on 25 Aug 2023
23 points (96.0% liked)

Linux

48133 readers
1241 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 5 years ago
MODERATORS
 

alias seahis="cat ~/.bash_history | grep $@"

search terminal history

alias seaman="tree /usr/share/man | grep"

search for manual pages across all types and levels

alias highlight="grep -B 5000 -A 5000 $@"

use grep (should be used at the end of a "|" pipe) to highlight only. The "-B/-A" (5000) means include 5k lines above and below any matching search terms. This is handy when you have a big block of text printing in the terminal and need to find a key word. grep will color that term but print (almost) anything before or after too, making this a defacto highlight text feature.

alias commands="compgen -A function -abck"

This is the command to show all available executable commands including binaries, functions, aliases, and keywords. If you add a term after this alias it should automatically search/filter the results, if not just add " | grep $@" to the end.

(Note: Lemmy syntax I used)
spoiler "one liner" "Description" ::: (don't use the "" just use text) :::

you are viewing a single comment's thread
view the rest of the comments
[–] PinGZ@artemis.camp 2 points 1 year ago (1 children)

I’ve always been partial to this one , runs the last command as sudo

alias fu='sudo fc -n -l -1'

[–] idoubledo@lemmy.sdf.org -2 points 1 year ago

For a much improved functionality with the same syntax take a look at https://github.com/nvbn/thefuck