Alternatives to cd/ls for command line navigation?

8,381

Solution 1

Midnight Commander (mc) is one such tool that I'm aware of.

Solution 2

I suggest you to look at:

  • readline setting completion-ignore-case (Off)

    If set to On, readline performs filename matching and completion in a case-insensitive fashion.

  • shopt -s autocd

    If set, a command name that is the name of a directory is executed as if it were the argument to the cd command. This option is only used by interactive shells.

  • shopt -s globstar

    This example will recursively find all csproj files in the current directory and subdirectories:

    git commit -m update -- **/*.csproj`
    
  • shell options extglob, and nocaseglob

    for obvious purposes, see man bash

  • the CDPATH variable

    cd [-L|-P] [dir]

      [...] The variable `CDPATH` defines the search path for the 
      directory containing dir. [...] If dir begins with a slash 
      (`/`), then `CDPATH` is not used
    

Solution 3

If you're a vim fan, you might also check out vifm, which "is a ncurses based file manager with vi like keybindings. If you use vi, vifm gives you complete keyboard control over your files without having to learn a new set of commands."

Share:
8,381

Related videos on Youtube

Gabe Durazo
Author by

Gabe Durazo

Updated on September 18, 2022

Comments

  • Gabe Durazo
    Gabe Durazo almost 2 years

    I generally work a fair amount from the command line in order to launch vim, git, ssh and so on. However, I find the Finder's columnar view more natural for browsing through my files. Unfortunately, it's less natural for everything I want to do with the files.

    What about the best of both worlds? Are there any popular command line programs / commands out there that deviate from the standard set by the venerable cd and ls for navigating and browsing files in the terminal? I'm sure people must have tried interesting ways of visualizing files, opening folders, etc.

    • Admin
      Admin almost 13 years
      I once patched bash. When you pressed tab you could select the dir/file from an ncurses dialog. for some tasks it was really great for others quite annoying.
  • jeka
    jeka almost 13 years
    Interesting. I just installed it with homebrew and it certainly is an alternative to cd and ls. I'll keep playing around with it; not sure if it's any more useful or natural. Thanks for the excellent answer.
  • user72923
    user72923 about 12 years
    +1 for installing it with Homebrew. Mac users: Just type "brew install mc"