This Bash Trick Makes cd Much More Useful

Did you know you can make Bash automatically run ls every time you use cd? In this video, I show a simple but powerful Bash trick that improves your Linux command-line workflow by automatically listing files whenever you change directories.

We start by creating a custom cd function in Bash, then I walk through exactly how it works so you understand what’s happening behind the scenes. This approach helps you learn more about Bash functions, shell behavior, and how to customize your terminal in a practical, real-world way. Once you’ve set this up, navigating directories becomes faster and more informative, especially when working in complex file structures.

As a bonus, I also demonstrate how to create a reusable extract function that can automatically unpack many common archive formats from the command line, saving you even more time.

If you’re looking for useful Bash tips, want to customize your Linux terminal, or enjoy learning small tricks that improve productivity, this video is for you.

YouTube player

Video-specific Links