Sponsored Content
Top Forums Shell Programming and Scripting Find directory name while traversing subdirectories Post 302418437 by arun_maffy on Tuesday 4th of May 2010 09:50:26 AM
Old 05-04-2010
Both the above commands are giving me only the first directory name from the parent directory where I search, like:

usr1
usr1
user2
user2
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

makefiles in a directory and subdirectories

I need to develop a makefile that spans across directories. For example, let's say i have an upper level directory (main) and about 2 subdirectories. I want my .cpp files and .o files to be in one subdirectory. I want my .a files to be in the other subdirectory. The .a files are made up of the... (0 Replies)
Discussion started by: benjie_asu
0 Replies

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

3. Shell Programming and Scripting

Shell:Find a word in files in a directory and subdirectories

I'm looking to write a ksh code with will be alble to find a word like 'toto' in all files going from my current directory. eg. /doc ----------->have: text.c which "toto" /doc/usr-------->have: build.pc, help.java which "toto" /doc/usr/cach -->have: test.sh which "toto" /doc/build... (4 Replies)
Discussion started by: yeclota
4 Replies

4. UNIX for Dummies Questions & Answers

script for traversing directory

hi please suggest a korn script which will traverse all subdirectory in the current directory? (2 Replies)
Discussion started by: ilayans
2 Replies

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

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

7. Shell Programming and Scripting

Copying subdirectories of a directory to some other directory and renaming them

Hi, I am a newbie in shell scripting. I have to copy a particular sub-directory (data) from a large no. of directories (all in the same folder) and paste them to another directory ( /home/hubble/data ) and then rename all the subdirectories (data) as the name of its parent directory. please... (8 Replies)
Discussion started by: sholay
8 Replies

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

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

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
NCDESTROY(1)						    BSD General Commands Manual 					      NCDESTROY(1)

NAME
ncdestroy -- Destroy kernel NFS credentials SYNOPSIS
ncdestroy [-v] [-P] [path [path...]] DESCRIPTION
ncdestroy invalidates the caller's kernel GSS credentials for any of the specified path's associated NFS mounts. If no paths are specified then all the caller's associated credentials for all NFS file systems are destroyed. When a nfs file system is mounted using a GSS mechanism (currently only Kerberos is supported) through the ``sec='' option or by the export specified on the server, the resulting session context is stored in a table for each mount. If the user decides to finish his or her session or chooses to use a different credential, then ncdestroy can be called to invalidate those credentials in the kernel. New credentials can be obtain (typically by calling kinit) and those credentials can be used when accessing the mount. The options are as follows: -v Be verbose and show what file system is being operated on and any resulting errors. -P If the trailing component resolves to a symbolic link do not resolve the link but use the current path to determine any associate NFS file system. EXAMPLES
If leaving for the day: $ kdestroy -A $ ncdestroy Lets say a user does $ kinit user@FOO.COM And through the automounter access a path /Network/Serves/someserver/Sources/foo/bar where the mount of /Network/Servers/some- server/Sources/foo was done with user@FOO.COM. $ cat /Network/Servers/someserver/Sources/foo/bar cat: /Network/Servers/someserver/Sources/foo/bar: Permission denied The user realizes that in order to have access on the server his identity should be user2@BAR.COM. So: $ kdestroy -A $ kinit user2@BAR.COM $ ncdestroy /Network/Servers/someserver/Sources/foo Now the local user can access bar NOTES
In the above example the user destroyed all credentials so the only credential to choose was new credential user2@BAR.COM. However, if accessing the server with user@FOO.COM was done by getting a cross realm TGT to obtain the service ticket nfs/some.server.fqdn@BAR.COM, then it won't be necessary to use kdestroy. The GSS infrastructure will prefer to use credentials in the same realm as the service. DIAGNOSTICS
The ncdestroy command will exit with 1 if any of the supplied paths don't exist. If all paths exist or no paths are given the exit status will be 0. SEE ALSO
kinit(1), kdestroy(1), mount_nfs(8) BUGS
There should be an option to kdestroy to destroy cached nfs contexts. BSD
December 10, 2012 BSD
All times are GMT -4. The time now is 12:46 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy