aboutsummaryrefslogtreecommitdiff
path: root/findutils/find.c
diff options
context:
space:
mode:
Diffstat (limited to 'findutils/find.c')
-rw-r--r--findutils/find.c90
1 files changed, 89 insertions, 1 deletions
diff --git a/findutils/find.c b/findutils/find.c
index ca630b6c5..297081489 100644
--- a/findutils/find.c
+++ b/findutils/find.c
@@ -53,8 +53,10 @@
53 * diff -u /tmp/std_find /tmp/bb_find && echo Identical 53 * diff -u /tmp/std_find /tmp/bb_find && echo Identical
54 */ 54 */
55 55
56//applet:IF_FIND(APPLET_NOEXEC(find, find, _BB_DIR_USR_BIN, _BB_SUID_DROP, find))
57
56//kbuild:lib-$(CONFIG_FIND) += find.o 58//kbuild:lib-$(CONFIG_FIND) += find.o
57//config: 59
58//config:config FIND 60//config:config FIND
59//config: bool "find" 61//config: bool "find"
60//config: default y 62//config: default y
@@ -1044,6 +1046,92 @@ static action*** parse_params(char **argv)
1044#undef ALLOC_ACTION 1046#undef ALLOC_ACTION
1045} 1047}
1046 1048
1049//usage:#define find_trivial_usage
1050//usage: "[PATH]... [EXPRESSION]"
1051//usage:#define find_full_usage "\n\n"
1052//usage: "Search for files. The default PATH is the current directory,\n"
1053//usage: "default EXPRESSION is '-print'\n"
1054//usage: "\nEXPRESSION may consist of:"
1055//usage: "\n -follow Follow symlinks"
1056//usage: IF_FEATURE_FIND_XDEV(
1057//usage: "\n -xdev Don't descend directories on other filesystems"
1058//usage: )
1059//usage: IF_FEATURE_FIND_MAXDEPTH(
1060//usage: "\n -maxdepth N Descend at most N levels. -maxdepth 0 applies"
1061//usage: "\n tests/actions to command line arguments only"
1062//usage: )
1063//usage: "\n -mindepth N Don't act on first N levels"
1064//usage: "\n -name PATTERN File name (w/o directory name) matches PATTERN"
1065//usage: "\n -iname PATTERN Case insensitive -name"
1066//usage: IF_FEATURE_FIND_PATH(
1067//usage: "\n -path PATTERN Path matches PATTERN"
1068//usage: )
1069//usage: IF_FEATURE_FIND_REGEX(
1070//usage: "\n -regex PATTERN Path matches regex PATTERN"
1071//usage: )
1072//usage: IF_FEATURE_FIND_TYPE(
1073//usage: "\n -type X File type is X (X is one of: f,d,l,b,c,...)"
1074//usage: )
1075//usage: IF_FEATURE_FIND_PERM(
1076//usage: "\n -perm NNN Permissions match any of (+NNN), all of (-NNN),"
1077//usage: "\n or exactly NNN"
1078//usage: )
1079//usage: IF_FEATURE_FIND_MTIME(
1080//usage: "\n -mtime DAYS Modified time is greater than (+N), less than (-N),"
1081//usage: "\n or exactly N days"
1082//usage: )
1083//usage: IF_FEATURE_FIND_MMIN(
1084//usage: "\n -mmin MINS Modified time is greater than (+N), less than (-N),"
1085//usage: "\n or exactly N minutes"
1086//usage: )
1087//usage: IF_FEATURE_FIND_NEWER(
1088//usage: "\n -newer FILE Modified time is more recent than FILE's"
1089//usage: )
1090//usage: IF_FEATURE_FIND_INUM(
1091//usage: "\n -inum N File has inode number N"
1092//usage: )
1093//usage: IF_FEATURE_FIND_USER(
1094//usage: "\n -user NAME File is owned by user NAME (numeric user ID allowed)"
1095//usage: )
1096//usage: IF_FEATURE_FIND_GROUP(
1097//usage: "\n -group NAME File belongs to group NAME (numeric group ID allowed)"
1098//usage: )
1099//usage: IF_FEATURE_FIND_DEPTH(
1100//usage: "\n -depth Process directory name after traversing it"
1101//usage: )
1102//usage: IF_FEATURE_FIND_SIZE(
1103//usage: "\n -size N[bck] File size is N (c:bytes,k:kbytes,b:512 bytes(def.))"
1104//usage: "\n +/-N: file size is bigger/smaller than N"
1105//usage: )
1106//usage: IF_FEATURE_FIND_LINKS(
1107//usage: "\n -links N Number of links is greater than (+N), less than (-N),"
1108//usage: "\n or exactly N"
1109//usage: )
1110//usage: "\n -print Print (default and assumed)"
1111//usage: IF_FEATURE_FIND_PRINT0(
1112//usage: "\n -print0 Delimit output with null characters rather than"
1113//usage: "\n newlines"
1114//usage: )
1115//usage: IF_FEATURE_FIND_CONTEXT(
1116//usage: "\n -context File has specified security context"
1117//usage: )
1118//usage: IF_FEATURE_FIND_EXEC(
1119//usage: "\n -exec CMD ARG ; Run CMD with all instances of {} replaced by the"
1120//usage: "\n matching files"
1121//usage: )
1122//usage: IF_FEATURE_FIND_PRUNE(
1123//usage: "\n -prune Stop traversing current subtree"
1124//usage: )
1125//usage: IF_FEATURE_FIND_DELETE(
1126//usage: "\n -delete Delete files, turns on -depth option"
1127//usage: )
1128//usage: IF_FEATURE_FIND_PAREN(
1129//usage: "\n (EXPR) Group an expression"
1130//usage: )
1131//usage:
1132//usage:#define find_example_usage
1133//usage: "$ find / -name passwd\n"
1134//usage: "/etc/passwd\n"
1047 1135
1048int find_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; 1136int find_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
1049int find_main(int argc UNUSED_PARAM, char **argv) 1137int find_main(int argc UNUSED_PARAM, char **argv)