How to Count String Occurrences in a Text File

The GUI text editor gives you a separate panel in the footer to inform you of the number of words, lines, and characters in your text file. Even though you can easily find the number of strings that occurred in your text file using this

How to Shrink Long or Multiple Commands into a Single Short Command

Do you still type the long “sudo apt update && sudo apt upgrade -y” commands each time you want to update your Debian-based system? Or are you still navigating into directories (ex: “/var/www/html“) using the cd command each time you have to modify something there?

How to Add a Directory to the $PATH Variable in Linux

In Linux, whenever you want to execute any executable program or script, you need to jump into the directory and execute your program or script. But when you execute system commands like ls, pwd, echo, apt, and nano, you don’t need to jump into any

How to Set and List Environment Variables in Linux

The environment variables are a set of key-value pairs that define the shell environment and can affect the behavior of the ongoing programs that are executed in the current shell session. The programs running in the current shell session can access the variable values from

Different Ways to Search Files or Directories on Linux

In Linux, you have multiple tools that can help you find the absolute path for files and directories in your system. Today, you’ll learn about those tools from basic to advanced, including their pros and cons to help you easily distinguish between them and decide

How to Force User to Change Their Password on Next Login in Linux

When you create a new user account and set a password for that account, the “password expires” status is set to never (ex: 0). Apart from that, the “password inactive” and “account expires” statuses are also set to never, and your last password change will