4 New HowTos in HowTo Geek
-
HowTo Geek ☛ You Can't Use logout in a Bash Script, So Use These Workarounds
The Linux logout command doesn’t work inside Bash scripts. It’s rare but, occasionally, you may need that functionality. Here are three ways to sidestep the issue and log out from a script.
[...]
There are login shells and non-login shells. The very first shell that is created when you log in is a login shell. All other shells are not login shells. The differences between the two types of shell stem from the different system files that are read by the shell as it is created.
Plainly, you can’t log out of a non-login shell. If a shell has no concept of logging in, it can’t log you out.
Shell scripts don’t run in the shell they’re launched from. A new shell is spawned for them to run in. Even if they were launched from a login shell, they don’t run in a login shell.
We can see this quite easily. This is the login prompt of a computer running Arch Linux, without any graphical desktop environment installed. It's using the Bash shell. I’ve logged in, and I’m about to hit Enter on the logout command.
-
HowTo Geek ☛ How to Use the htop Command on Linux
The htop system monitor program gives you clear insights into the processes running on your Linux computer, and some functions to manage those processes. Here’s how to use this colorful administrative tool.
-
HowTo Geek ☛ What is LUKS, and How Does It Secure Your Linux File System?
Came across the term "LUKS" but don't know what it does or how it relates to Linux? If you're someone concerned about safeguarding your data, then having LUKS set up is essential for you. In this guide, I'll explain how LUKS works and how it helps you secure your important data.
-
HowTo Geek ☛ Shell Scripting Is Still Relevant! 7 Reasons to Learn Bash Scripting
Shell scripting is a lot more powerful than many people realize. With the right commands, shell scripting can automate many tasks and even make life easier for the user. Here's why you shouldn't sleep on bash scripting and why it's worth learning.