/proc is a special filesystem that is very transitionary as it mirrors the state of the O/S, and has no "real" files, so I would recommend not running the find against it...You can remove it from the list by using something like:
The speed of the find is linked to the speed of the filesystem, the speed of the hardware it is running on, the tuning of the O/S (filesystem and inode cache sizes, etc), and the other work the server is doing.
I would recommend installing the GNU "findutils" and use "locate" if you are doing this on a regular basis.
Dear friends,
please tell me how to find the files which are existing in the current directory, but it sholud not search in the sub directories..
it is like this,
current directory contains
file1, file2, file3, dir1, dir2
and dir1 conatins
file4, file5
and dir2 contains
file6,... (9 Replies)
Hi,
I have line in input file as below:
3G_CENTRAL;INDONESIA_(M)_TELKOMSEL;SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL
My expected output for line in the file must be :
"1-Radon1-cMOC_deg"|"LDIndex"|"3G_CENTRAL|INDONESIA_(M)_TELKOMSEL"|LAST|"SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL"
Can someone... (7 Replies)
I want to list all files/lines which except those which contain the pattern ' /proc/' OR ' /sys/' (mind the leading blank).
In a first approach I coded:
find / -exec ls -ld {} | grep -v ' /proc/| /sys/' \; > /tmp/list.txt
But this doesn't work. I got an error (under Ubuntu):
grep:... (5 Replies)
Hello everyone
Sorry I have to add another sed question. I am searching a log file and need only the first 2 occurances of text which comes after (note the space) "string " and before a ",". I have tried
sed -n 's/.*string \(*\),.*/\1/p' filewith some, but limited success. This gives out all... (10 Replies)
I have a bunch of random character lines like ABCEDFG. I want to find all lines with "A" and then change any "E" to "X" in the same line. ALL lines with "A" will have an "X" somewhere in it. I have tried sed awk and vi editor. I get close, not quite there. I know someone has already solved this... (10 Replies)
I am new to bash/shell scripting.
I want to find all the files in directory and subdirectories, which are not ends with “.zip” and which are contains in the file name “*.log*” or “*.out*”.
I know below command to get the files which ends with “.log”; but I need which are not ends with this... (4 Replies)
These three finds worked as expected:
$ find . -iname "*.PDF"
$ find . -iname "*.PDF" \( ! -name "*_nobackup.*" \)
$ find . -path "*_nobackup*" -prune -iname "*.PDF"
They all returned the match:
./folder/file.pdf
:b:
This find returned no matches:
$ find . -path "*_nobackup*" -prune... (3 Replies)
Hello.
System : opensuse leap 42.3
I have a bash script that build a text file.
I would like the last command doing :
print_cmd -o page-left=43 -o page-right=22 -o page-top=28 -o page-bottom=43 -o font=LatinModernMono12:regular:9 some_file.txt
where :
print_cmd ::= some printing... (1 Reply)
I am trying find files in sub dir with certain tags using tag command, and add the period to the beginning. I can't use chflags hidden {} cause it doesn't add period to the beginning of the string for web purpose. So far with my knowledge, I only know mdfind or tag can be used to search files with... (6 Replies)
Discussion started by: Nexeu
6 Replies
LEARN ABOUT V7
updatedb
UPDATEDB(1) General Commands Manual UPDATEDB(1)NAME
updatedb - update a file name database
SYNOPSIS
updatedb [options]
DESCRIPTION
This manual page documents the GNU version of updatedb, which updates file name databases used by GNU locate. The file name databases con-
tain lists of files that were in particular directory trees when the databases were last updated. The file name of the default database is
determined when locate and updatedb are configured and installed. The frequency with which the databases are updated and the directories
for which they contain entries depend on how often updatedb is run, and with which arguments.
In networked environments, it often makes sense to build a database at the root of each filesystem, containing the entries for that
filesystem. updatedb is then run for each filesystem on the fileserver where that filesystem is on a local disk, to prevent thrashing the
network. Users can select which databases locate searches using an environment variable or command line option; see locate(1). Databases
can not be concatenated together.
The file name database format changed starting with GNU find and locate version 4.0 to allow machines with different byte orderings to
share the databases. The new GNU locate can read both the old and new database formats. However, old versions of locate and find produce
incorrect results if given a new-format database.
OPTIONS
--findoptions='-option1 -option2...'
Global options to pass on to find. The environment variable FINDOPTIONS also sets this value. Default is none.
--localpaths='path1 path2...'
Non-network directories to put in the database. Default is /.
--netpaths='path1 path2...'
Network (NFS, AFS, RFS, etc.) directories to put in the database. The environment variable NETPATHS also sets this value. Default
is none.
--prunepaths='path1 path2...'
Directories to not put in the database, which would otherwise be. Remove any trailing slashes from the path names, otherwise updat-
edb won't recognise the paths you want to omit (because it uses them as regular expression patterns). The environment variable
PRUNEPATHS also sets this value. Default is /tmp /usr/tmp /var/tmp /afs.
--prunefs='path...'
File systems to not put in the database, which would otherwise be. Note that files are pruned when a file system is reached; any
file system mounted under an undesired file system will be ignored. The environment variable PRUNEFS also sets this value. Default
is nfs NFS proc.
--output=dbfile
The database file to build. Default is /var/lib/locatedb.
--localuser=user
The user to search non-network directories as, using su(1). Default is to search the non-network directories as the current user.
You can also use the environment variable LOCALUSER to set this user.
--netuser=user
The user to search network directories as, using su(1). Default is nobody. You can also use the environment variable NETUSER to
set this user.
--old-format
Create the database in the old format. This is a synonym for --dbformat=old.
--dbformat=F
Create the database in format F. The default format is called LOCATE02. F can be old to select the old database format (this is
the same as specifying --old-format). Alternatively the slocate format is also supported. When the slocate format is in use, the
database produced is marked as having security level 1. If you want to build a system-wide slocate database, you may want to run
updatedb as root.
--version
Print the version number of updatedb and exit.
--help Print a summary of the options to updatedb and exit.
SEE ALSO find(1), locate(1), locatedb(5), xargs(1) Finding Files (on-line in Info, or printed)
BUGS
The updatedb program correctly handles filenames containing newlines, but only if the system's sort command has a working -z option. If
you suspect that locate may need to return filenames containing newlines, consider using its --null option.
The best way to report a bug is to use the form at http://savannah.gnu.org/bugs/?group=findutils. The reason for this is that you will
then be able to track progress in fixing the problem. Other comments about updatedb(1) and about the findutils package in general can be
sent to the bug-findutils mailing list. To join the list, send email to bug-findutils-request@gnu.org.
UPDATEDB(1)