LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Ubuntu
User Name
Password
Ubuntu This forum is for the discussion of Ubuntu Linux.

Notices


Reply
  Search this Thread
Old 12-09-2016, 04:12 PM   #1
abbotsford
LQ Newbie
 
Registered: Dec 2016
Posts: 1

Rep: Reputation: Disabled
wc -l command help


I am learning Linux using Ubuntu. I need one liner wc commands that displays following info:

1. shows number of line in example.sh:
wc-l example.sh (this one i got)

2. shows number of line that are comments in example.sh
3. shows number of block devices in /dev
4. shows number of files in home directory
5. shows number of lines of each file in given directory dir
6. Write a script test.sh to calculate
- number of lines in Testname if exe ./test.sh Testname
- number of lines of each file in directoyname if exe ./test.sh directoryname

thanks
 
Old 12-09-2016, 04:15 PM   #2
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,700

Rep: Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895
Welcome to LinuxQuestions.

Per the LQ Rules, please do not post homework assignments verbatim. We're happy to assist if you have specific questions or have hit a stumbling point, however. Let us know what you've already tried and what references you have used (including class notes, books, and Google searches) and we'll do our best to help. Also, keep in mind that your instructor might also be an LQ member.
 
Old 12-10-2016, 06:32 AM   #3
TxLonghorn
Member
 
Registered: Feb 2004
Location: Austin Texas
Distribution: Mandrake 9.2
Posts: 702

Rep: Reputation: 231Reputation: 231Reputation: 231
Code:
info wc
or
Code:
man wc
in a terminal will tell you much of what you need to know

Check: http://www.computerhope.com/unix/uwc.htm

And see here for examples of usage: http://www.commandlinefu.com/command.../sort-by-votes

Last edited by TxLonghorn; 12-10-2016 at 06:39 AM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] [SOLVED] bash script: can echo command, command works if I type, but command doesn't work in script ... why? hopeless_n00b Linux - Newbie 10 07-12-2018 05:57 AM
SED command failing while substituting variable with error unterminated `s' command vnarvankar Linux - Software 2 03-10-2016 09:10 AM
Command/Script required to send an email alert in case command will not respond rajaniyer123 Linux - General 1 05-19-2012 01:12 PM
Executing shell command from JSP file with command line arg from URL orcusomega Programming 2 01-13-2012 03:38 PM
Bash Command Line Editor, while typing run another command before executing current? gumaheru Linux - General 5 04-13-2010 11:21 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Ubuntu

All times are GMT -5. The time now is 02:07 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration