this post was submitted on 30 Jul 2023
125 points (96.3% liked)
linuxmemes
24384 readers
914 users here now
Hint: :q!
Sister communities:
Community rules (click to expand)
1. Follow the site-wide rules
- Instance-wide TOS: https://legal.lemmy.world/tos/
- Lemmy code of conduct: https://join-lemmy.org/docs/code_of_conduct.html
2. Be civil
3. Post Linux-related content
sudo
in Windows.4. No recent reposts
5. π¬π§ Language/ΡΠ·ΡΠΊ/Sprache
6. (NEW!) Regarding public figures
We all have our opinions, and certain public figures can be divisive. Keep in mind that this is a community for memes and light-hearted fun, not for airing grievances or leveling accusations.Please report posts and comments that break these rules!
Important: never execute code or follow advice that you don't understand or can't verify, especially here. The word of the day is credibility. This is a meme community -- even the most helpful comments might just be shitposts that can damage your system. Be aware, be smart, don't remove France.
founded 2 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
I think this is an easier way to do it:
add this to a file called .bash_aliases instead (it should be a file right next to .bashrc, if not just create it)
You can add aliases to .bashrc with this, but I personally perfer to have aliases in their own file
Another thing, if you have a console window open while adding it, restart it so that the console is aware of the aliases. Alternatively, google something like "sourcing bashrc" or "sourcing aliases" and apply the commands you find
If you wish to add aliases to a bash script (for later automation), you add these two lines
shopt -s expand_aliases
source ~/.bash_aliases
but of course add this to the top of your bash scripts, so that your script knows to use the bash shell:
#!/bin/bash
This is so great. Thank you.