Everyone has seen these “Top 50 commands” blah blah blah….. #clickbait….
I am writing this just to make BASH a much more pleasant experience for people new and old to Linux. It is also for any sysadmin that has simply not been introduced to some of them.
I could list tons of them, but that’s going to get a simple TL;DR for most people. Then they will move on. So I will list a few and lets let those digest. Keep in mind all commands are in Linux, and may vary by distribution.
First BASH tips (Simple, but time savers):
- Type ‘cd’ and you will go to your home directory for the user you are logged into.
- Similar to “cd” ~, however ~ can sometimes rely on the environment.
- To return to the previous directory you can type ” cd -“.
- This will return you to your previous location, not home.
- Type “tailf”, instead of “tail f” for the same results.
- Also, “tail -200” can be used instead of “tail -n 200”
- Use a custom “PS1” for root, and regular users.
- A “PS1” is the text in the login prompt. See Example to the right:
- Notice it is yellow
- Do the same but in red for root.
- Examples:
- A “PS1” is the text in the login prompt. See Example to the right:
I think that is enough for today, I hope this helps make BASH your friend.
-M