🔹 Introduction:
Every morning, we grab our phones and open a weather app. But ever since I started my 30-day Linux challenge, I’ve been doing it differently.
🌧️☀️ I check the weather… from the terminal. Yes, the terminal!
Here’s how you can look like a hacker while checking if you need an umbrella.
😎
🔹 Step-by-Step Tutorial (With Code Blocks)
Let’s get into how you can check the weather right from your Linux terminal. No weather apps, no browser — just pure terminal magic. 🧙♂️⚡
✅ Step 1: Open Your Terminal
You can open it by pressing:
✅ Step 2: Use curl with wttr.in
This command shows you the weather forecast in your current city using the terminal:
✅ Step 3: Check Weather for a Specific City
Want to check the weather in Delhi, UK, or USA? Just add the city name:
✅ Step 4: Customize the Output
🎯 Metric Units (Celsius)
🧼 No ASCII Graphics (Plain Output)
✅ Step 5: Create a Weather Shortcut (Alias)
Want to type weather instead of writing the full command every time?
Add this line to your .bashrc or .zshrc file. In my Case, I'm using .zshrc file.
- Edit your .zshrc file with nano ~/.zshrc.
- Add the alias to .zshrc with alias weather="curl wttr.in"
- Save and exit the editor
- Press Ctrl + X to exit.
- Press Y to confirm changes.
- Press Enter to save the file.
To write something in the terminal or display text, you can use commands like:
- echo: For printing messages.
- cat >: To write multiple lines into a file.
- nano: For directly editing files in the terminal.
- tee: For displaying text and saving it to a file simultaneously.
These simple commands let you write, edit, and manage text efficiently from the terminal.
#30DaysLinuxChallenge #CloudWhisler
DevOps #Linux #RHCSA #Opensource #AWS #CloudComputing
Catch out by My LinkedIn profile
https://www.linkedin.com/in/rajpreet-gill-4569b4161/