Uploaded January 2026 | Updated September 2026, 2 weeks ago
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.
*⚙️ Grab Jay’s actual Dotfiles!*
For a small donation, grab a zip file full of configs for Bash, ZSH, Vim, Tmux, i3, Sway (and more)! Curated over a decade, there’s something for everyone.
- Download here ➜ learnlinux.link/jay-dotfiles
*📖 Switch to Linux with My Latest Book*
Thinking about making the jump to Linux? This step-by-step guide will help you choose the right distribution and install Linux with confidence.
- Start your Linux journey here ➜ learnlinux.link/switch-to-linux
*🐧 Save up to 30% on Linux Foundation Certifications*
Whether you're starting a Linux career or advancing your existing skills, Linux Foundation training can help you stand out in a competitive industry. Check out the available courses and certifications, and save!
learnlinux.link/get-certified
*🐧 Get a "Linux Tips" Newsletter*
Packed with expert tips and strategies, for both desktop and server users. Get yours here:
- Subscribe here ➜ learnlinux.link/linux-tips
*📚 Discounts, Courses, Books, and More! (Support Linux Learning)*
- 10% Off Linux Swag! ➜ learnlinux.link/swag
- Get the "Linux Pro-Tips" Newsletter ➜ learnlinux.link/linux-tips
- Grab Jay's *ACTUAL* Dotfiles! ➜ learnlinux.link/linux-tips
- Switching to Linux Book (15% Off!) ➜ learnlinux.link/switch-to-linux
- Linode Starter Credit ➜ learnlinux.link/linode
- eBook Bundle ➜ learnlinux.link/ebook-bundle
- Ansible Course ➜ learnlinux.link/ansible
- Linux Essentials Course ➜ learnlinux.link/linux-essentials
- Paid Assistance ➜ learnlinux.tv/request-assistance
*❤️ Support the Channel*
- Enjoyed the video? Your support keeps this channel independent!
- Become a Channel Member (Ad-Free & Early Access) ➜ learnlinux.link/join
- Support on Patreon ➜ learnlinux.link/patron
*🌐 Video-specific Links*
- "cd" Function code ➜ learnlinux.link/cd-function
- "extract" Function code ➜ learnlinux.link/extract-function
━━━━━━━━━━━━━━━━━━━━━━
🕐 Time Codes
00:00 – Bash Trick: Auto-ls When Changing Directories
01:25 – Override cd with a Custom Bash Function
05:20 – Support Learn Linux TV and grab some Linux Swag
06:45 – Bonus: Create an extract Function in Bash
*🎓 Learn Linux TV*
Your source for Linux-related Fun and Learning!
- Official website: learnlinux.tv
- Community Forums: community.learnlinux.tv
- Official Subreddit: learnlinux.link/reddit
- Facebook Community: learnlinux.link/facebook-group
- More about Jay: learnlinux.link/jay
*🤝 Affiliate and Content Ethics*
Some links in this description are affiliate links. If you purchase through them, Learn Linux TV may earn a commission at no additional cost to you. This helps keep the content flowing.
- learnlinux.tv/content-ethics
*⚠️ Use Content Responsibly*
Learn Linux TV shares technical content intended to teach and help you, but it comes with no warranty. The channel is not liable for damages resulting from its use. Always ensure you have proper permission, follow organizational policies, protect important data, and comply with applicable laws.
#Linux #commandline #linuxterminal
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.
*⚙️ Grab Jay’s actual Dotfiles!*
For a small donation, grab a zip file full of configs for Bash, ZSH, Vim, Tmux, i3, Sway (and more)! Curated over a decade, there’s something for everyone.
- Download here ➜ learnlinux.link/jay-dotfiles
*📖 Switch to Linux with My Latest Book*
Thinking about making the jump to Linux? This step-by-step guide will help you choose the right distribution and install Linux with confidence.
- Start your Linux journey here ➜ learnlinux.link/switch-to-linux
*🐧 Save up to 30% on Linux Foundation Certifications*
Whether you're starting a Linux career or advancing your existing skills, Linux Foundation training can help you stand out in a competitive industry. Check out the available courses and certifications, and save!
learnlinux.link/get-certified
*🐧 Get a "Linux Tips" Newsletter*
Packed with expert tips and strategies, for both desktop and server users. Get yours here:
- Subscribe here ➜ learnlinux.link/linux-tips
*📚 Discounts, Courses, Books, and More! (Support Linux Learning)*
- 10% Off Linux Swag! ➜ learnlinux.link/swag
- Get the "Linux Pro-Tips" Newsletter ➜ learnlinux.link/linux-tips
- Grab Jay's *ACTUAL* Dotfiles! ➜ learnlinux.link/linux-tips
- Switching to Linux Book (15% Off!) ➜ learnlinux.link/switch-to-linux
- Linode Starter Credit ➜ learnlinux.link/linode
- eBook Bundle ➜ learnlinux.link/ebook-bundle
- Ansible Course ➜ learnlinux.link/ansible
- Linux Essentials Course ➜ learnlinux.link/linux-essentials
- Paid Assistance ➜ learnlinux.tv/request-assistance
*❤️ Support the Channel*
- Enjoyed the video? Your support keeps this channel independent!
- Become a Channel Member (Ad-Free & Early Access) ➜ learnlinux.link/join
- Support on Patreon ➜ learnlinux.link/patron
*🌐 Video-specific Links*
- "cd" Function code ➜ learnlinux.link/cd-function
- "extract" Function code ➜ learnlinux.link/extract-function
━━━━━━━━━━━━━━━━━━━━━━
🕐 Time Codes
00:00 – Bash Trick: Auto-ls When Changing Directories
01:25 – Override cd with a Custom Bash Function
05:20 – Support Learn Linux TV and grab some Linux Swag
06:45 – Bonus: Create an extract Function in Bash
*🎓 Learn Linux TV*
Your source for Linux-related Fun and Learning!
- Official website: learnlinux.tv
- Community Forums: community.learnlinux.tv
- Official Subreddit: learnlinux.link/reddit
- Facebook Community: learnlinux.link/facebook-group
- More about Jay: learnlinux.link/jay
*🤝 Affiliate and Content Ethics*
Some links in this description are affiliate links. If you purchase through them, Learn Linux TV may earn a commission at no additional cost to you. This helps keep the content flowing.
- learnlinux.tv/content-ethics
*⚠️ Use Content Responsibly*
Learn Linux TV shares technical content intended to teach and help you, but it comes with no warranty. The channel is not liable for damages resulting from its use. Always ensure you have proper permission, follow organizational policies, protect important data, and comply with applicable laws.
#Linux #commandline #linuxterminal










