Sponsored Content
Top Forums Shell Programming and Scripting Find directory name while traversing subdirectories Post 302418434 by clx on Tuesday 4th of May 2010 09:45:35 AM
Old 05-04-2010
Try:
Code:
find /usr -name "6*" -type f 2>/dev/null | awk -F "/" '{print $(NF-1)}'

 

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
edquota(8)						      System Manager's Manual							edquota(8)

NAME
edquota - edits quotas SYNOPSIS
/usr/sbin/edquota [-gGuU] -t /usr/sbin/edquota [-p proto_username] [-u] username ... /usr/sbin/edquota [-P proto_userID] -U userID ... /usr/sbin/edquota [-P proto_userID] [-u] username ... /usr/sbin/edquota [-p proto_username] -U userID ... /usr/sbin/edquota [-p proto_groupname] -g groupname ... /usr/sbin/edquota [-P proto_groupID] -G groupID ... /usr/sbin/edquota [-P proto_groupID] -g groupname ... /usr/sbin/edquota [-p proto_groupname] -G groupID ... PARAMETERS
Specifies a prototypical user or group by the user name or group name. A prototypical user or group has previously-defined, valid quota files that you want to duplicate for other user or group quota files. Specifies a prototypical user or group by the user id or group id. A prototypical user or group has previously-defined, valid quota files that you want to duplicate for other user or group quota files. FLAGS
Edits the quotas of one or more groups, specified by groupname on the command line. When used with the -t flag, sets or changes the grace period for all file systems with group quotas specified in the /etc/fstab file. Edits the quotas of one or more groups, specified by groupID on the command line. When used with the -t flag, sets or changes the grace period for all file systems with group quotas specified in the /etc/fstab file. Initializes the specified quotas by duplicating the established quotas of the prototypical user's name (when used with the -u flag, the -U flag, or no other flags) or the prototypical group's name (when used with the -g or -G flags). The proto_username or proto_groupname must have a valid quota file. Establishing quotas for one user or group and then using the -p flag to duplicate these quotas for other users is the normal mechanism for initializing quotas for a group of users. Initializes the specified quotas by duplicat- ing the established quotas of the prototypical user's id (when used with the -U flag or the -u flag) or the prototypical group's id (when used with the -G flag or the -g flag). The proto_userID or proto_groupID must have a valid quota file. Establishing quotas for one user or group and then using the -P flag to duplicate these quotas for other users is the normal mechanism for initializing quotas for a group of users. Sets or changes the default grace period for which users may exceed their soft limits. By default, or when you specify -t with the -u flag, the grace period is set for all file systems with user quotas specified in the /etc/fstab file. When you specify -t with the -g flag, the grace period is set for all of the file systems with group quotas specified in the /etc/fstab file. Edits the quotas of one or more users, specified by username ... on the command line. The -u flag is the default. The -u flag, used with the -t flag, changes the grace period for all file systems with user quotas specified in the /etc/fstab file. Edits the quotas of one or more users, specified by userID ... on the command line. The -U flag used with the -t flag, changes the grace period for all file systems with user quotas speci- fied in the /etc/fstab file. DESCRIPTION
The edquota command is a quota editor that allows you to add and modify user and group quotas and modify file system quota grace periods. Use the quota command to display the existing quota information. Note that disk quotas are displayed as 1 kilobyte blocks. For each user or group specified, the edquota command creates a temporary file with an ASCII representation of the current quotas for that user or group, then invokes an editor to allow you to modify the file. The vi editor is invoked by default. To override the default, specify a different editor for the EDITOR environment variable in your login file. Setting a hard limit to 0 (zero) indicates that no quota should be imposed. Setting a hard limit to 1 (one) indicates that no allocations should be permitted. Setting a soft limit to 1 (one) with a hard limit of 0 (zero) indicates that allocations should be permitted on only a temporary basis (see the -t flag). The current usage information in the file is for informational purposes; only the hard and soft lim- its can be changed. For each file system, the edquota command creates a temporary file with an ASCII representation of the current grace period for that user or group, then invokes an editor to allow you to modify the grace period. The grace period may be specified in days, hours, minutes, or seconds. Setting a grace period to 0 (zero) indicates that the default grace period should be imposed. Setting a grace period to 1 second indicates that no grace period should be granted. When you exit the editor, edquota reads the temporary file and modifies the quota.user and quota.group files for the target file system to reflect the changes made. Changes in grace periods take effect immediately unless a grace period is currently in effect. For example, assume a user exceeds a soft limit and receives a grace period of 7 days. A subsequent change to a grace period of 1 day will not affect the user's already-invoked grace period, unless the user drops below the soft limit and exceeds it once again. The default grace period for a file system is speci- fied in the quota.user and quota.group files for the target file system. RESTRICTIONS
You can use the edquota command to edit only those file systems that are in the /etc/fstab file and have userquota and groupquota entries. You must be the root user to edit quotas. NOTES
The term file system represents either a UFS file system or an AdvFS fileset. The root user can exceed user and group quotas. The fileset grace period is equal to the group grace period. When you use the edquota command to set the group grace period for a fileset causes that same value to be used for the fileset grace period. EXAMPLES
To apply the existing quotas of the user named user1 to the user named user2: /usr/sbin/edquota -p user1 -u user2 To apply the existing quotas of the user named user1 to the user named user2, using the default: /usr/sbin/edquota -p user1 user2 To apply the existing quotas of the user with the user id 361 to the user with the user id 382: /usr/sbin/edquota -P 361 -U 382 To apply the existing quotas of the user named user1 to the user with the user id 382: /usr/sbin/edquota -p user1 -U 382 FILES
Specifies the command path Contains user quotas for file systems Contains group quotas for file systems Contains file system names and locations RELATED INFORMATION
quota(1), quotacheck(8), quotaon(8), quotactl(2), fstab(4). delim off edquota(8)
All times are GMT -4. The time now is 12:27 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy