Simplify Your Browsing: Open Firefox URLs with Aliases in Terminal

Simplify Your Browsing: Open Firefox URLs with Aliases in Terminal

6 min read

So there I was, sitting at the airport terminal, laptop out and Chrome up and running. A sudden need to open a URL in Firefox hit me, and I couldn't help but think, "Wouldn't it be cool to just whip up a Firefox window with that URL straight from my terminal?" That lightbulb moment turned into a mini-mission for me. Why toggle through screens and clicks when a simple terminal command could do the trick?

This article is all about bringing that cool, 'aha' moment to life for you. If you're into making your tech life just a bit more slick and fun, you're definitely going to enjoy this productivity hack. Let's dive into how this little idea from an airport terminal can add a nifty twist to your digital routine!

Let's deconstruct the process in steps:

  • โผป Open up terminal
  • โผป Check Firefox installation
  • โผป Edit .bashrc or .zshrc
  • โผป Playing around
  • โผป Getting fancy with it

Before we start with the crazy terminal hackaroo I suppose you have Firefox or Firefox developer edition installed.

โผป Open up terminal

I made this a step because I wanted to shout out to this article iterm2 your mac's terminal upgraded, and just let you know that you can easily upgrade your MacBook's built-in terminal very easily to a crazy efficient tool! That was the shout-out! Now just open your terminal ๐Ÿคฃ !

โผป Check Firefox installation

After some minor searching around ways to do that directly from the terminal, I found that the best way is using the system_profiler command.

system_profiler SPApplicationsDataType | grep Firefox

Location: /Users/d3ad_r1nger/Library/Application Support/Firefox/Profiles/
    Firefox Developer Edition:
      Location: /Applications/Firefox Developer
      Get Info String: Firefox Developer Edition 123.0

The output indicates that the "Firefox Developer Edition" is installed on my system, located in the /Applications directory, with version 123.0. Additionally, there's a reference to a Firefox profile or data directory located under the user's Library/Application Support/Firefox path, specifically within a development edition profile storage.

โผป Edit .bashrc or .zshrc

Depending on what you use (I use zsh) edit the appropriate file.

nano ~/.zshrc 

Add the following snippet to the end of your file.

