Programming in UNIX Environment : Commands – mv, rm, wc, grep

The ‘mv’ command is using for renaming. And ‘rm’ command for removing files. ‘wc’ for counting lines,words,characters. The ‘grep’ command is for searching a word. ‘-v’ for searching all words except the indicating word in a line.

mv filename newname

rm filename1 filename2

wc filename1 filename2 // count lines,words,characters.
wc -l //only counts the new lines.
wc -w //print the word count.
wc -m //print the character counts.
wc -c //printf the byte counts.

grep int filename // for searching the word int.
grep -v int filename // all except int.

Advertisements

Author: Abhi

Hi, this is Abhilash - Senior Programmer Analyst at CoMakeIT, specialised on web programming. Mainly working on Ruby On Rails platform since 2010.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s