Saturday, February 20, 2021

Updating the bash $PATH variable

 When writing scripts, you usually want to store them in a folder that is defined in the bash $PATH variable. For example, you might want to create a 'bin' directory in your /home/user/ directory. Typing the following command will check to see if the directory already exists and if not it will go ahead and create it:




Here's a great article explaining how to make this PATH variable permanent:


Updating the PATH variable:


Wednesday, February 3, 2021

Login Monitoring

Here are a few helpful commands that will allow you to keep track of user login status of your Linux system. The first two commands are pretty straight forward: whoami and logname 


 



These two commands show that I'm currently working as sziegenbusch. At first glance there doesn't seem to be much difference between these two commands, however, when I switch user to kingtux I can see the difference.

 


 

 

 

 

I run whoami and learn that I'm current using the kingtux account, however, when I run the logname command I see that I'm sziegenbusch.

Another helpful command you can use to display who is logged in and related data (e.g., processes, boot time) is who




You can use the who command with the -a and -H options to see all available information and column headers:





The w command also displays who is logged on and the processes. You can read more information about the w command at The w command. 




The id command will show you a lot of information regarding your current user or an arbitrary user:




Other helpful commands for monitoring log in information are: lastlog, last -F, and lastb.

Saturday, January 30, 2021

Force users to change their linux passwords

Building on the previous post regarding tldr I decided to use the chage command to force a user to change his password. In this example, I'm forcing the user kingtux to change his password at his next login attempt:



Now I'm going to login as kingtux:


 




Now I'm going to force the user kingtux to change his password using the passwd command:


 



Now I'll log in kingtux again:






The nice thing about Linux is that there is usually more than one way to get a job done. Use either: chage or passwd to force users to change their passwords.

Installing tldr on CS8

I installed a nice little application called "tldr." You can think of it as  "man pages" lite. In order to install it I had to install nodeJS and npm first. I followed the procedures on this page:

nodeJS and npm

-----------------------------------

Then I installed tldr following these directions:

Tecmint tldr

----------------------------------

Here's a screen shot of using tldr to lookup help for the chage command:


Thursday, January 28, 2021

Centos Stream 8

 I loaded Centos Stream 8 (CS8) today in order to learn RHEL using RHEL closest clone out there. Here's what I've done so far: 

1) I downloaded and installed CS8 in VirtualBox, 

2) I ran # dnf check-update and dnf update

3) installed VB Guest Additions using the procedure found on:

Tecmint How-Tos



Sunday, January 24, 2021

Setting the "hostname" of the machine.

 Here's a good article by Red Hat that list seven ways to set a machine's hostname:

Update hostnames

When just using: hostnamectl with no arguments you get this print out:




Saturday, January 23, 2021

Ret Hat Certification

I've decided that I need a new challenge, specifically, I want to achieve a Red Hat Linux certification. I want to achieve the Red Hat Certified System Administrator (RHCSA) credential. To that end, I've ordered a Red Hat Enterprise Linux 8 (UPDATED): Training and Exam Preparation Guide (EX200), Second Edition that should be here today. LinkedIn Learning also has a 5.5 hour course on RHCSA that I plan to take. I'm only doing this to keep my mind occupied and sharp.

Thursday, January 21, 2021

The bash Shell

There is a lot of misunderstanding when it comes to what the bash shell is and is not.  The bash shell is not "Linux." The bash shell lets a user interact with Linux by typing Linux commands into bash and then bash executes the commands by handing them off to the Linux kernel. Over the next several post I will explorer the bash shell with the goal of being able to clearly explain how it operates.

Sunday, January 17, 2021

Double quotes in a script

Using double quotes while referencing (using a value of a variable) helps to prevent word splitting (regarding white space) and unnecessary globbing (recognizing and expanding wildcards. Check out this script:















Pay close attention to the remarks embedded in the script as they tell you what is happening. After running the script, this is the results:

Welcome Back to Linux Quick Notes!

Hello and welcome to the relaunched Linux Quick Notes! I’m Steven, and I’m thrilled to revive this blog, originally created four years ago d...