08-17-2008
Quote:
Originally Posted by
mnnarendra
I need help with tweaking the unix find command. currently the find command searches all the directories under $div/users modified in the last 1 day.
find $div/users -type d -mtime +1
I need this changed to find only subdirectories and sub-subdirectories modified in the last 1 day under $div/users. the find should go only two levels, and not 4 levels below it is currently doing.
check out for the option maxdepth from find
-maxdepth levels
8 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
How can I know that my FreeBSD OS has commands mkdir or mkfile?
Can I do like this:
find / -name mkdir
find / -name mkfile
But I do not see them???
Thanks. (1 Reply)
Discussion started by: lacasa
1 Replies
2. Shell Programming and Scripting
given a start directory,a filename,how to find it? (3 Replies)
Discussion started by: bluo
3 Replies
3. UNIX for Dummies Questions & Answers
Hi All,
I trying to get my head around using the find command and i wanted to list a selection of files that are older than 30 days. i used 'find . -mtime +30' and it lists all the files including other files from the current location's sub directory. i then used the prune option but it seems it... (5 Replies)
Discussion started by: scriptingmani
5 Replies
4. Shell Programming and Scripting
Yes , I have to find a file in unix without using any find or where commands.Any pointers for the same would be very helpful as i am beginner in shell scritping and need a solution for the same.
Thanks in advance.
Regards
Jatin Jain (10 Replies)
Discussion started by: jatin.jain
10 Replies
5. Shell Programming and Scripting
I need help with tweaking the unix find command. currently the find command searches all the directories under $div/users modified in the last 1 day.
find $div/users -type d -mtime +1
I need this changed to find only subdirectories and sub-subdirectories modified in the last 1 day under... (3 Replies)
Discussion started by: mnnarendra
3 Replies
6. Shell Programming and Scripting
hello forum memvers,
1:I have to write a script for find a string and replace with another string.
2:In shell script how to replace one string with another string.:b: (4 Replies)
Discussion started by: rajkumar_g
4 Replies
7. UNIX for Dummies Questions & Answers
This command is intended to compare two drives to see if all files are identical, can some one please decode what it is doing.
find / -path /proc -prune -o -path /new-disk -prune -o -xtype f -exec cmp {} /new-disk{} \; (2 Replies)
Discussion started by: Tirmazi
2 Replies
8. Homework & Coursework Questions
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've been stuck on this problem for 2 days now
What command would you enter to list the first lines of all text... (11 Replies)
Discussion started by: partieboi37
11 Replies
LEARN ABOUT NETBSD
fast_divide32_prepare
FAST_DIVIDE32(3) BSD Library Functions Manual FAST_DIVIDE32(3)
NAME
fast_divide32, fast_divide32_prepare, fast_remainder32 -- fast 32bit division and remainder
SYNOPSIS
#include <sys/bitops.h>
uint32_t
fast_divide32(uint32_t v, uint32_t div, uint32_t m, uint8_t s1, uint8_t s2);
uint32_t
fast_remainder32(uint32_t v, uint32_t div, uint32_t m, uint8_t s1, uint8_t s2);
void
fast_divide32_prepare(uint32_t div, uint32_t *m, uint8_t *s1, uint8_t *s2);
DESCRIPTION
The fast_divide32 and fast_remainder32 functions compute the equivalent of v / div and v % div using optimised CPU instructions. The con-
stants m, s1, and s2 must first be preset for a given value of div with the fast_divide32_prepare function.
RATIONALE
These functions are useful for inner loops and other performance-sensitive tasks. The functions expand to code that is typically slightly
larger than a plain division instruction, but requires less time to execute. The code for constant div arguments should be equivalent to the
assembly created by GCC.
EXAMPLES
The following example computes q = a / b and r = a % b:
uint32_t a, b, q, r, m;
uint8_t s1, s2;
fast_divide32_prepare(b, &m, &s1, &s2);
q = fast_divide32(a, b, m, s1, s2);
r = fast_remainder32(a, b, m, s1, s2);
SEE ALSO
bitops(3), div(3), remainder(3)
Torbjorn Granlund and Peter L. Montgomery, "Division by Invariant Integers Using Multiplication", ACM SIGPLAN Notices, Issue 6, Volume 29,
http://gmplib.org/~tege/divcnst-pldi94.pdf, 61-72, June 1994.
HISTORY
The fast_divide32 function appeared in NetBSD 6.0.
BSD
May 10, 2011 BSD