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.
Debian PS1 for a normal user (as seen to the right)
As requested, I have created a place for my projects on my site. Please feel free to follow me as I work through them. They are not projects that I am taking on professionally. They are completely for fun, and with no expectation or time limits. That being said, I am a huge supporter of open source.
So in that spirit, I will be posting all functional code when I feel its ready to be used. I am always open to ideas/suggestions. Feel free to contact me via my Contacts page any time.
Not that I have them daily, but I might if I get a good response.
Have you ever tried logging into an SSH server, and get a weird error:
/.ssh/config: line 22: Bad configuration option: 342200202
This is a very simple issue but it can be a huge PITA if you can’t fix it quickly. This is especially true for those of us that have to use an enormous amount of keys in our daily lives. I know, I have a fairly simple config for SSH, but I still ran into this issue when I pasted a block of text in ~/.ssh/config. I opened the file with VI, and NANO. I was only able to get it to work when I removed the spaces before each line it complained about. I then just put them back as normal, and saved.
It turns out, that copying from another place can have the spaces not interpreted properly. They are tabbed indentations actually. Once manually removed they are replaced by a normal “space” in the code and it should work properly. I hope this saves some time for some people.