LINUX ADMIN

Auto-complete as you type on linux/Mac terminal

We are talking about bash / zsh , yes!

Shaheer

--

Because of how broken our minds are, we have forgotten how to do things we used to be good at. For those with a technical background, this is a realistic situation. If you’re having trouble with Google, man pages are your best bet. However, a one-liner in your Linux/Mac login profile is all it takes to avoid having to remember them. Once you’ve gotten used to it, it’s next to impossible to do without.

I just want to be able to run simple commands like tar, zip, df, free, top, and maybe even git. It takes at least a minute of our time if I don’t already know the options for those commands.

What are we waiting for?

Photo by Axel Brunst on Unsplash

Put an end to all the digging right this minute.

Simply add this entry to your user profile and you’ll be good to go.

Linux (usually in ~/.bashrc)

autoload -U +X bashcompinit && bashcompinit

Mac (~/.zshrc):

autoload -Uz compinit && compinit

then source it to take affect.

$ source ~/.bashrc 
[OR]
$ source ~/.zshrc

I’d be thrilled if this Medium tutorial helped you in some way. I’ll be updating handy guides that you might not find elsewhere on the web as I go along 😜

--

--