Sponsored Content
Top Forums UNIX for Dummies Questions & Answers trying to count lines in multiple files Post 302161039 by llsmr777 on Wednesday 23rd of January 2008 12:40:04 PM
Old 01-23-2008
trying to count lines in multiple files

Hi there,

I need help.

I want to run the command:

less filename | wc -l

But on multiple files in a directory

So to get those files I would run
ls -ltr | grep filename_2000123 or of course ls -ltr *filename_2000123*

But I am having a problem running a loop to get a count of each file.

Please help. Thank you!
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Count files lines in a directory?

Hy! I have some problem. Problem is that i don't now how to solve problem of average lines of files in a directory. I have managed to get number of files in a directory, but i don't know the command to count average lines of these files. I have one "for" loop that goes true whole... (13 Replies)
Discussion started by: davidoff
13 Replies

2. UNIX for Advanced & Expert Users

grep count across multiple files

I have a number of simulation log files and I want to get a total count of the "PASSED" expression in them. If I use grep -c <files>, grep would give a tally for each file. I just want one number, the total count. How do I do that? (4 Replies)
Discussion started by: CrunchMunch
4 Replies

3. Shell Programming and Scripting

Trying to do a count on multiple lines in a file

Guys I am having a problem with being able to do a count of entries in a file. What I am trying to get a count of the total number of members that are listed in the files. So I need to pull the number of the lines after members. I tried using sed but it only seems to count the first... (7 Replies)
Discussion started by: scottzx7rr
7 Replies

4. Shell Programming and Scripting

Script to find & replace a multiple lines string across multiple php files and subdirectories

Hey guys. I know pratically 0 about Linux, so could anyone please give me instructions on how to accomplish this ? The distro is RedHat 4.1.2 and i need to find and replace a multiple lines string in several php files across subdirectories. So lets say im at root/dir1/dir2/ , when i execute... (12 Replies)
Discussion started by: spfc_dmt
12 Replies

5. Shell Programming and Scripting

Multiple pattern matching using awk and getting count of lines

Hi , I have a file which has multiple rows of data, i want to match the pattern for two columns and if both conditions satisfied i have to add the counter by 1 and finally print the count value. How to proceed... I tried in this way... awk -F, 'BEGIN {cnt = 0} {if $6 == "VLY278" &&... (6 Replies)
Discussion started by: aemunathan
6 Replies

6. Shell Programming and Scripting

Count lines from multiple files (3)

Hey everyone, I've to count lines from string of files names then to show sum output of lines. for example: read x = F1 F2 F3 F1 = 12 lines F2 = 14 lines F3 = 10 lines = 36 what I did is: read x echo $x >|temp for x in $(cat temp) do wc -l < $x (3 Replies)
Discussion started by: Aviv
3 Replies

7. Shell Programming and Scripting

Count files between multiple directories

Hi All, Everyday we will receive 33 files in our source directory(/prd/pk) with the current date. Once our jobs are completed all the 33 files immediately will be moved to backup folder (/prd/pk/backup). Now, I need to check between source file directory (/prd/pdk) and backup file directory... (3 Replies)
Discussion started by: suresh_target
3 Replies

8. Shell Programming and Scripting

Removing carriage returns from multiple lines in multiple files of different number of columns

Hello Gurus, I have a multiple pipe separated files which have records going over multiple Lines. End of line separator is \n and records going over multiple lines have <CR> as separator. below is example from one file. 1|ABC DEF|100|10 2|PQ RS T|200|20 3| UVWXYZ|300|30 4| GHIJKL|400|40... (7 Replies)
Discussion started by: dJHa
7 Replies

9. Shell Programming and Scripting

awk joining multiple lines based on field count

Hi Folks, I have a file with fields as follows which has last field in multiple lines. I would like to combine a line which has three fields with single field line for as shown in expected output. Please help. INPUT hname01 windows appnamec1eda_p1, ... (5 Replies)
Discussion started by: shunya
5 Replies

10. Shell Programming and Scripting

Shell script count lines and sum numbers from multiple files

I want to count the number of lines, I need this result be a number, and sum the last numeric column, I had done to make this one at time, but I need to make this for a crontab, so, it has to be an script, here is my lines: It counts the number of lines: egrep -i String file_name_201611* |... (5 Replies)
Discussion started by: Elly
5 Replies
Gtk2::MenuBar(3pm)					User Contributed Perl Documentation					Gtk2::MenuBar(3pm)

NAME
Gtk2::MenuBar - wrapper for GtkMenuBar HIERARCHY
Glib::Object +----Glib::InitiallyUnowned +----Gtk2::Object +----Gtk2::Widget +----Gtk2::Container +----Gtk2::MenuShell +----Gtk2::MenuBar INTERFACES
Glib::Object::_Unregistered::AtkImplementorIface Gtk2::Buildable METHODS
widget = Gtk2::MenuBar->new packdirection = $menubar->get_child_pack_direction Since: gtk+ 2.8 $menubar->set_child_pack_direction ($child_pack_dir) o $child_pack_dir (Gtk2::PackDirection) Since: gtk+ 2.8 packdirection = $menubar->get_pack_direction Since: gtk+ 2.8 $menubar->set_pack_direction ($pack_dir) o $pack_dir (Gtk2::PackDirection) Since: gtk+ 2.8 PROPERTIES
'child-pack-direction' (Gtk2::PackDirection : default "ltr" : readable / writable / private) The child pack direction of the menubar 'pack-direction' (Gtk2::PackDirection : default "ltr" : readable / writable / private) The pack direction of the menubar STYLE PROPERTIES
'internal-padding' (integer : default 1 : readable / private) Amount of border space between the menubar shadow and the menu items 'shadow-type' (Gtk2::ShadowType : default "out" : readable / private) Style of bevel around the menubar ENUMS AND FLAGS
enum Gtk2::PackDirection o 'ltr' / 'GTK_PACK_DIRECTION_LTR' o 'rtl' / 'GTK_PACK_DIRECTION_RTL' o 'ttb' / 'GTK_PACK_DIRECTION_TTB' o 'btt' / 'GTK_PACK_DIRECTION_BTT' SEE ALSO
Gtk2, Glib::Object, Glib::InitiallyUnowned, Gtk2::Object, Gtk2::Widget, Gtk2::Container, Gtk2::MenuShell COPYRIGHT
Copyright (C) 2003-2011 by the gtk2-perl team. This software is licensed under the LGPL. See Gtk2 for a full notice. perl v5.14.2 2012-05-27 Gtk2::MenuBar(3pm)
All times are GMT -4. The time now is 11:42 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy