Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Displaying specific lines in a file. Post 302164694 by MaestroRage on Tuesday 5th of February 2008 03:33:07 PM
Old 02-05-2008
Displaying specific lines in a file.

I'm trying to figure out how to display a certain line in a text file. I keep getting references to Tail and Head, and I know how these work, but i'm lost on how to find say the third out of the five lines and display only that.

I thought maybe grep could help, but that doesn't seem likely.

Any help is greatly appreciated!
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Displaying the Last Modification Time of a specific file

How can I get and display the last modification time of a file? in scripting or specifically using Batch file I want this info for me to determine whether an image has been edited or not by using the last modification time and compare it to our stored date of modification. can somebody help... (5 Replies)
Discussion started by: jaque18
5 Replies

2. UNIX for Dummies Questions & Answers

how to display specific lines of a specific file

are there any basic commands that can display lines 99 - 101 of the /etc/passwd file? I'm thinking use of head and tail, but I forget what numbers to use and where to put /etc/passwd in the command. (2 Replies)
Discussion started by: raidkridley
2 Replies

3. Shell Programming and Scripting

Displaying number of lines from file

Hi, I am using below command to display the number of line, but its returning no of lines along with file name. But i want only no of line in the variable p. Please help me on this? p=`wc -l "text file"` echo "$p" (6 Replies)
Discussion started by: shivanete
6 Replies

4. Shell Programming and Scripting

Substitute specific lines with lines from another file

Hello All, I am new to this forum. I am currently facing a problem in manipulating files. I have two files called old-matter and new-matter # cat old-matter abc: this, is a, sample, entry byi: white board, is white in color rtz: black, board is black qty: i tried, a lot asd: no... (1 Reply)
Discussion started by: rahmathulla
1 Replies

5. UNIX for Dummies Questions & Answers

Displaying specific columns in a file

Hi, I'm just wondering how you display a specific set of columns of a specified file in Unix. For example, if you had an AddressBook file that stores the Names, Phone numbers, and Addresses of people the user entered in the following format (the numbers are just to give an idea of what column... (1 Reply)
Discussion started by: logorob
1 Replies

6. Shell Programming and Scripting

Displaying lines of a file where the second field matches a pattern

Howdy. I know this is most likely possible using sed or awk or grep, most likely a combination of them together, but how would one go about running a grep like command on a file where you only try to match your pattern to the second field in a line, space delimited? Example: You are... (3 Replies)
Discussion started by: LordJezoX
3 Replies

7. Homework & Coursework Questions

Displaying specific lines from a CSV file

