lfromanini/fz

Pipe commands to FZF

Shell

3

33 commits

updated Sep 30, 2026

See the code

See what people are saying

SourceMessageScoreDate

Add-on support to Bash project (r/commandline)

Hey folks, I created a bash script more than a year ago and, during my free time, I was making improvements on it. It is a tool that pipe commands to [fzf](https://github.com/junegunn/fzf). Right now it pipes `env`, `kill`, `man`, `ssh` and, optionally, `tmux`, adding some candies like, when…

1

Oct 1, 2026

README

fz

fz - Pipe commands to FZF

    ffffffffffffffff                  
  f::::::::::::::::f                  
 f::::::::::::::::::f                 
 f::::::fffffff:::::f                 
 f:::::f       ffffffzzzzzzzzzzzzzzzzz
 f:::::f             z:::::::::::::::z
f:::::::ffffff       z::::::::::::::z 
f::::::::::::f       zzzzzzzz::::::z  
f::::::::::::f             z::::::z   
f:::::::ffffff            z::::::z    
 f:::::f                 z::::::z     
 f:::::f                z::::::z      
f:::::::f              z::::::zzzzzzzz
f:::::::f             z::::::::::::::z
f:::::::f            z:::::::::::::::z
fffffffff            zzzzzzzzzzzzzzzzz

Description

fz is a simple Bash script for piping commands to FZF, allowing you to take advantage of features such as previewing and filtering.

Usage

Run fz followed by a valid command. Run fz --help for a complete list of commands and options.

Commands

env [QUERY]

Browse environment variables and their values. Press <CTRL> + <A> or <CTRL> + <SPACE> to select all filtered results.

fz env
fz env PATH

kill [SIGNAL]

Browse running processes and send a signal. Defaults to SIGTERM; <CTRL> + <K> sends SIGKILL.

fz kill
fz kill -9

man [QUERY]

Browse installed manual pages with previews.

fz man
fz man su

ssh [SSH_OPTIONS] [-- COMMAND [ARGUMENTS...]]

Browse SSH hosts and connect to the selected host. Arguments before -- are passed to ssh; arguments after -- are executed on the selected host.

fz ssh
fz ssh -p 2222
fz ssh -p 2222 -- hostname -A

tmux [QUERY]

Browse tmux sessions, windows and panes. Press <ENTER> to attach or switch to the selection; press <CTRL> + <K> to kill it.

Requires tmux.

fz tmux
fz tmux mySession

Installation

  1. Download the script:

Download the file named fz and make it executable.

# download fz to current folder
curl -O https://raw.githubusercontent.com/lfromanini/fz/main/bin/fz

# make it executable
chmod +x fz
  1. Move it to a directory in ${PATH}:

Choose a directory from ${PATH}.

# check ${PATH}
tr ":" "\n" <<< "${PATH}" | sort

Move the script to the chosen directory, for example:

mv fz ~/.local/bin/

If you are moving it to a system directory, you may need to use sudo.

sudo mv fz /usr/local/bin/
  1. Add shell completions to .bashrc and .zshrc

This allows you to use fz <TAB><TAB> or fz kill <TAB><TAB> to autocomplete commands:

# bash
echo 'source <( fz --bash-completion )' >> ~/.bashrc

# zsh
echo 'source <( fz --zsh-completion )' >> ~/.zshrc

Reload your shell configuration for the changes to take effect:

# bash
source ~/.bashrc

# zsh
source ~/.zshrc
  1. Done!

Contributing

Contributions are welcome. See CONTRIBUTING.md for development guidelines, testing and contribution conventions.

Requirements

Optional Requirements
  • bat (enables enhanced previews)
  • tmux (enables the fz tmux command)

LICENSE

The MIT License (MIT)

lfromanini/fz

Pipe commands to FZF

Shell

3

33 commits

updated Sep 30, 2026

See the code

See what people are saying

SourceMessageScoreDate

Add-on support to Bash project (r/commandline)

Hey folks, I created a bash script more than a year ago and, during my free time, I was making improvements on it. It is a tool that pipe commands to [fzf](https://github.com/junegunn/fzf). Right now it pipes `env`, `kill`, `man`, `ssh` and, optionally, `tmux`, adding some candies like, when…

1

Oct 1, 2026

README

fz

fz - Pipe commands to FZF

    ffffffffffffffff                  
  f::::::::::::::::f                  
 f::::::::::::::::::f                 
 f::::::fffffff:::::f                 
 f:::::f       ffffffzzzzzzzzzzzzzzzzz
 f:::::f             z:::::::::::::::z
f:::::::ffffff       z::::::::::::::z 
f::::::::::::f       zzzzzzzz::::::z  
f::::::::::::f             z::::::z   
f:::::::ffffff            z::::::z    
 f:::::f                 z::::::z     
 f:::::f                z::::::z      
f:::::::f              z::::::zzzzzzzz
f:::::::f             z::::::::::::::z
f:::::::f            z:::::::::::::::z
fffffffff            zzzzzzzzzzzzzzzzz

Description

fz is a simple Bash script for piping commands to FZF, allowing you to take advantage of features such as previewing and filtering.

Usage

Run fz followed by a valid command. Run fz --help for a complete list of commands and options.

Commands

env [QUERY]

Browse environment variables and their values. Press <CTRL> + <A> or <CTRL> + <SPACE> to select all filtered results.

fz env
fz env PATH

kill [SIGNAL]

Browse running processes and send a signal. Defaults to SIGTERM; <CTRL> + <K> sends SIGKILL.

fz kill
fz kill -9

man [QUERY]

Browse installed manual pages with previews.

fz man
fz man su

ssh [SSH_OPTIONS] [-- COMMAND [ARGUMENTS...]]

Browse SSH hosts and connect to the selected host. Arguments before -- are passed to ssh; arguments after -- are executed on the selected host.

fz ssh
fz ssh -p 2222
fz ssh -p 2222 -- hostname -A

tmux [QUERY]

Browse tmux sessions, windows and panes. Press <ENTER> to attach or switch to the selection; press <CTRL> + <K> to kill it.

Requires tmux.

fz tmux
fz tmux mySession

Installation

  1. Download the script:

Download the file named fz and make it executable.

# download fz to current folder
curl -O https://raw.githubusercontent.com/lfromanini/fz/main/bin/fz

# make it executable
chmod +x fz
  1. Move it to a directory in ${PATH}:

Choose a directory from ${PATH}.

# check ${PATH}
tr ":" "\n" <<< "${PATH}" | sort

Move the script to the chosen directory, for example:

mv fz ~/.local/bin/

If you are moving it to a system directory, you may need to use sudo.

sudo mv fz /usr/local/bin/
  1. Add shell completions to .bashrc and .zshrc

This allows you to use fz <TAB><TAB> or fz kill <TAB><TAB> to autocomplete commands:

# bash
echo 'source <( fz --bash-completion )' >> ~/.bashrc

# zsh
echo 'source <( fz --zsh-completion )' >> ~/.zshrc

Reload your shell configuration for the changes to take effect:

# bash
source ~/.bashrc

# zsh
source ~/.zshrc
  1. Done!

Contributing

Contributions are welcome. See CONTRIBUTING.md for development guidelines, testing and contribution conventions.

Requirements

Optional Requirements
  • bat (enables enhanced previews)
  • tmux (enables the fz tmux command)

LICENSE

The MIT License (MIT)

Languages

Shell

100.0%