From Mageia wiki
Jump to: navigation, search
# urpmq -i findutils

Name        : findutils
Version     : 4.5.9
Release     : 2.1.mga1
Group       : File tools
Size        : 1374722                      Architecture: x86_64
Source RPM  : findutils-4.5.9-2.1.mga1.src.rpm
URL         : http://www.gnu.org/software/findutils/findutils.html
Summary     : The GNU versions of find utilities (find and xargs)
Description :
The findutils package contains programs which will help you locate
files on your system.  The find utility searches through a hierarchy
of directories looking for files which match a certain set of criteria
(such as a filename pattern). The xargs utility builds and executes
command lines from standard input arguments (usually lists of file
names generated by the find command).

You should install findutils because it includes tools that are very
useful for finding things on your system.

Findutils contains the commands find, oldfind and xargs

Testing of each can be performed as below..

Find

# d=$(mktemp -d); mkdir -p $d/{foo,bar,baz}/bug; find $d -type d -name bug -print -execdir pwd \;
/tmp/tmp.ZsjdEAW7NS/foo/bug
/tmp/tmp.ZsjdEAW7NS/foo
/tmp/tmp.ZsjdEAW7NS/baz/bug
/tmp/tmp.ZsjdEAW7NS/baz
/tmp/tmp.ZsjdEAW7NS/bar/bug
/tmp/tmp.ZsjdEAW7NS/bar


Oldfind

# d=$(mktemp -d); mkdir -p $d/{foo,bar,baz}/bug; oldfind $d -type d -name bug -print -execdir pwd \;
/tmp/tmp.EdyyFjdEMx/foo/bug
/tmp/tmp.EdyyFjdEMx/foo
/tmp/tmp.EdyyFjdEMx/baz/bug
/tmp/tmp.EdyyFjdEMx/baz
/tmp/tmp.EdyyFjdEMx/bar/bug
/tmp/tmp.EdyyFjdEMx/bar


Xargs

# cut -d: -f1 < /etc/passwd | sort | xargs echo
adm apache avahi avahi-autoipd bin boinc clamav daemon ftp ...xguest etc.

Showing a list of users on the system.


Return to the QA portal