AWK – Linux text processor

Summary:

AWK –  is the text processor and original from AT&T and it is excellent tool for processing rows and columns and it is always quit easy to report

Structure of the program is as follows,

#awk ‘{print}’ filename ===> “AWK”  is the command followed by pattern and action on the file  For Example

#awk ‘{print}’ /etc/passwd ==> It will print all the characters from the file /etc/passwd

#awk ‘/[0-9]/ {print }’ /etc/passwd ==> It will print all the numerical characters from the file /etc/passwd

 

 

Environment Path in Ubuntu

Summary:

If we would like to add our additional path to your our current profile and not for all other users in a Ubuntu Machine, then we need to put it at the end of the ~/.profile

For example (Assume that we are adding variable path in /opt directory)

PATH="/opt/varpath:$PATH"
PATH="$PATH:/opt/varpath"

it will have the highest priority and executables in that location will override all others. If you add your path on the right, it will have the lowest priority and executables from the other locations will be preferred.

sudo cp /etc/environment /etc/environment.bak
sudo nano /etc/environment
PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games"
Also Refer the link: https://askubuntu.com/questions/500775/permanent-path-variable