Sponsored Content
Top Forums UNIX for Dummies Questions & Answers How to search all subdirectories? Post 71771 by zazzybob on Sunday 15th of May 2005 12:31:07 AM
Old 05-15-2005
But what happens when your chief exec has a legitimate file called "core" in his or her home directory that contains their core budget proposals for the year?

Far safer to do something like....
Code:
find /some/path/here -name "core" -type f -exec file {} \; | 
	awk -F: '/core file/ {print $1}' | xargs -t rm

You might need to change the awk depending on your OS

If you keep seeing a core file dumped in the same place time after time (and you can't fix the application thats generating itself directly), just
Code:
>/path/to/core
chmod 400 /path/to/core

This will truncate the core file to 0 bytes, and then make it read only - now when the core dumps, it won't be able to overwrite this file and the core file will remain at 0 bytes. Sloppy but it works...

Cheers
ZB
 

9 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

looping through subdirectories

Hi, How to loop through all the subdirectories in a directory, merge the files present in it to a single file in that subdirectory itself and remove the original files? Please advise. (5 Replies)
Discussion started by: er_ashu
5 Replies

2. Shell Programming and Scripting

search files in a directory and its subdirectories

Hello my friends, I need to write a simple shell bad file :D that search and delete a file it's name 'Microsoft.txt' in the current directory and its subdirectories? So can you help to guide me how i can write this shell, Just give me the beginning :o thank you. (1 Reply)
Discussion started by: Net-Man
1 Replies

3. UNIX for Dummies Questions & Answers

search for files in subdirectories

Hi! I want to find files located in subdirectories. I have tried ls -R | grep myfile but this won't tell me where the file is, only that it is there. Any one have a better idea? Thanks, --Euclid (3 Replies)
Discussion started by: euclid3628800
3 Replies

4. Shell Programming and Scripting

search in all subdirectories for a file containing a certain string

Hello, how can I search a directory AND all its subdirectories for a file containing a certain string? My directories contain too many sql-files and I want to know whcih one of them write into the table "customer"? Can anyone help me? Thanks in advance (1 Reply)
Discussion started by: ABE2202
1 Replies

5. Shell Programming and Scripting

diff different subdirectories

I have 2 directories a/ and b/, they have different subdirectories, how to diff with missing file, or missing subdirectory and if i have in a/ directory "a/ACD/DEF" DEF is a file, but in b/ directory "b/ACD/DEF is a SUBDIRECTORY, how to diff it, thanks my solution for directories, ... (7 Replies)
Discussion started by: knajta
7 Replies

6. UNIX for Dummies Questions & Answers

How to search & list subdirectories with the given file name

Question: How to search & list subdirectories with the given file name? For example: The directory structure looks like; /Builds/DEV/Build_RL01/DDL/ a_tbl_cre.sql ...... /Builds/DEV/Build_RL01/DML/ a_upd.sql .... .... Requirements: 1. I need to find subdirectory DML which is... (0 Replies)
Discussion started by: Siva SQL
0 Replies

7. Shell Programming and Scripting

Find command to search files in a directory excluding subdirectories

Hi Forum, I am using the below command to find files older than x days in a directory excluding subdirectories. From the previous forums I got to know that prune command helps us not to descend in subdirectories. Though I am using it here, not getting the desired result. cd $dir... (8 Replies)
Discussion started by: jhilmil
8 Replies

8. Shell Programming and Scripting

Search subdirectories and find and print total files

Hi All, I have a folder name lets say path/to/folder/CUSTOMER and under this i have several folders and each of these subfolder have serveral subfolders and so on and at some point i will have a folder name called "FTP_FILES" . I need to search for these folders named "FTP_FILES and then... (10 Replies)
Discussion started by: Kevin Tivoli
10 Replies

9. UNIX for Dummies Questions & Answers

Use ls or find for search of subdirectories?

(5 Replies)
Discussion started by: jhsinger
5 Replies
MAN(1)							    BSD General Commands Manual 						    MAN(1)

NAME
man -- display the on-line manual pages (aka ``man pages'') SYNOPSIS
man [-acw|-h] [-C file] [-M path] [-m path] [-S srch] [[-s] section] name ... man -k [-C file] [-M path] [-m path] keyword ... man -p DESCRIPTION
The man utility displays the manual pages named on the command line. Its options are as follows: -a Display all of the man pages for a specified section and name combination. (Normally, only the first man page found is displayed.) -C Use the specified file instead of the default configuration file. This permits users to configure their own man environment. See man.conf(5) for a description of the contents of this file. -c Copy the man page to the standard output instead of using more(1) to paginate it. This is done by default if the standard output is not a terminal device. -h Display only the ``SYNOPSIS'' lines of the requested man pages. For commands, this is typically the command line usage information. For library functions, this usually contains the required include files and function prototypes. -k Display the header lines for any man pages matching keyword(s), in the same manner as apropos(1). -M Override the list of standard directories which man searches for man pages. The supplied path must be a colon (``:'') separated list of directories. This search path may also be set using the environment variable MANPATH. The subdirectories to be searched, and their search order, is specified by the ``_subdir'' line in the man configuration file. -m Augment the list of standard directories which man searches for man pages. The supplied path must be a colon (``:'') separated list of directories. These directories will be searched before the standard directories or the directories specified using the -M option or the MANPATH environment variable. The subdirectories to be searched, and their search order, is specified by the ``_subdir'' line in the man configuration file. -p Print the search path for the manual pages. -s Restrict the directories that man will search to the specified section. The man configuration file (see man.conf(5)) specifies the possible section values that are currently available. -S Display only man pages that have the specified string in the directory part of their filenames. This allows the man page search process criteria to be narrowed without having to change the MANPATH or ``_default'' variables. -w List the pathnames of the man pages which man would display for the specified section and name combination. If the '-s' option is not specified, there is more than one argument, the '-k' option is not used, and the first argument is a valid section, then that argument will be used as if specified by the '-s' option. If name is given with a full or relative path then man interprets it as a file specification, so that you can do man ./foo.5 or even man /cd/foo/bar.1.gz. ENVIRONMENT
MACHINE As some man pages are intended only for specific architectures, man searches any subdirectories, with the same name as the current architecture, in every directory which it searches. Machine specific areas are checked before general areas. The current machine type may be overridden by setting the environment variable MACHINE to the name of a specific architecture. MANPATH The standard search path used by man may be overridden by specifying a path in the MANPATH environment variable. The format of the path is a colon (``:'') separated list of directories. The subdirectories to be searched as well as their search order is speci- fied by the ``_subdir'' line in the man configuration file. PAGER The pagination command used for writing the output. If the PAGER environment variable is null or not set, the standard pagination program more(1) will be used. FILES
/etc/man.conf default man configuration file. /usr/{share,X11R7,pkg,local}/man/whatis.db standard whatis/apropos database search path, set in /etc/man.conf. SEE ALSO
apropos(1), whatis(1), whereis(1), man.conf(5), mdoc(7), mdoc.samples(7) STANDARDS
man conforms to X/Open Commands and Utilities Issue 5 (``XCU5''). BUGS
The on-line man pages are, by necessity, forgiving toward stupid display devices, causing a few man pages to be not as nicely formatted as their typeset counterparts. BSD
October 7, 2011 BSD
All times are GMT -4. The time now is 05:16 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy