Free Computer Based Training, E-learning, CBT and IT Training courses.
Online Training and Computer training courses.Try our free video tutorials training courses.
Online computer training and distance learning online tutorials
Online Training Online Training

Microsoft Office TrainingMicrosoft Office Skills Training
Business Skills Courses Business Skills Courses

Technical Courses Technical Courses

Networking Networking Training Courses

Java PHP C C++ Perl Training Java PHP C C++ Perl Training

Web Marketing Training Web Marketing Training

Database Training Database Training

Unix Training Unix Training

Online Aptitude Testing and computer Assessments Online Aptitude Testing and Assessments.

Personal Development Training Personal Development Training

Try our online computer training courses via distance learning.
Online Training Free Video Tutorials

Free video tutorials for Adobe photoshop. Adobe Photoshop
Free video tutorials for Dreamweaver. Dreamweaver
Free video tutorials for Flash. Flash
Free video tutorials for Html. Html
Free video tutorials for visual basic. Visual Basic
Free video tutorials for Perl. Perl
Free video tutorials for C++. C & C++

free IT Training and e-learning computer based training courses.
Online Training Assessments


Technical Courses Verbal Reasoning

aptitude Numerical Reasoning

Free Online Java Quiz

Online Computer Training, e-learning, free video tutorials.
Online Training Training Tools

free IT Training and e-learning courses. Course Manager
Try our online computer training courses and our e-learning cbt courses. System Manager


Computer Training & Webmaster forum - internet marketing and search engine forum
  

Click here to register for your free computer training courses.

Web Diretory | Sitemap | Blog

Try learningsteps.com online computer training courses and tutorial via online learning, online training.

Lesson 4: Viewing/Displaying/Searching the contents of a file.


In this lesson we will look at ways of viewing and displaying the contents of a file using unix commands.

Before you start the next section, you may like to clear the terminal window of the previous commands so the output of the following commands can be clearly understood.

At the prompt, type % clear This will clear all text and leave you with the % prompt at the top of the window.


The first command we will look at for the displaying the contents of a file is the more command. The more command display the contents of a file one screen full at a time.

Let’s pretend we have a file called resume.txt on root, to view this file we would type

% more resume.txt – the screen would then output the contents of this file.
Remember more only lets you seen on screen full at a time, so see the next screen full you just click on the space bar.
Keep clicking the space bar until you reach the end of the file.

Another command for displaying files is cat

The command cat can be used to display the contents of a file on the screen. Type:
% cat resume.txt

As you can see, the file is longer than than the size of the window, so it scrolls past making it unreadable.
Other commands for viewing files are the head and tail commands

head

The head command writes the first ten lines of a file to the screen.
First clear the screen then type
% head resume.txt

tail

The tail command writes the last ten lines of a file to the screen.
Clear the screen and type
% tail resume.txt

Searching for a word in a file

grep is one of many standard UNIX utilities. It searches files for specified words or patterns.
First clear the screen, then type

% grep address resume.txt

As you can see, grep has printed out each line containg the word address


free online unix tutorial
CBT
online computer courses

Copyright ©2007 LearningSteps.com Inc. Computer Based Training | E-Learning | CBT | IT Training

free IT Training and Cbt computer based training courses.

try our paid computer based training(cbt) or free computer training