07-21-2008
Quote:
Originally Posted by
vijayq8
find *.*
Vijay, that does not work if a sub directory name contains a ".". You may think that's uncommon, but the first time I tried your command, it failed because the directory I was in had a period!
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
I've got 100 directories that each have 2 directories with in them.
Structered like this:
/home/domains/domain1/
through to
/home/domains/domain100/
and those 2 directories mentioned above are here:
/home/domains/domain1/directory1/
/home/domains/domain1/directory2/
through to... (7 Replies)
Discussion started by: Neko
7 Replies
2. UNIX for Dummies Questions & Answers
Hello All, I am trying to list only directories in my current directory using the command "ls -d". But the output only contains the default directory "." and doesn't list the rest of the directories in the working directory. Can anyone explain why this is happening (2 Replies)
Discussion started by: igandu
2 Replies
3. Shell Programming and Scripting
problem String
~~~~~~~~~~~~~~~~~~
icecream= { smart peopleLink "good" LC "happy" ,
smartpeopleLink "dull" LC "sad" }
aend = {smart vc4 eatr kalu}
output needed
~~~~~~~~~~~~~~~~~~
smart peopleLink "good" LC "happy" , smartpeopleLink "dull" LC "sad"
smart vc4... (4 Replies)
Discussion started by: keshav_rk
4 Replies
4. Shell Programming and Scripting
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)
Discussion started by: shis100
7 Replies
5. Shell Programming and Scripting
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)
Discussion started by: pstein
5 Replies
6. Shell Programming and Scripting
If I enter (simplified):
find . -printf "%p\n"
then all files in the output are prepended by a "." like
./local/share/test23.log
How can achieve that
a.) the leading "./" is omitted
and/or
b.) the full path to the current directory is inserted (enclosed by brackets and a blank)... (1 Reply)
Discussion started by: pstein
1 Replies
7. Shell Programming and Scripting
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)
Discussion started by: nightwatchrenba
10 Replies
8. UNIX for Dummies Questions & Answers
How to use "mailx" command to do e-mail reading the input file containing email address, where column 1 has name and column 2 containing “To” e-mail address
and column 3 contains “cc” e-mail address to include with same email.
Sample input file, email.txt
Below is an sample code where... (2 Replies)
Discussion started by: asjaiswal
2 Replies
9. Shell Programming and Scripting
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)
Discussion started by: wolfv
3 Replies
10. Shell Programming and Scripting
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 CENTOS
whereis
WHEREIS(1) User Commands WHEREIS(1)
NAME
whereis - locate the binary, source, and manual page files for a command
SYNOPSIS
whereis [options] [-BMS directory... -f] name...
DESCRIPTION
whereis locates the binary, source and manual files for the specified command names. The supplied names are first stripped of leading
pathname components and any (single) trailing extension of the form .ext (for example: .c) Prefixes of s. resulting from use of source
code control are also dealt with. whereis then attempts to locate the desired program in the standard Linux places, and in the places
specified by $PATH and $MANPATH.
OPTIONS
-b Search only for binaries.
-m Search only for manuals.
-s Search only for sources.
-u Only show the command names that have unusual entries. A command is said to be unusual if it does not have just one entry of each
explicitly requested type. Thus 'whereis -m -u *' asks for those files in the current directory which have no documentation file,
or more than one.
-B list
Limit the places where whereis searches for binaries, by a whitespace-separated list of directories.
-M list
Limit the places where whereis searches for manuals, by a whitespace-separated list of directories.
-S list
Limit the places where whereis searches for sources, by a whitespace-separated list of directories.
-f Terminates the directory list and signals the start of filenames. It must be used when any of the -B, -M, or -S options is used.
-l Output list of effective lookup paths the whereis is using. When non of -B, -M, or -S is specified the option will out hard coded
paths that the command was able to find on system.
EXAMPLE
To find all files in /usr/bin which are not documented in /usr/man/man1 or have no source in /usr/src:
$ cd /usr/bin
$ whereis -u -ms -M /usr/man/man1 -S /usr/src -f *
FILE SEARCH PATHS
By default whereis tries to find files from hard-coded paths, which are defined with glob patterns. The command attempst to use contents of
$PATH and $MANPATH environment variables as default search path. The easiest way to know what paths are in use is to add -l listing
option. Effects of the -B, -M, and -S are display with -l.
AVAILABILITY
The whereis command is part of the util-linux package and is available from Linux Kernel Archive <ftp://ftp.kernel.org/pub/linux/utils
/util-linux/>.
util-linux March 2013 WHEREIS(1)