Category Archives: Basics

How to Remove ^M in Linux & Unix

Control M ( ^M)  characters are introduced when you use  lines of text from a windows computer to  Linux or Unix machine.  Most common reasons are when you directly copy a file from a windows system or submit form data copied and pasted from a windows machine.

Detecting ^M characters

^M is non printable character and often becomes difficult to find, in order to see if your file contains any non printable character use the cat command with -v option

$cat -v filename

Methods to remove ^M

In all these method , real secret is not to type ^M using keyboard but rather typing in control key sequence to get the ^M control character.

Bash Positional Parameters, Arguments

Bash Shell has several special positional parameters which can be referenced but can not be assigned. These bash parameters are used to process command line arguments in a bash shell script, to get process status, exit status and options flag.

These bash positional parameters can be assigned to a variable and values can be used for further processing.

 $0 , $1 $2 $3 … bash Parameters

These are special parameters and has specific meaning according to the number.  These parameters are useful if you want to validate executing file name and do the processing based on the arguments.

$0 : bash Shell argument 0, It expands into bash script file name or bash shell.

$1 $2 $3 …   : bash shell argument number : Used to get the specific argument from the script.

for example let’s create & execute the test script with some parameters and note the bash arguments supplied as parameters :

find command : Top 14 Ways to find files in Unix and Linux

find command is one of the important command in Unix and Linux used to locate the program, text,  data , log config files for execution, viewing ,  editing  renaming deleting etc. etc.

find command can find files based on many file attributes besides just the file name and here are the fifteen file  attributes which you can use to find a file or files and here are 14 ways to find files in your unix and linux system.

Red Hat 7.x Installation : Step by Step Guide

Installation and Configuration of RHEL 7.x
Learn about Installation and initial configuration of Red Hat Enterprise Linux, RHEL 7.3
For this Linux step by step installation guide we will use RHEL 7.3  64Bit iso image, the installation procedure is same for all RHEL 7.x releases in case you want to use a different RHEL version to install.

Here are the 10 Steps to Install RHEL 7.x distribution.

chmod Quick Referance with Examples

What is chmod ?

chmod ( Change Mode ) is a command line utility in Unix , Linux and other Unix like systems to change the read, write, execute permissions of a file for owner , group and others.

How to use chmod?

Chmod command is used in two ways :
1. Using octal value & position : Sets the permission for owner, group and others with octal values , 4 for read , 2 for write , 1 for execute and any sum of these number to get cumulative permissions.