Welcome to a little tour of some underrated but very useful Linux goodies. Whether you're new to the terminal or just polishing your skills β this post is for you! π§π
πΉ 1. Aliases in Linux
π Whatβs an alias?
Aliases are shortcuts for long commands. They save time and prevent finger fatigue (yes, that's a thing! π
).
alias ll='ls -lah'
alias gs='git status'
So if you run ll
in your terminal in backend ls -lah will be running,but if you close the terminal all aliases will be removed.
π§ Pro Tip:
Make aliases permanent by adding them to your ~/.bashrc
or ~/.bash_aliases
file:
echo "alias ..='cd ..'" >> ~/.bashrc
source ~/.bashrc (this is to reload the terminal)
πΉ 2. MOTD β Message of the Day
Ever wonder what that message is when you SSH into a server? Thatβs the MOTD (Message of the Day). Itβs like a welcome banner, but nerdier. π€
π Location:
- Static MOTD:
/etc/motd
- Dynamic MOTD (Ubuntu):
/etc/update-motd.d/
βοΈ Edit the MOTD:
sudo nano /etc/motd
π« Disable Dynamic MOTD:
sudo chmod -x /etc/update-motd.d/*
πΉ 3. Variables in Linux π§ͺ
Variables in Linux are like containers π§Ί that store values β super useful in scripting.
name="sahil"
echo "Hello $name" # Outputs: Hello sahil
π Remember:
- No spaces around
=
when assigning. - Use
$variable_name
to access the value.
This is also where quote types matter! π
πΉ 4. Types of Quotes in Linux
πΈ Single Quotes ' '
Treat everything literally.
echo 'Today is $DATE' # Output: Today is $DATE
πΈ Double Quotes " "
Expand variables.
echo "Today is $DATE" # Output: Today is Thu Jul 17
πΈ Backticks ` ` or $(...)
Used for command substitution β execute commands inside strings.
echo "Today is $(date)" # Output: Today is Thu Jul 17 ...
echo "Today's date is: `date`"
Today's date is: Thursday 17 July 2025 09:52:35 AM IST
We generally use "$()" in most cases in-order to avoid conflicts.
πΉ 5. Common Issues π΅βπ«
Issue | Cause | Fix |
---|---|---|
command not found |
Typo or missing software | Check spelling or install the package |
Permission denied |
File not executable | Use chmod +x file.sh or sudo
|
Script doesnβt run | Wrong shebang or no permissions | Add #!/bin/bash and make it executable |
$PATH issues |
Custom scripts not working | Add path to .bashrc : export PATH=$PATH:/my/scripts
|
π― Final Thoughts
Linux is powerful, but the magic often lies in the little things. Mastering aliases, variables, and quote types can take your terminal game from βmehβ to βmasterβ. π
Got feedback or other tips? Drop them below! ππ¬
Happy terminaling! π₯οΈπ§π
Top comments (0)