Close Menu

    Subscribe to Updates

    Get the latest Tech news from SynapseFlow

    What's Hot

    Attackers Exploit Third Arista VCO Zero-Day in Four Months

    October 24, 2026

    APOD: 2026 October 24 – Rosetta’s Selfie

    October 24, 2026

    This robot vacuum washes its mops at 100°C, and it’s back down to £599.99

    October 24, 2026
    Facebook X (Twitter) Instagram
    • Homepage
    • About Us
    • Contact Us
    • Privacy Policy
    Facebook X (Twitter) Instagram YouTube
    synapseflow.co.uksynapseflow.co.uk
    • AI News & Updates
    • Cybersecurity
    • Future Tech
    • Reviews
    • Software & Apps
    • Tech Gadgets
    synapseflow.co.uksynapseflow.co.uk
    Home»Software & Apps»I stopped retyping Linux commands after changing what Ctrl+R does
    I stopped retyping Linux commands after changing what Ctrl+R does
    Software & Apps

    I stopped retyping Linux commands after changing what Ctrl+R does

    The Tech GuyBy The Tech GuyOctober 23, 2026No Comments5 Mins Read0 Views
    Share
    Facebook Twitter LinkedIn Pinterest Email
    Advertisement


    If you use Ctrl+R on the terminal, you probably run into this same vicious circle once in a while: type a few letters, find the wrong command, try the shortcut again, land on the wrong command again, then give up and type the entire command from memory.

    Advertisement

    I finally let fzf replace that shortcut, and it’s saved me from typing a long command ever since. It’s the perfect fix if you spend time hunting through your shell history.

    Half a command is enough

    Type the bits you remember, in any order

    fzf file search in a terminal

    I built a backup command: a long rsync line that had exclusions, a trailing slash, and a destination. In the past, I would get the trailing slash wrong, and the destination wasn’t easy to remember.

    Using Ctrl+R, I only type rsync and projects, and get the full command line close to the top of the list that fzf produces. The good thing about this list is that beneath this very command are a few near-identical commands from other backups.

    That’s one way fzf beats the default search. The default requires one exact stretch of text and ends up presenting a single result. With fzf, I use separate words, and regardless of the order I use them, it presents a list of matches. This means I can find the same line using “rsync projects” or “projects rsync.”

    What you get at the top of the list is the best match. I was surprised that it didn’t merely place my most recent commands at the top. Pressing Ctrl+R again sorts by newest commands.

    But for this to work, fzf must be installed and enabled. Here are the steps:

    1. On Linux Mint, Ubuntu, or Debian, run sudo apt install fzf.
    2. Verify the installed version using the command: fzf --version.
    3. If your version is 0.48.0 or newer, open ~/.bashrc in a terminal editor (for example: nano ~/.bashrc).
    4. Navigate to the bottom with the arrow keys, then add eval “$(fzf –bash)” on a new line, and save the file (press Ctrl+O, then Enter, then Ctrl+X to exit).
    5. Apply the changes by running source ~/.bashrcin the terminal.

    It finds the command, then waits

    Nothing runs until you say so

    Searching bash history with fzf command

    When I used the old Ctrl+R, pressing Enter ran the command immediately. With fzf, selecting a result only pastes it onto the command line, giving me an opportunity to decide what I want to do with it.

    This design has mattered a lot to me. One time, the backup I’d recovered pointed at an older machine, 192.168.1.20, and I was able to move the cursor over and swap the address. Only then did I press Enter to run the command. Without this design, I might have ended up syncing my projects to the wrong address. fzf allows me to view and treat recovered commands as templates.

    On recent versions of fzf, you can use Alt+R, which keeps the nonmatching commands but dims them. Seeing the surrounding commands allows me to remember what I was doing at the time.

    Your shell’s history isn’t always up to date

    Why fzf can’t find every command you’ve run

    When you run a command in one terminal window and switch to another, Ctrl+R doesn’t always surface the command.

    The reason is that each running shell has a history list that it writes to a file after that window closes. If a terminal window is already open, it doesn’t automatically reload what was freshly written to the history file. fzf can only search from the history that its current shell has, and fuzzy matching doesn’t recover commands that do not exist.

    Situation

    Can it find the command?

    If another window is still open

    No

    That window closed, you open a new one

    Yes

    That window closed, yours was already open

    No, until it reloads

    This is why, even when you’re sure you ran a command, it doesn’t appear on the list.

    The modest stock history is a limit. Bash commonly uses a HISTSIZE of 1,000 lines in memory and a HISTFILESIZE of 2,000 lines for the history file on Ubuntu, though these values vary by distribution and configuration. After these numbers are exceeded, Bash discards older commands. Check your own limits by running echo $HISTSIZE and echo $HISTFILESIZE in the terminal.

    There’s a fix. You can make every window save as it goes by adding this line to ~/ .bashrc:

    PROMPT_COMMAND='history -a; history -c; history -r'

    However, if you try this fix, all your windows share a single combined history, and the up arrow no longer follows only the current window.

    Some commands deserve to be forgotten

    It’s great to have fzf always surfacing your commands, but a searchable history can show things you’d rather forget. So a password or an API key you pasted into the command can show up at the moment you least expect. By default, Bash will save commands unless you configure it to exclude them. So even though it may not record everything, it records plenty.

    So on my installation, I select certain entries in the picker and use Shift+Del to delete them. I advise this for sensitive things you may have entered in the terminal, but this won’t erase them from the terminal’s scrollback.

    If your shell is configured to ignore commands that start with a space, a practical approach is to begin sensitive commands with a space. This way, Bash excludes the command from its saved command history. Run echo $HISTCONTROL to check the setting. “ignorespace” or “ignoreboth” enables excluding space-prefixed commands.

    This change to fzf took about a minute to set up, but is still one of the more useful ones I’ve made on my terminal. Instead of remembering the entire command, fzf surfaces what matters from the little I remember.

    fzf-color

    OS

    Linux, macOS, Windows, and BSD operating systems

    Price

    Free

    fzf is a general-purpose command-line fuzzy finder. This interactive terminal toolkit lets you select files, browse command history, and preview data.


    Advertisement
    Share. Facebook Twitter Pinterest LinkedIn Tumblr Email
    The Tech Guy
    • Website

    Related Posts

    Netflix hides a test that tells you exactly who to blame for buffering

    October 23, 2026

    Your RAM has more than one XMP profile, and picking the wrong one might cost you performance

    October 22, 2026

    I was paying for apps that Windows 11 now does for free

    October 22, 2026

    Meta says Muse has over 10M users, with shopping a top activity

    October 22, 2026

    I replaced Samsung’s default apps one by one, and my Galaxy phone finally works the way I want

    October 21, 2026

    iPhones lasts longer than you think — here’s how to know when to upgrade

    October 21, 2026
    Leave A Reply Cancel Reply

    Advertisement
    Top Posts

    You don’t need a NAS to self-host — I proved it with hardware from my closet

    June 7, 2026393 Views

    Spotify is giving one of its best playlists a big visual upgrade to give subscribers ‘a closer connection’ to its New Music Friday curators — and I think it could be the update it’s always needed

    June 12, 2026211 Views

    The iPad Air brand makes no sense – it needs a rethink

    October 12, 202517 Views
    Stay In Touch
    • Facebook
    • YouTube
    • TikTok
    • WhatsApp
    • Twitter
    • Instagram
    Advertisement
    About Us
    About Us

    SynapseFlow brings you the latest updates in Technology, AI, and Gadgets from innovations and reviews to future trends. Stay smart, stay updated with the tech world every day!

    Our Picks

    Attackers Exploit Third Arista VCO Zero-Day in Four Months

    October 24, 2026

    APOD: 2026 October 24 – Rosetta’s Selfie

    October 24, 2026

    This robot vacuum washes its mops at 100°C, and it’s back down to £599.99

    October 24, 2026
    categories
    • AI News & Updates
    • Cybersecurity
    • Future Tech
    • Reviews
    • Software & Apps
    • Tech Gadgets
    Facebook X (Twitter) Instagram Pinterest YouTube Dribbble
    • Homepage
    • About Us
    • Contact Us
    • Privacy Policy
    © 2026 SynapseFlow All Rights Reserved.

    Type above and press Enter to search. Press Esc to cancel.

    Ad Blocker Enabled!
    Ad Blocker Enabled!
    Our website is made possible by displaying online advertisements to our visitors. Please support us by disabling your Ad Blocker.