The /etc/shells file

As you know, all the files from /etc are very important for the Unix / Linux systems. The /etc/shells file contains a list of all the shells available in the system. Sample of /etc/shells file: $ cat /etc/shells # /etc/shells:

How to unalias an alias

It is very usefull to know how to temporary unalias an alias. There are some cases when you really need to do that, in your Linux / Unix box. I will explain this with a practical example: I have aliased

How to debug shell scripts

Every bash coder should know how to debug its own scripts, in order to repair the unwanted mistakes. The debugging mode can be activated inside the shell script, or used at invokation. How to debug a bash script at invokation:

How to insert comments in shell scripts

In shell scripting, # is used for inserting comments. Every line beginning with # (except the shebang #!) will not be executed! # this is a commented line! Comments can also occur following the end of a command. echo “hello”

How to locate files and folders in Unix / Linux

In Unix and Linux systems, there are a few commands for finding files and folders. The most used are find and locate. In this article I will show you how to use locate properly, in order to find the files

How to use whereis to find command binariers and man pages

whereis is used for locating a file’s binary, source and its associated man page, in Unix and Linux. It is easy to use and displays a short output: $ whereis bash bash: /bin/bash /etc/bash.bashrc /usr/share/man/man1/bash.1.gz If you need to find

The first step in learning shell scripting

In this article I will explain you what the sha-bang (also known as shebang) is and will create and exec the Hello World script. What is the sha-bang (shebang)? The shebang is the “#!” at the head of your script.

Why to learn shell scripting?

There is a geek proverb saying “If you need to do a thing more than once, script it!“. A good sysadmin creates and uses a lot of scripts every day, in order to do its daily tasks easier next time.

How to grab process IDs (PIDs) in Linux / Unix

An user can send signals to processes by using the process ID (PID) or the process name. In this article I will show you how to grab the PIDs with pgrep and pidof. How to get a process ID (PID)

How to display process hierarchies with pstree in Linux

Pstree is a nice tool for listing process hierarchies. All the processes in the system can be displayed also by the ps command, but in some cases you may need to get a hierarchical process list. Used without any arguments,

Support LinuxG via Patreon
Support LinuxG.net on Patreon!
Subscribe

  

Subscribe to get the latest Linux news and how to guides directly on your e-mail!