05-16-2007
I tried this and receiveed an error messge that stated bad option -printf
find /sasdb -printf "%s:%p\n"| sort -kin| tail -50
10 More Discussions You Might Find Interesting
1. Programming
I was hoping to get some assistance with this C program I am working on. The goal is to find the largest file in the current directory and then display this filename along with the filesize. What I have so far will display all the files in the current directory. But, how do I deal with "grabbing"... (1 Reply)
Discussion started by: AusTex
1 Replies
2. UNIX for Advanced & Expert Users
I want to find the which directory under a directory occupy the maximum size is there is any command to find please help (5 Replies)
Discussion started by: arunkumar_mca
5 Replies
3. UNIX for Dummies Questions & Answers
I need to find the largest files in a directory & it's subdirectories.
I'm not sure what options on ls -l will work to give me this. or is there another way to do this?
Thanks,
igidttam (6 Replies)
Discussion started by: igidttam
6 Replies
4. Shell Programming and Scripting
Hi,
1)I have XX directory and have lot of files ,I want to find largest file in that
directory
2)how calculate the size of file in MB.
Thanks,
Mohan (15 Replies)
Discussion started by: mohan705
15 Replies
5. HP-UX
find the largest file in whole system (7 Replies)
Discussion started by: megh
7 Replies
6. UNIX for Dummies Questions & Answers
Hello,
How to find the list of 5 largest(size wise) file in current directory?i tried using
ls -l | sort -t " " -r +5 -6 -n | head -5
but this is not giving correct output as ls -l command gives 1 extra line of output that is how many total files are there!so by running the above... (4 Replies)
Discussion started by: salman4u
4 Replies
7. Shell Programming and Scripting
Hello,
i am on linux 2.6.13-1.1526_FC4smp , and i would be very greatfull
if someone could help to find the largest files on that server.
I know i can find files with find command or list them with ls ,
but is there a way that i could list let's say 10 biggest files on server ?
:o (11 Replies)
Discussion started by: tonijel
11 Replies
8. UNIX for Dummies Questions & Answers
What is the best way to find the largest files in a directory? I used du -k|sort -rn |less.
I got a results for this. But if I used the following command , I got another result...a different order in the same directory. Why is that?
ls -la |awk '{print $5," ",$9}' sort -rn|less. I saw that... (6 Replies)
Discussion started by: Pouchie1
6 Replies
9. Shell Programming and Scripting
Hi All,
Is there a direct Linux command to find the largest file by checking recursively in all the directories. (3 Replies)
Discussion started by: paragkalra
3 Replies
10. Shell Programming and Scripting
Hi Experts,
1. In unix how to list the largest file in given directory.
The answer will in single line statement.
2. I have Sun solaris live CD .I try to compile sample c program using "CC compiler".But its shows "cc command not found".
Please help on this.
Thanks in advance.... (4 Replies)
Discussion started by: kkl
4 Replies
STAPEX(3stap) STAPEX(3stap)
NAME
stapex - systemtap examples
LANGUAGE BASICS
These examples give a feel for basic systemtap syntax and control structures.
global odds, evens
probe begin {
# "no" and "ne" are local integers
for (i=0; i<10; i++) {
if (i % 2) odds [no++] = i
else evens [ne++] = i
}
delete odds[2]
delete evens[3]
exit ()
}
probe end {
foreach (x+ in odds) {
printf ("odds[%d] = %d0, x, odds[x])
}
foreach (x in evens-) {
printf ("evens[%d] = %d0, x, evens[x])
}
}
This prints:
odds[1] = 1
odds[3] = 5
odds[4] = 7
odds[5] = 9
evens[5] = 8
evens[4] = 6
evens[2] = 2
evens[1] = 0
Note that all variables types are inferred, and that all locals and globals are automatically initialized.
This script prints the primes between 0 and 49.
function isprime (x) {
if (x < 2) return 0
for (i=2; i<x; i++) {
if (x % i == 0) return 0
if (i * i > x) break
}
return 1
}
probe begin {
for (i=0; i<50; i++)
if (isprime (i)) printf("%d0, i)
exit()
}
This script demonstrates recursive functions.
function fibonacci(i) {
if (i < 1) error ("bad number")
if (i == 1) return 1
if (i == 2) return 2
return fibonacci (i-1) + fibonacci (i-2)
}
probe begin {
printf ("11th fibonacci number: %d0, fibonacci(11))
exit ()
}
Any larger number may exceed the MAXACTION or MAXNESTING limits, and result in an error.
PROBING
To trace entry and exit from a function, use a pair of probes:
probe kernel.function("sys_mkdir") { println ("enter") }
probe kernel.function("sys_mkdir").return { println ("exit") }
To list the probeable functions in the kernel, use the listings mode.
% stap -l 'kernel.function("*")'
To list the probeable functions and local variables in the kernel, use another listings mode.
% stap -L 'kernel.function("*")'
MORE EXAMPLES
The directory to find more examples can be found in the stappaths(7) manual page.
SEE ALSO
stap(1) stapprobes(3stap) stapfuncs(3stap) stappaths(7)
STAPEX(3stap)