Installation Guide for ls-f
Prerequisites
Before installing ls-f, ensure your system meets these requirements:
- Nerd Fonts: You need to have Nerd Fonts installed to see the icons correctly
- Shell Compatibility: Bash, Zsh, Fish, or other POSIX-compatible shells
- Root Access: For system-wide installation, you'll need
sudoaccess
Checking Prerequisites
To verify Nerd Fonts are installed:
fc-list | grep -i "Nerd Font"
If this command returns results, you have Nerd Fonts installed. If not, visit Nerd Fonts website to install them.
Installation Methods
Method 1: Git Clone (Recommended)
# Clone the repository
git clone https://github.com/your-username/ls-f.git
cd ls-f
# Install using the script
sudo ./install.sh
Method 2: Direct Download
# Download the lsf script directly
sudo curl -L https://github.com/your-username/ls-f/releases/latest/download/lsf -o /usr/local/bin/lsf
sudo chmod +x /usr/local/bin/lsf
Method 3: Using the Raw Install Script
curl -fsSL https://raw.githubusercontent.com/your-username/ls-f/main/install.sh | sudo bash
Post-Installation Setup
After installation, you can use lsf immediately:
lsf
lsf -la
lsf --help
Setting up Aliases
To replace the default ls command with lsf, set up an alias in your shell configuration.
For Bash users
Add to ~/.bashrc:
alias ls='lsf'
Then reload:
source ~/.bashrc
For Zsh users
Add to ~/.zshrc:
alias ls='lsf'
Then reload:
source ~/.zshrc
For Fish users
Add to ~/.config/fish/config.fish:
alias ls='lsf'
Then reload:
source ~/.config/fish/config.fish
For Tcsh/Csh users
Add to ~/.cshrc or ~/.tcshrc:
alias ls 'lsf'
Verifying Installation
After installation and alias setup, verify everything works:
# Test the command exists
which lsf
# Test basic functionality
lsf
lsf -la
# If alias is set, test that ls now uses lsf
ls
Troubleshooting
Icons Not Displaying
If icons appear as question marks or boxes, ensure:
- Nerd Fonts are properly installed
- Your terminal supports Nerd Fonts
- Your terminal font is set to a Nerd Font
Alias Not Working
If the alias doesn't work after adding it:
- Make sure to reload your shell configuration (
source ~/.bashrcorsource ~/.zshrc) - Check for syntax errors in the configuration file
- Verify the alias was added correctly by checking the file contents
Permission Errors
If you encounter permission errors during installation, ensure you're using sudo for system-wide installation.
Uninstallation
To uninstall lsf, simply remove the binary:
sudo rm /usr/local/bin/lsf
To also remove the configuration:
rm -rf ~/.config/lsf/
Don't forget to remove the alias from your shell configuration file if you added one.