# functions
fire() {
    open -a "Firefox Developer Edition" "https://$1"

Save and exit the editor ctrl + x then press y.

๐Ÿ“ Sidenote You noticed that I use "Firefox Developer Edition" in the command. This is just the Firefox version I have installed. If you installed the simple Firefox version just add "Firefox". Just needed to clarify that to ease confusement!

Apply the changes by sourcing your profile or rc file:

source ~/.zshrc

โผป Playing around

Now you can just type fire and see your Firefox open up, navigating you to Sudorealmโœจ! Also if you type fire you see that it just opens up a new tab to your already open Firefox window. How cool is that dude?

yeah bro!

Getting fancy with it

I just can't stop at that point. There's this itch that I have to scratch, pushing the boundaries of what's possible with a simple terminal command. Why settle for just opening URLs when we can turn the dial up a notch? Here's how you can set this up to open multiple space-separated files or URLs in Firefox, all in one go. ๐Ÿ”ฅ

# functions
fire() {
    for url in "$@"; do
        open -a "Firefox Developer Edition" "https://$url"

Now we have unlocked a newfound power in our terminal! By just typing:


Firefox will open everything all at once! I love it! Take a look! ๐Ÿ‘€

the sudorealm way of opening links with firefox

You can do much more with that if you are curious enough, you can grab an idea from this article too: From Frustration to Efficiency: My Experience with Aliases on Mac Terminal. In that article I play around with aliases.

I might even create a new alias, now that I think about it, like insta that would immediately open Instagram for me. ๐Ÿคช

๐Ÿ“ Another sidenote This entire tutorial might also work with other browsers and there are many crazy combinations that you could try, but I am too lazy to think of any of them. so go at it! Maybe create an article about it here? ๐Ÿค”

Conclusions and Thoughts

And there you have it, folksโ€”a journey from a simple 'aha' moment at an airport terminal to unlocking some pretty nifty tricks in your own terminal. Who knew a bit of waiting around with your laptop could lead to such a cool hack? By now, you've got the know-how to not only open URLs in Firefox with a simple command but also to juggle multiple sites like a digital juggler, all from the comfort of your command line.

This little adventure into the world of terminal commands and aliases shows that with a pinch of curiosity and a dash of creativity, the mundane can turn into something quite magical. It's more than just opening websites; it's about tailoring your tools to fit your workflow, making your digital life not just efficient, but also a bit more fun.

So, next time you're caught in a moment of downtime, maybe while waiting for a flight or just taking a break, remember that these are opportunities to explore, to tinker, and to perhaps stumble upon your next great hack. And who knows? Maybe your newfound command line prowess will inspire your next big idea or simply make your day-to-day a tad easier.

Don't forget to share your terminal triumphs and tips with the community. After all, sharing is caring, especially when it comes to cool hacks like these. Until then, happy hacking, and may your digital explorations bring you plenty of delightful surprises! ๐Ÿš€

๐Ÿš€ Spread the Love & Support the Realm

Hey there, fellow Realmer! If this guide illuminated a new path in your coder/hacker journey, your support would mean a lot. Every bit of magic helps.

Spread the Love

๐Ÿ‘‘ Crown & Share: If you found value in this post, please give it a crown and share it with your fellow coder/hacker enthusiasts. Spreading knowledge is what Sudorealm is all about! Fun fact the Author with the most crowns inside a realm will be crowned as the Realm King! ๐Ÿคด

๐Ÿ†‡ X Shoutout: Feeling extra grateful or have some cool feedback? Drop me a shoutout on Twitter โ€“ I'd love to hear from you! d3adR1nger on X

๐Ÿ’ฌ Join our Discord Server: Join the Sudorealm Discord Server connect with fellow enthusiasts and chat about everything that fascinates you! From new blog post suggestions to seeking support on tricky tutorials. Come, share your ideas, and let's grow together! ๐Ÿš€๐ŸŒ

Support the Realm

๐Ÿ› Affiliate Treasures Below: Dive into the depths below the post to uncover some affiliate products I've curated just for you. It's a great way to support the realm and discover some nerdy treasures.

Affiliate Links

Check out what d3ad R1nger suggests for Simplify Your Browsing: Open Firefox URLs with Aliases in Terminal!

Related Posts

Thirsty for more? Check out Sudorealm-related posts!

Ready to Forge an Alliance

Join our alliance and play a pivotal role in the evolution of our digital realm! By aligning with our pricing model, you're not just accessing premium features; you're becoming an integral part of our journey. As an ally, your support propels us forward, ensuring we continue to innovate and thrive.

Lifetime membership

As valued allies, exclusive content awaits you ๐Ÿ‘€. Unlock a suite of premium features and gain early access to ally-only enhancements in our realm. With our month-by-month commitment, you're always privy to our most coveted updates!

What's included

  • Premium Content Access
  • Ally resources + Unique Ally Badge
  • Access to Affiliate store front ๐Ÿค‘ (๐Ÿ”ฎ)
  • More to come...

It's like buying a pint ๐Ÿบ. But less!

โ‚ฌ1.99 EUR

Forge Alliance

Invoices and receipts available for easy company reimbursement

Subscribe to our newsletter.

๐Ÿ‘‹ Hey there, Realmer! Fancy getting a byte of nerdy knowledge straight to your inbox? Subscribe to our Sudorealm newsletter and don't miss a single trick from our growing community of curious minds! Ready to level up your knowledge game? Join us in the Realm today!

Be one of the privileged few
Think of it as your VIP pass into the Realm where you'll get first dibs on new features, insider updates, and more.
No spam
And, worry not, we promise not to spam โ€“ just top-tier, brain-tickling content.