Today’s tip is a simple one many experienced users will roll their eyes at, but that is because it is so common and handy to use. When watching and helping people new to Linux, I often see them fail to utilize this powerful tool. They struggle to remember file names and commands and it hurts my soul to watch knowing how much easier it could be for them. Knowing how to use this helps you help yourself. There isn’t a day that goes by I don’t use this probably a hundred times.

Tab completion

Tab completion is a powerful feature in the Linux terminal that allows you to quickly complete filenames, directory paths, and commands by pressing the ‘Tab’ key. It can significantly speed up your workflow and reduce the chances of typos.

Benefits of using tab completion:

  • Efficiency: Saves time by reducing typing and minimizing errors.
  • Discoverability: Helps you discover available commands and file/directory names.
  • Accuracy: Reduces typos and potential mistakes.

Using Tab Completion

Completing Commands: Type the start of a command, maybe one you can’t quite remember the name of, and press ‘Tab’ twice to see a list of available commands that match the entered text. If you’ve typed enough that there will only be one option, it’ll complete that one for you.

Completing Filenames and Directories: When typing a file or directory name, press ‘Tab’ to automatically complete the name. If multiple options match, pressing ‘Tab’ twice will display the options.

Navigating Directories: Use tab completion to navigate through directories quickly. For example, type cd /usr/l and press ‘Tab’ to complete to /usr/local/.

Conclusion

It should be noted that tab completion may work slightly different depending on the terminal and other settings you may have. Pressing ‘Tab’ twice may bring up a full menu to select from for available files or directories, for instance. However, this overview provides the gist of how it works for most any system I regularly come across.

4 points

If you feel it lacking remeber that your shell (bash, zsh) is just loading from available functions and completions scripts. Source: https://www.gnu.org/software/bash/manual/html_node/Programmable-Completion.html

permalink
report
reply
4 points

Me guiding newbies on terminal usage:

“Hit tab.”
“Hit tab.”
“Tab.”
“Look, just hit tab every every third keystroke.”
“TAB TAB TAB!”

permalink
report
reply

linux4noobs

!linux4noobs@programming.dev

Create post

linux4noobs


Noob Friendly, Expert Enabling

Whether you’re a seasoned pro or the noobiest of noobs, you’ve found the right place for Linux support and information. With a dedication to supporting free and open source software, this community aims to ensure Linux fits your needs and works for you. From troubleshooting to tutorials, practical tips, news and more, all aspects of Linux are warmly welcomed. Join a community of like-minded enthusiasts and professionals driving Linux’s ongoing evolution.


Seeking Support?
  • Mention your Linux distro and relevant system details.
  • Describe what you’ve tried so far.
  • Share your solution even if you found it yourself.
  • Do not delete your post. This allows other people to see possible solutions if they have a similar problem.
  • Properly format any scripts, code, logs, or error messages.
  • Be mindful to omit any sensitive information such as usernames, passwords, IP addresses, etc.

Community Rules

  • Keep discussions respectful and amiable. This community is a space where individuals may freely inquire, exchange thoughts, express viewpoints, and extend help without encountering belittlement. We were all a noob at one point. Differing opinions and ideas is a normal part of discourse, but it must remain civil. Offenders will be warned and/or removed.
  • Posts must be Linux oriented
  • Spam or affiliate links will not be tolerated.

Community stats

  • 62

    Monthly active users

  • 136

    Posts

  • 1.1K

    Comments

Community moderators