1. The problem statement, all variables and given/known data: Display from a csv file, birthdays that occur today. If there are no birthdays today, the next one in the year. 2. Relevant commands, code, scripts, algorithms: The csv file is ordered from older to younger (ie. the most recent... (8 Replies)
Discussion started by: Adzi
8 Replies

8. Shell Programming and Scripting

Displaying lines of a file which have the highest number?

Hello Wondering if anybody may be able to advise on how I can filter the contents of the following file: <object_name>-<version> <Instance> GM_GUI_code.fmb-4 1 GM_GUI_code.fmb-5 1 GM_GUI_code.fmx-4 ... (7 Replies)
Discussion started by: Glyn_Mo
7 Replies

9. Shell Programming and Scripting

Extracting specific lines of data from a file and related lines of data based on a grep value range?

Hi, I have one file, say file 1, that has data like below where 19900107 is the date, 19900107 12 144 129 0.7380047 19900108 12 168 129 0.3149017 19900109 12 192 129 3.2766666E-02 ... (3 Replies)
Discussion started by: Wynner
3 Replies

10. UNIX for Dummies Questions & Answers

Quick UNIX command to display specific lines in the middle of a file from/to specific word

This could be a really dummy question. I have a log text file. What unix command to extract line from specific string to another specific string. Is it something similar to?: more +/"string" file_name Thanks (4 Replies)
Discussion started by: aku
4 Replies
AFSMONITOR(5)							AFS File Reference						     AFSMONITOR(5)

NAME
afsmonitor - Provides instructions for the afsmonitor command DESCRIPTION
The afsmonitor configuration file determines which machines the afsmonitor command probes for File Server or Cache Manager statistics and which statistics it gathers. Use the -config argument to the afsmonitor command to identify the configuration file to use. The instructions that can appear in the configuration file are as follows: cm <host name> Names a client machine for which to display Cache Manager statistics. The order of "cm" lines in the file determines the order in which client machines appear from top to bottom on the "System Overview" and "Cache Managers" output screens. fs <host name> Names a file server machine for which to display File Server statistics. The order of "fs" lines in the file determines the order in which file server machines appear from top to bottom on the "System Overview" and "File Servers" output screens. thresh (fs | cm) <field> <thresh> [<cmd>] [<arg> ...] Assigns the threshold value thresh to the statistic field, for either a File Server statistic ("fs") or a Cache Manager statistic ("cm"). The optional cmd field names a binary or script to execute each time the value of the statistic changes from being below thresh to being at or above thresh. A change between two values that both exceed thresh does not retrigger the binary or script. The optional arg fields are additional values that the afsmonitor program passes as arguments to the cmd command. If any of them include one or more spaces, enclose the entire field in double quotes. The afsmonitor program passes the following parameters to the cmd: <hostname> (fs|cm) <field> <thresh> <actual> [<arg> ...] The parameters "fs", "cm", <field>, <thresh>, and <arg> correspond to the values with the same name on the thresh line. The <hostname> parameter identifies the file server or client machine where the statistic has crossed the threshold, and the <actual> parameter is the actual value of <field> that exceeds the threshold value. Use the "thresh" line to set either a global threshold, which applies to all file server machines listed on "fs" lines or client machines listed on "cm" lines in the configuration file, or a machine-specific threshold, which applies to only one file server or client machine. o To set a global threshold, place the thresh line before any of the "fs" or "cm" lines in the file. o To set a machine-specific threshold, place the thresh line below the corresponding "fs" or "cm" line, and above any other "fs" or "cm" lines. A machine-specific threshold value always overrides the corresponding global threshold, if set. Do not place a "thresh fs" line directly after a "cm" line or a "thresh cm" line directly after a "fs" line. show (fs | cm) field/group/section Specifies which individual statistic, group of statistics, or section of statistics to display on the "File Servers" screen ("fs") or "Cache Managers" screen ("cm") and the order in which to display them. The appendix of afsmonitor statistics in the OpenAFS Administration Guide specifies the group and section to which each statistic belongs. Include as many "show" lines as necessary to customize the screen display as desired, and place them anywhere in the file. The top-to-bottom order of the "show" lines in the configuration file determines the left-to-right order in which the statistics appear on the corresponding screen. If there are no "show" lines in the configuration file, then the screens display all statistics for both Cache Managers and File Servers. Similarly, if there are no "show fs" lines, the "File Servers" screen displays all file server statistics, and if there are no "show cm" lines, the "Cache Managers" screen displays all client statistics. # comments Precedes a line of text that the afsmonitor program ignores because of the initial number ("#") sign, which must appear in the very first column of the line. For a list of the values that can appear in the field/group/section field of a "show" instruction, see the afsmonitor statistics appendix to the OpenAFS Administration Guide. SEE ALSO
afsmonitor(1) COPYRIGHT
IBM Corporation 2000. <http://www.ibm.com/> All Rights Reserved. This documentation is covered by the IBM Public License Version 1.0. It was converted from HTML to POD by software written by Chas Williams and Russ Allbery, based on work by Alf Wachsmann and Elizabeth Cassell. OpenAFS 2012-03-26 AFSMONITOR(5)
All times are GMT -4. The time now is 05:30 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy