21 points

Ctrl+r was a life-changer when I first learned it.

permalink
report
reply
9 points

I think it’s the only shell shortcut I know haha

You can install fzf to make it fancier.

permalink
report
parent
reply
1 point

Same. For anyone using fish shell, this plugin is super-handy: https://github.com/PatrickF1/fzf.fish

permalink
report
parent
reply
13 points

Shout out to the very fine Atuin.sh. Give it a try, you won’t regret it.

permalink
report
reply
3 points

curl | sh…

permalink
report
parent
reply
8 points

Yep, I don’t like these “recommended” methods, too. Fortunately, you can just use your favourite package manager instead: https://docs.atuin.sh/guide/installation/#manual-installation

permalink
report
parent
reply
11 points

If you have fzf installed, it is easy to integrate it with your bash history. In my .bashrc, I have:

# Introduce fzf-driven functionality as described here: https://wiki.archlinux.org/title/fzf.
source /usr/share/fzf/key-bindings.bash
source /usr/share/fzf/completion.bash

Also, you may be interested in zoxide, which keeps track of paths you have navigated to. Also from my .bashrc:

# Enable an autojump-like 'j' command. Use 'ji M' to select paths starting with M using fzf.
# This needs to always come last.
eval "$(zoxide init --cmd j bash)"
permalink
report
reply
1 point

I just started using both recently and it’s great. For the fzf file search, there’s even some extension that can show a preview pane of text files and even images!

permalink
report
parent
reply
6 points

Here’s something I use to search history for commands or keywords. I have this as a function in my profile:

function hgr() {
    history | grep "$1"
}

history grep

Usage: hgr git to search for commands containing git.

Someone more knowledgeable may be able to point out ways to improve this.

permalink
report
reply
4 points
*

you can get a lot of the way there with Control+R reverse history search (mentioned in the article) – and it’s interactive. With fzf you can even get fuzzy history searching (the first search result has a video). atuin puts history into a proper db, optional syncs across hosts, and, like fzf, enhances control+r

permalink
report
parent
reply
6 points

New to Linux as my daily driver. This is life changing. I was up/down arrowing like a madman!

permalink
report
reply

Linux

!linux@lemmy.ml

Create post

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

  • Posts must be relevant to operating systems running the Linux kernel. GNU/Linux or otherwise.
  • No misinformation
  • No NSFW content
  • No hate speech, bigotry, etc

Related Communities

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

Community stats

  • 9.6K

    Monthly active users

  • 3.1K

    Posts

  • 35K

    Comments