awk request


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting awk request
# 1  
Old 09-01-2010
awk request

Find the number of files with sizes > 100KB in /, /bin, /usr, /usr/bin
and /usr/sbin directories and output them in a two column format with the
name of the directory and the number of files.

i tried with awk
Code:
   $>ls -lh | awk '/^-/ && $5 >= 100k {print $8 $5}'

but it is not working pls tell me what to do

Moderator's Comments:
Mod Comment
  • Next time open up your own thread with your question please. No need to mix up/hijack another thread.
  • Also check out the use of code tags please.
  • This phrasing sounds like classroom stuff - if this is the case, there applies special rules for posting.
  • Best check out this: Forum Rules


---------- Post updated at 02:57 PM ---------- Previous update was at 02:50 PM ----------

Quote:
Originally Posted by abhikamune
Find the number of files with sizes > 100KB in /, /bin, /usr, /usr/bin
and /usr/sbin directories and output them in a two column format with the
name of the directory and the number of files.

i tried with awk
Code:
   $>ls -lh | awk '/^-/ && $5 >= 100k {print $8 $5}'

but it is not working pls tell me what to do

Moderator's Comments:
Mod Comment Next time open up your own thread with your question please. No need to mix up/hijack another thread. Also check out the use of code tags please.

Last edited by zaxxon; 09-01-2010 at 06:26 AM..
# 2  
Old 09-01-2010
New thread opened here;

https://www.unix.com/shell-programmin...k-problem.html

Thread closed
This User Gave Thanks to Franklin52 For This Post:
Login or Register to Ask a Question

Previous Thread | Next Thread

7 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Request per second script

Hello; I'm having about 800 log files and i'm trying to write a script that report the counts of lines per second or "requests per second" in each log file and report the output which includes the timestamp for the highest lines per second count and the log file name and the highest number per... (5 Replies)
Discussion started by: Katkota
5 Replies

2. Solaris

Request

hai is there any way to download and test vcs and vxvm in vmware x86 solaris 10 for education purpose only. i want to learn and practice in my pc. is there any alternate ways have guide me. (1 Reply)
Discussion started by: samiulla
1 Replies

3. Shell Programming and Scripting

http request

I am running a website but I still have problems with the "service temporarily unavailable error". I want to make a simple check if the website is up and running. Does anybody has an idea how to do it? (the site is password protected, so you have to add a user and pwd before logging in). ... (2 Replies)
Discussion started by: jurgen
2 Replies

4. IP Networking

necessary ARP request?

Hello, I have 2 clients with Unix installed. host1: eth0 (192.168.5.10) & eth1 (192.168.10.10) host2: eth0 (192.168.10.20) I've connected host1-eth1 to host2-eth0. host1-eth0 isn't connected. I started 'tcpdump' on wonder that host2 got ARP requests for 192.168.5.10. Any idea why host1... (2 Replies)
Discussion started by: daWonderer
2 Replies

5. UNIX for Dummies Questions & Answers

awk basics and ebook request

Dear All, Could someone suggest a resource where I can start learning awk from scratch. I'm a biologist with little command line experience but I need some data analysis to be done. I've realised from reading forums and talking to bioinformaticians that awk is extremely powerful to perform... (1 Reply)
Discussion started by: pawannoel
1 Replies

6. Post Here to Contact Site Administrators and Moderators

Request

Hi; I'd like to change my user name. How can i do that? (1 Reply)
Discussion started by: moe2266
1 Replies

7. UNIX for Advanced & Expert Users

a request for help...

Hi, An evil person hacked into my computer last night-- I had a 2nd user account which I used only to allow clients to scp files to me, and this account had a rather 'dumb' password... This was the account that got hacked, anyway, my mailq was filled with thousands of spam emails, so I... (1 Reply)
Discussion started by: patrick99e99
1 Replies
Login or Register to Ask a Question