input file

I‘d like to skip first two or three fields at the the beginning of a line and print the rest of line. Consider the following input:

This is a test
Giving back more than we take

I want my input file with the following output:

a test
more than we take

How do I printing lines from the nth field using awk under UNIX or Linux operating systems?

{ 1 comment }

Bash Shell: Extract Digits From a String

by Vivek Gite on February 16, 2011 · 9 comments

How do I extract digits only from a given string under Bash shell?

{ 9 comments }

I‘m an extreme newbie to the Linux world, but any time I try to get play files according to a playlist file using mplayer command line it turns up this error:

$ mplayer playlist.m3u
MPlayer SVN-r1.0~rc3+svn20090426-4.4.3 (C) 2000-2009 MPlayer Team
mplayer: could not connect to socket
mplayer: No such file or directory
Failed to open LIRC support. You will not be able to use your remote control.

Playing playlist.m3u.
Cache fill: 0.00% (44 bytes)

Exiting… (End of file)

How do I fix this and play music without using GUI tools?

{ 2 comments }

Grep From Files and Display the File Name

by Vivek Gite on September 13, 2010 · 7 comments

How do I grep from a number of files and display the file name only?

{ 7 comments }

How do convert tabs to spaces in a file using a bash shell?

{ 4 comments }

Grep Count Lines If a String / Word Matches

by Vivek Gite on February 18, 2010 · 0 comments

How do I count lines if given word or string matches for each input file under Linux or UNIX operating systems?

{ 0 comments }

Linux / UNIX Shell: Sort Date

by Vivek Gite on October 23, 2008 · 8 comments

Q. How do I sort date type of data stored in a text file which is in following sample format:

Code         Date          TIME
HOS05	23/12/2008	10AM
HOS06	15/12/2008	2PM
HOS62	29/12/2008	10AM
HOS64	23/12/2008	2PM
HOS70	26/12/2008	10AM
ZFT01	06/12/2008	10AM
HOS73	11/12/2008	2PM
MHOS051	05/12/2008	10AM
MHOS041	20/12/2008	2PM
MHOS042	27/12/2008	2PM
MHOS053	11/12/2008	10AM
MHOS043	30/12/2008	2PM

How do I sort data date and time wise?

{ 8 comments }