The UNIX and Linux Forums
Forum Home
Linux and Unix Man Pages
Search Forums
Search Community Posts
Today's Posts
Quick Links
Man Pages
RedHat Commands
OpenSolaris Commands
Linux Commands
SunOS Commands
FreeBSD Commands
All UNIX Man Pages
All Linux Man Pages
Full Man Repository
Login or Register to Ask a Question and Join Our Community
Search Forums
Show Threads .
Show Posts
Tag Search
Advanced Search
Quick Links
Contact Us
Forum Rules
Today's Posts
FAQ
Pictures & Albums
All Albums
Miscellaneous
What is My IP
Whois
Mark Forums Read
Shell Programming and Scripting
Wc -l
Tags
shell scripts
,
wc
,
wc -l
Login to Discuss or Reply to this Discussion in Our Community
Thread Tools
Search this Thread
Top Forums
Shell Programming and Scripting
Wc -l
#
1
11-30-2018
tricampeon81
Registered User
118,
2
Join Date: Sep 2014
Last Activity: 9 September 2019, 3:03 PM EDT
Location: macul, santiago , de chile
Posts: 118
Thanks Given: 82
Thanked 2 Times in 2 Posts
Wc -l
friends this command brings me the number of records but also brings the name as I can do that only gives me the number of records without the name of the file
Code
:
example errror 865 salida_xygo.txt example good 865
tricampeon81
View Public Profile for tricampeon81
Find all posts by tricampeon81
#
2
11-30-2018
vgersh99
Moderator
8,825,
1,112
Join Date: Feb 2005
Last Activity: 23 August 2021, 11:26 AM EDT
Location: Foxborough, MA
Posts: 8,825
Thanks Given: 579
Thanked 1,112 Times in 1,003 Posts
wc -l < myFileName
This User Gave Thanks to vgersh99 For This Post:
tricampeon81
vgersh99
View Public Profile for vgersh99
Find all posts by vgersh99
#
3
11-30-2018
MadeInGermany
Registered User
5,091,
1,931
Join Date: May 2012
Last Activity: 15 July 2020, 4:46 AM EDT
Location: Simplicity
Posts: 5,091
Thanks Given: 565
Thanked 1,931 Times in 1,668 Posts
Some variants of wc have leading blanks.
Therefore, in portable script I prefer
grep -c ^ myFileName
This User Gave Thanks to MadeInGermany For This Post:
milhan
MadeInGermany
View Public Profile for MadeInGermany
Find all posts by MadeInGermany
Login or Register to Ask a Question
Previous Thread
|
Next Thread
Login or Register to Ask a Question
Member Badges and Information Modal
×