In the GNOME Terminal, Bash does smart auto-completion. For example
apt-get in
becomes
apt-get install >
apt-get install
I use helm mode. It's has this functionality (after press "TAB"):