Linux Today: Linux News On Internet Time.

More on LinuxToday

A Look at the Compgen Bash Builtin

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


Desktop-as-a-Service Designed for Any Cloud ? Nutanix Frame

"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: