If you have locate installed, this should find it efficiently:
If you don't, and really want to do a brute-force search of the entire system, bar nothing and nobody:
The 2> because this is going to spew lots of errors when it blunders through areas it doesn't belong.
If you can narrow it down even the slightest bit, you can make it much faster:
Hi all,
I want to search the files in a remote machine for a particular string. The SSH command I wrote is giving an error even when the syntax is correct.
ssh user@hostmachine find . -name "*.txt" -exec grep "ARIVU" '{}' \;
The error it gives is find: missing argument to `-exec'
When the... (2 Replies)
Hi All,
URGENT - Please help me form a scipt for this:
I need the LATEST file from a dir on REMOTE machine to be SCP'd to a dir on local machine. (and I need to execute this from local server)
I know that the below cmd is used to find the LATEST file from a dir. But this command is not... (3 Replies)
Hi All..
Am new to Unix!!
Am creating a shell script in which a scenario is like i have transfer the output file from unix machine (Server) to local directory (Windows xp).
And also i have to transfer the input file from the local directory to Unix machine (Server)
Any help from you... (1 Reply)
I am a newbie and would like some help with the following -
Trying to search fileA for a string similar to -
AS11000022010 30.4 31.7 43.7 53.8 60.5 71.1 75.2 74.7 66.9 56.6 42.7 32.5 53.3
I then want to replace that string with a string from fileB - ... (5 Replies)
Hi ,
I have been trying to write a perl script to do this job. But i am not able to achieve the desired result. Below is my code.
my $current_value=12345;
my @users=("bob","ben","tom","harry");
open DBLIST,"<","/var/tmp/DBinfo";
my @input = <DBLIST>;
foreach (@users)
{
my... (11 Replies)
Hi Team,
I am new to unix, please help me in this.
I have a file named properties.
The content of the file is :
##Mobile props
east.url=https://qa.east.corp.com/prop/end
west.url=https://qa.west.corp.com/prop/end
south.url=https://qa.south.corp.com/prop/end... (2 Replies)
I have two files:
file 1:
hello.com neo.com,japan.com,example.com
news.net xyz.com, telecom.net, highlands.net, software.com
example2.com earth.net, abc.gov.uk
file 2:
neo.com
example.com
abc.gov.uk
file 2 are the search keys to search in file 1 if any of the search... (7 Replies)
I'm trying to find a way to search a range of similar words in a file. I tried using sed but can't get it right:sed 's/\(ca01\)*//'It only removes "ca01" but leaves the rest of the word. I still want the rest of the information on the lines just not these specific words listed below. Any... (3 Replies)
Hi guys,
I have a text file named file1.txt that is formatted like this:
001 , ID , 20000
002 , Name , Brandon
003 , Phone_Number , 616-234-1999
004 , SSNumber , 234-23-234
005 , Model , Toyota
007 , Engine ,V8
008 , GPS , OFF
and I have file2.txt formatted like this:
... (2 Replies)
Run a loop that will search for a file to thousand machine and know who owns the file
$ for i in abc{01..02}
> do
> echo -n $i
> ssh $i "sudo find / -name .ssh -exec ls -l {} \;|grep id"
> done
abc01-rw-------. 1 root root 1675 Nov 10 2018 id_rsa
abc01-rw-------. 1 root root 1675 Nov 14... (6 Replies)
Discussion started by: invinzin21
6 Replies
LEARN ABOUT FREEBSD
whereis
WHEREIS(1) BSD General Commands Manual WHEREIS(1)NAME
whereis -- locate programs
SYNOPSIS
whereis [-abmqsux] [-BMS dir ... -f] program ...
DESCRIPTION
The whereis utility checks the standard binary, manual page, and source directories for the specified programs, printing out the paths of any
it finds. The supplied program names are first stripped of leading path name components, any single trailing extension added by gzip(1),
compress(1), or bzip2(1), and the leading 's.' or trailing ',v' from a source code control system.
The default path searched is the string returned by the sysctl(8) utility for the ``user.cs_path'' string, with /usr/libexec and the current
user's $PATH appended. Manual pages are searched by default along the $MANPATH. Program sources are located in a list of known standard
places, including all the subdirectories of /usr/src and /usr/ports.
The following options are available:
-B Specify directories to search for binaries. Requires the -f option.
-M Specify directories to search for manual pages. Requires the -f option.
-S Specify directories to search for program sources. Requires the -f option.
-a Report all matches instead of only the first of each requested type.
-b Search for binaries.
-f Delimits the list of directories after the -B, -M, or -S options, and indicates the beginning of the program list.
-m Search for manual pages.
-q (``quiet''). Suppress the output of the utility name in front of the normal output line. This can become handy for use in a back-
quote substitution of a shell command line, see EXAMPLES.
-s Search for source directories.
-u Search for ``unusual'' entries. A file is said to be unusual if it does not have at least one entry of each requested type. Only
the name of the unusual entry is printed.
-x Do not use ``expensive'' tools when searching for source directories. Normally, after unsuccessfully searching all the first-level
subdirectories of the source directory list, whereis will ask locate(1) to find the entry on its behalf. Since this can take much
longer, it can be turned off with -x.
EXAMPLES
The following finds all utilities under /usr/bin that do not have documentation:
whereis -m -u /usr/bin/*
Change to the source code directory of ls(1):
cd `whereis -sq ls`
SEE ALSO find(1), locate(1), man(1), which(1), sysctl(8)HISTORY
The whereis utility appeared in 3.0BSD. This version re-implements the historical functionality that was lost in 4.4BSD.
AUTHORS
This implementation of the whereis command was written by Jorg Wunsch.
BUGS
This re-implementation of the whereis utility is not bug-for-bug compatible with historical versions. It is believed to be compatible with
the version that was shipping with FreeBSD 2.2 through FreeBSD 4.5 though.
The whereis utility can report some unrelated source entries when the -a option is specified.
BSD August 22, 2002 BSD