Skip to main content

Posts

cut command in unix

      Cut Command in Unix ( Linux) Examples Cut command in unix (or linux) is used to select sections of text from each line of files. You can use the cut command to select fields or columns from a line by specifying a delimiter or you can select a portion of text by specifying the range or characters. Basically the cut command slices a line and extracts the text. Unix Cut Command Example We will see the usage of cut command by considering the below text file as an example > cat file.txt unix or linux os is unix good os is linux good os 1.  Write a unix/linux cut command to print characters by position? The cut command can be used to print characters in a line by specifying the position of the characters. To print the characters in a line, use the -c option in cut command cut -c4 file.txt x u l The above cut command prints the fourth character in each line of the file. You can print more than one character at a time ...

bc command in unix

    bc Command   Arithmetic operations are the most common in any kind of programming language. Unix or linux operating system provides the bc command and  expr command  for doing arithmetic calculations. You can use these commands in bash or shell script also for evaluating arithmetic expressions.  Here we will see only about the bc command. The bc command evaluates expressions similar to the c programming language. The bc command supports the following features.  ·                        Arithmetic operators ·                        Increment and decrement operators ·                        Assignment operators ...