Linux Today: Linux News On Internet Time.
Search Linux Today
Linux News Sections:  Developer -  High Performance -  Infrastructure -  IT Management -  Security -  Storage -
Linux Today Navigation
LT Home
Contribute
Contribute
Link to Us
Linux Jobs


More on LinuxToday


A Look at the Compgen Bash Builtin

Sep 14, 2011, 21:00 (0 Talkback[s])

"To get everybody up to speed--when I say completions, what I mean is command names, paths, and so on, that might be completed when given a part of a string. For example when you're typing a command and start with "apr", you could get apropos on an Ubuntu system.

To figure this out using compgen you could use compgen -c | grep apr. To quickly figure out all directories, you could cd to in a directory, just use compgen -d. (Or compgen -d | sort if you want a neat list…)

Complete Story

Related Stories: