πΉ 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.
π
πΉ What Youβll Learn:
πΉ 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/
Top comments (0)