Linux Online Advertisement
[ Register ]

[ Applications ]
[ Documentation ]
[ Distributions ]
[ Download Info ]
[ General Info ]
[ Book Store ]

Advertisement

[ Courses ]
[ News ]
[ People ]
[ Hardware ]
[ Vendors ]
[ Projects ]
[ Events ]
[ User Groups ]
[ User Area ]

Linux Kernel Development

[ About Us ]
[ Home Page ]
[ Advertise ]

Getting Started with Linux - Lesson 10

'echo'

To show you some uses of the 'echo' command 'echo' is a little command that repeats anything you type. For example if you type echo hello Linux will display the word 'hello' .

There is really no need to do that under normal conditions. You may find 'echo' useful in the future if you start writing "shell scripts" which are like little programs that you could use to do a few commands at one time. You could use 'echo' in those scripts to tell you what the script is doing at any given time, or to prompt you to do something, like enter text. Shell scripts will be taken up in a later course.

There is a practical use for 'echo' in everyday life. I sometimes use it to write short notes. If we use 'echo' along with 'pipe' (|) and 'tee', you've got a poor-man's post-it-note. For example:

echo remember to tell Bill Gates he owes me 5 bucks | tee -a bill_gates.note

Will make you a nice reminder note about dear 'ole Bill. Just remember to read your note. You could type:

echo remember to open Gates note | tee -a remember_gates.note

to make yourself a reminder for the other reminder note. Use less bill_gates.note or less remember_gates.note to read your notes

'wc'

People following this course from Europe may recognize this as the symbol for 'bathroom'. Unfortunately, if you type this in your terminal it will not show you the way to the 'facilities'.

Actually, this command will give you the number of lines, words and letters (characters) in a file and in that order.

Let's go back to the file about the people I owe money. If I type:

wc people_I_owe_money.note

I will get this output:

439 6510 197120 wc people_I_owe.note

As you can see, there are 439 lines, so that means if each line represents one person, then I owe 439 people money. There are 6510 words and a total of 197120 characters.

I might add that this is a good tool for people who write letters professionally and get paid by the word.

[Previous] [Next]




Comments: feedback (at) linux.org
Advertising: banners (at) linux.org
Copyright Linux Online Inc.
Compilation ©1994-2008 Linux Online, Inc.
All rights reserved.