EzineArticles - Expert Authors Sharing Their Best Original Articles



  Submit Articles
  Members Login
  Benefits
  Expert Authors
  Read Endorsements
  Editorial Guidelines
  Author TOS

  Terms of Service
  Ezines / Email Alerts
  Manage Subscriptions
  EzineArticles RSS

  Blog
  Forums
  About Us
  What's New
  Contact Us
  Article Writing Shop
  Advertising
  Affiliates
  Privacy Policy
  Site Map


Advanced Search


Would you like to be notified when a new article is added to the Software category?

Email Address:


Your Name:


Prefer RSS?
Subscribe to the
Software
RSS Feed:

Linux Commands Training Quick Tips - Using the Linux Less & More Commands to View Files - Red Hat
Print This Article Ezine Publisher Send To Friends Add To Favorites Post A Comment Suggest Topic Report Author
CloseRecommend This Article
From:
To:
Message:

The Linux more and less Commands

Both of these commands can be used to view the contents of a file, such as a text file. Linux scripts and system and server configuration files are examples of text files.

    Linux Commands Training Tips: A Linux text file contains only text (letters, numbers and other characters found on your keyboard) and does not contain any formatting, such as left and right margins, bold or underline.

The Linux more Command Example

Run the following command example to display the contents of the inittab configuration file in the etc directory, which is below the / (root) directory.

    $ more /etc/inittab

This shows the first "page" or "screenful" of the file.

Now press the spacebar to see the next "screenful".

Now press the up arrow key and then the down arrow key and see that these keys don't work!

Press q to quit out of the Linux more command.

The Linux less Command Example

This Linux command does everything that more does - and better - this is when less is more!

(A little (very little) Linux programmer humor ;).

Do the following steps to run the less command example below and display the contents of the inittab configuration file again:

Press the up arrow key once, press the Home key, press the Delete key four times to remove "more" and type in "less" (without the quotes). Your command should look like below. Press Enter. Cool.

    $ less /etc/inittab

This shows the first "page" or "screenful" of the file.

Now press the spacebar to see the next "screenful".

Then press the down arrow a few times and the up arrow.

Then press the Page Down key a few times and then the Page Up key.

Press the End key to go to the end of this Linux text file and then Home to go to the top.

Searching for Text in a File When Using the Linux less Command

Need to quickly find some text in a text file? No problem.

You can easily search for text by pressing the / (slash) key and then typing the text you need to find.

Press Home to go to the top of the file and type in the following: /runlevel and all occurrences of this text appears highlighted.

To move to the next occurrence of the text you're searching for, type the letter n and to go to the previous occurrence type the letter p. Easy!

Press q to quit out of the less command.

This "Linux Commands Training Quick Tips" show the use of the more and less commands, which are GNU Linux commands. And these commands are the "core" set of commands in ALL Linux distributions.

These "Linux Commands Training - Quick Tips" work in Ubuntu, Red Hat, SUSE, openSUSE, Debian, Slackware, Fedora - and ALL other Linux distros.

By the way...do you want to learn exactly how to use Linux and run Linux commands for Linux System Administration and get real, practical Linux training experience by running hundreds of examples of Linux commands?

Just click to download my free new Linux commands training course book and Linux audio podcast (.mp3) files here: Linux Commands Training Mini-Course

Clyde Boom says "Learn how to use Linux commands with easy, self-paced Linux training materials that show you how to run hundreds of examples of the essential Linux System Administration commands - and get that new and better job, promotion, raise - or keep your current job!"

You can get your instant access to my free Linux commands training course at: http://www.LinuxCommandsTrainingCourse.com

Article Source: http://EzineArticles.com/?expert=Clyde_E._Boom

Clyde E. Boom - EzineArticles Expert Author

Other Recent EzineArticles from the Computers-and-Technology:Software Category:

Most Viewed EzineArticles in the Computers-and-Technology:Software Category (60 Days)

  1. Windows 7 Runs Very Slow? - How to Speed Up Windows 7 Quickly and Fast
  2. How to Get Rid of Personal Security in Minutes - Let Personal Security Removal Help You
  3. Why My Computer is Running So Slow? How to Speed Up Computer - Fix Your Problem Instantly
  4. Speed Up Slow Computer - How to Make Your Computer Run Faster? Fix it in Seconds!
  5. Malware Defense Removal - How to Delete This Spyware Off Your Computer
  6. Keylogger Software - Catch Your Cheating Spouse Red-Handed
  7. Personal Security Removal - 3 Easy Steps on How to Remove Personal Security in Seconds
  8. How to Remove Antivirus Live - Uninstall Antivirus Live Easily With Removal Instructions
  9. 3 Fast Methods to Get Rid of Antivir in Seconds - Quickly Conduct an Antivir Removal
  10. 4 Steps to Speed Up Your PC - How to Make Your PC Run Faster in Just a Few Minutes!
  11. Improve PC Performance - Step by Step Instructions to Dramatically Increase Your System Performance
  12. How to Remove Malware Defense - Uninstall Malware Defense Spyware From Your PC
  13. Is a Cleaner Free Reg Program for Your Computer's Registry A Great Tool to Use?
  14. How to Remove Antivirus Live - The Easiest Antivirus Live Removal Guide
  15. Internet Security 2010 Removal - Delete This Spyware From Your Computer

Most Published EzineArticles in the Computers-and-Technology:Software Category (60 days)

  1. How to Remove Spyware From Your Computer Today
  2. 3 Fast Methods to Get Rid of Antivir in Seconds - Quickly Conduct an Antivir Removal
  3. How to Remove Security Tool in 5 Minutes - Get a Security Tool Removal the Easy Way
  4. How to Get Rid of Personal Security in Minutes - Let Personal Security Removal Help You
  5. 7 Easy Ways on How to Remove AntiVir in Seconds - Follow These AntiVir Removal Instructions
  6. The Simplest Way on How to Remove Windows Enterprise Defender - Guide Removal Instructions
  7. Personal Security Removal - 3 Easy Steps on How to Remove Personal Security in Seconds
  8. 4 Steps to Speed Up Your PC - How to Make Your PC Run Faster in Just a Few Minutes!
  9. One Step How-To Uninstall Malware Defense - Learn the Malware Defense Removal Methods
  10. Need How to Remove Security Central in Seconds - Just Read This and Remove Them in Very Easy Way
  11. How to Remove Security Central in Seconds - Quickly Conduct a Security Central Removal
  12. One Step How to Remove Personal Protector From Your PC and Laptop - Remove Them in 10 Minutes
  13. Disabling the Windows Live Messenger is Just a Simple Procedure
  14. Windows 7 Runs Very Slow? - How to Speed Up Windows 7 Quickly and Fast
  15. Why My Computer is Running So Slow? How to Speed Up Computer - Fix Your Problem Instantly

 

This article has been viewed 235 time(s).
Article Submitted On: November 27, 2008



© EzineArticles.com - All Rights Reserved Worldwide.