Sponsored Content
Top Forums Shell Programming and Scripting Shell:Find a word in files in a directory and subdirectories Post 302230337 by yeclota on Friday 29th of August 2008 05:05:45 AM
Old 08-29-2008
It's Ok

It's Ok, Thanks for your help.

Lota
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Find all files created by a specified user in a directory and its subdirectories

Is there a command or shell script which can be used for Finding all files created by a specified userid in a directory and its subdirectories. Say, I want to find all such files in directory /abc as well as in all the subdirectories such as /abc/xyz or /abc/xyz/pqr aqnd so on which was created... (5 Replies)
Discussion started by: abhilashnair
5 Replies

2. UNIX for Dummies Questions & Answers

How to find a word in a all the files in a Directory??

I want to find a specific word present in all the files ina directory....Please tell me the command to be used?? Thanks (6 Replies)
Discussion started by: shikhakaul
6 Replies

3. UNIX for Dummies Questions & Answers

Find Files in a Directory Excluding Subdirectories

Hi, I have a filename Location.txt in a directory /abc. Similar name file is present in its subdirectory /abc/xyz. I want to find the file which is present only in /abc and not in /abc/xyz. Please any1 of u can provide a quick suggestion. Its very urgent. Thanks, Amol (2 Replies)
Discussion started by: Amol_Dicholkar
2 Replies

4. Shell Programming and Scripting

to parse a directory and its subdirectories and find owner name of files

hi all, i need to capture all the files in a directory and its subdirectories that have owner name different than the root owner. for one file it is " stat -c %U filename " but i need to search for each and every file and record it. thanks in advance (14 Replies)
Discussion started by: vyasa
14 Replies

5. Shell Programming and Scripting

Find directory name while traversing subdirectories

Hi, I have a parent directory in which I have sub directories of different depth /usr/usr1/user2/671 /usr/usr1/672 /usr/user2/user1/673 /usr/user2/user3/user4/674 And I need the names of all the directories that which starts only with 6 in a file. Thanks, (12 Replies)
Discussion started by: arun_maffy
12 Replies

6. Shell Programming and Scripting

Find and replace a word in all the files (that contain the word) under a directory

Hi Everyone, I am looking for a simple way for replacing all the files under a directory that use the server "xsgd1234dap" with "xsdr3423pap". For Example: In the Directory, $pwd /home/nick $ grep -l "xsgd1234dap" *.sh | wc -l 119 I have "119" files that are still using... (5 Replies)
Discussion started by: filter
5 Replies

7. Shell Programming and Scripting

Find files only in current directory...not subdirectories

Hi, I have to find files only in the current directory...not in the sub directories. But when I use Find command ... it searches all the files in the current directory as well as in the subdirectories. I am using AIX-UNIX machine.Please help..I tried to use maxdepth..but it is not working in AIX. (2 Replies)
Discussion started by: vsachan
2 Replies

8. 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

9. Shell Programming and Scripting

Find word in a directory files

Hi folks, i have a file in which i have words like below words.txt(file name) and words are arranged likes no spaces between words Apple Banana Carrot And i have list files which have these words in a directory (/tmp/satemp) test1.txt test2.txt test3.txt So if the word 'Apple' is... (3 Replies)
Discussion started by: coolboy98699
3 Replies

10. Shell Programming and Scripting

Find/searching files in subdirectories excluding the fiels in Parent Directory

Hi All, requirement is to find and remove the files from sub directories but it should exclude the files from parent directory. At present i am using the below one but it finds and remove files from both parent and sub directories. find ${PATH} -type f \( -name securitas\* -o -name \*gz... (1 Reply)
Discussion started by: Naveenkk
1 Replies
mktrashcan(1)						      General Commands Manual						     mktrashcan(1)

NAME
mktrashcan, rmtrashcan, shtrashcan - Attaches, detaches, or shows a trashcan directory SYNOPSIS
/usr/sbin/mktrashcan trashcan directory... /usr/sbin/rmtrashcan directory... /usr/sbin/shtrashcan directory... OPERANDS
Specifies the directory that contains files that were deleted from attached directories. Whenever you delete a file in the specified directory, the file system automatically moves the file to the trashcan directory. Specifies the directory that you attach to a trashcan directory. DESCRIPTION
The trashcan utilities (mktrashcan and rmtrashcan) enable you to attach or detach an existing directory, which you specify as a trashcan directory, to any number of directories within the same fileset. A trashcan directory stores the files that are deleted with the unlink system call. For instance, you can use the mktrashcan utility to attach a trashcan directory called /usr/trashcan to one or more directories; thereafter, when you delete a file from one of the attached directories, the file system moves the file to the /usr/trashcan directory. Note that when more than one directory shares attachment to a trashcan directory, files with the same file name can overwrite each other in the trashcan directory. If you mistakenly delete a file, use the mv command to return the file from the /usr/trashcan directory to its original directory. When you enter shtrashcan at the system prompt, the system shows the trashcan directory, if one exists, for the directory you specified. It is important that trashcan directories have correct access permissions. If the permissions are too restrictive, then it may be impossi- ble to remove files from the directories that are attached to the trashcan directory. In general, all users and groups that expect to use the trashcan directory need write permission to the directory. If unexpected "permission denied" errors occur when deleting files that are in a directory attached to a trashcan directory, use the chmod command to change the permissions on the trashcan directory. RESTRICTIONS
The directory and trashcan directories must be in the same fileset; however, you can attach the trashcan directory to any directory within the fileset. EXAMPLES
The following example creates and attaches a trashcan directory, /usr/trashcan, to two directories, /usr/ray and /usr/projects/sql/test, which are in the same fileset. The chmod command adds write permission for all users and groups on the new trashcan directory. % mkdir /usr/trashcan % chmod a+w /usr/trashcan % mktrashcan /usr/trashcan /usr/ray /usr/projects/sql/test To attach the trashcan directory, /usr/trashcan, to all subdirectories in the /usr directory, enter: % mktrashcan /usr/trashcan /usr/* New subdirectories that you add beneath the /usr directory are not attached to the trashcan directory until you attach them. Also, the mktrashcan utility distinguishes between directories and files, attaching only directories to the trashcan directory. Note that an attached directory produces an EDUPLICATE_DIRS (-1165) error when /usr/trashcan is itself in the directory path you attach to (as in the previous example). You can ignore this error message. SEE ALSO
advfs(4), mkfset(8), showfsets(8) mktrashcan(1)
All times are GMT -4. The time now is 06:59 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy