Alternatives to cd/ls for command line navigation?
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
, andnocaseglob
for obvious purposes, see
man bash
-
the
CDPATH
variablecd [-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."
Related videos on Youtube
Gabe Durazo
Updated on September 18, 2022Comments
-
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
andls
for navigating and browsing files in the terminal? I'm sure people must have tried interesting ways of visualizing files, opening folders, etc.-
Admin almost 13 yearsI 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 almost 13 yearsInteresting. 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 about 12 years+1 for installing it with Homebrew. Mac users: Just type "brew install mc"