I need to write a Unix shell script which will list top 10 files in a directory tree on basis of size. i.e. first file should be the biggest in the whole directory and all its sub directories.
Please suggest any ideas (10 Replies)
Hello,
I have 2 columns (1st column has multiple entries but the corresponding values in the column 2 may be the same or different.) however I want to extract unique values for each entry in column 1 by assigning the max value from column 2
SDF4 -0.211654
SDF4 0.978068
... (1 Reply)
Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted!
1. The problem statement, all variables and given/known data:
I am trying to complete a script which will allow me to find:
a) reads a value from the keyboard. (ask the... (4 Replies)
Hi,
I have a file like this
a 1 2
a 5 8
a 66 100
b 1 2
b 2 3
b 111 143
d 4 5
d 4 6
e 77 727
g 7 8
How can I extract the maximum of col3 respective to col1. I meant, the output will be
a 100
b 143
d 6 (1 Reply)
I am trying to find the minimum maximum and average from one file which has values
Received message from https://www.demandmatrix.net/app/dm/xml] in milliseconds.
Received message from https://www.demandmatrix.net/app/dm/xml] in milliseconds.
Received message from... (5 Replies)
Hi everyone, I'm a new member at the forum
I have a file like this: field 2 values are either 0 or negative. file test4:
100815 -20
118125 0
143616 0
154488 0
154488 0
154488 -6
196492 -5
196492 -9
196492 -7
27332 0
29397 0
I would like to print a... (1 Reply)
Hi everyone, I'm a new member at the forum I mistakenly posted this elsewhere too.
I have a file like this: field 2 values are either 0 or negative. file test4:
100815 -20
118125 0
143616 0
154488 0
154488 0
154488 -6
196492 -5
196492 -9
196492 -7
27332 0... (5 Replies)
I've the files in a directory in the following format having date +%Y%m%d%H
YR_MNTH_2013061205
YR_MNTH_2013060107
and i need the latest file i.e; YR_MNTH_2013061205 to be moved to another folder
#!/bin/ksh
# Ksh 88 Version
for test_time in YR*
do
---
done
How can i achieve that !... (2 Replies)
Hello everyone,
I am using ksh on Solaris 10 and I'm gathering data in a CSV file that looks like this:
20170628-23:25:01,1,0,0,1,1,1,1,55,55,1
20170628-23:30:01,1,0,0,1,1,1,1,56,56,1
20170628-23:35:00,1,0,0,1,1,2,1,57,57,2
20170628-23:40:00,1,0,0,1,1,1,1,58,58,2... (6 Replies)
Need your support for below. Please help to get required output
If column 5 is INV then only consider column1 and take out duplicates/identical rows/values from column1 and then put minimum value of column6 in column7 and put maximum value in column 8 and then need to do subtract values of... (7 Replies)
Discussion started by: as7951
7 Replies
LEARN ABOUT NETBSD
percpu
PERCPU(9) BSD Kernel Developer's Manual PERCPU(9)NAME
percpu, percpu_alloc, percpu_free, percpu_getref, percpu_putref, percpu_foreach -- per-CPU storage allocator
SYNOPSIS
#include <sys/percpu.h>
typedef void (*percpu_callback_t)(void *, void *, struct cpu_info *);
percpu_t *
percpu_alloc(size_t size);
void
percpu_free(percpu_t *pc, size_t size);
void *
percpu_getref(percpu_t *pc);
void
percpu_putref(percpu_t *pc);
void
percpu_foreach(percpu_t *pc, percpu_callback_t cb, void *arg);
DESCRIPTION
The machine-independent percpu interface provides per-CPU, CPU-local memory reservations to kernel subsystems. percpu_alloc(size) reserves
on each CPU an independent memory region of size bytes that is local to that CPU, returning a handle (percpu_t) to those regions. A thread
may subsequently ask for a pointer, p, to the region held by the percpu_t on the thread's current CPU. Until the thread relinquishes the
pointer, or voluntarily sleeps, the thread may read or write the region at p without causing interprocessor memory synchronization.
FUNCTIONS
percpu_alloc(size)
Call this in thread context to allocate size bytes of local storage on each CPU. The storage is initialized with zeroes. Treat
this as an expensive operation. percpu_alloc() returns NULL on failure, and a handle for the per-CPU storage on success.
percpu_free(pc, size)
Call this in thread context to return to the system the per-CPU storage held by pc. size should match the size passed to
percpu_alloc(). When percpu_free() returns, pc is undefined. Treat this as an expensive operation.
percpu_getref(pc)
Disable preemption and return a pointer to the storage held by pc on the local CPU. Use percpu_getref() in either thread or inter-
rupt context. Follow each percpu_getref() call with a matching call to percpu_putref().
percpu_putref(pc)
Indicate that the thread is finished with the pointer returned by the matching call to percpu_getref(). Re-enables preemption.
percpu_foreach(pc, cb, arg)
On each CPU, for ci the corresponding struct cpu_info * and p the CPU-local storage held by pc, run (*cb)(p, arg, ci). Call this in
thread context. cb should be non-blocking and fast. Do not rely on cb to be run on the CPUs in any particular order.
CODE REFERENCES
The percpu interface is implemented within the file sys/kern/subr_percpu.c.
SEE ALSO atomic_ops(3), kmem(9), pcq(9), pool_cache(9), xcall(9)HISTORY
The percpu interface first appeared in NetBSD 6.0.
AUTHORS
YAMAMOTO Takashi <yamt@NetBSD.org>
BSD January 23, 2010 BSD