Sponsored Content
Top Forums Shell Programming and Scripting Help with find command and list in a long format each found file Post 302150035 by alexcol on Monday 10th of December 2007 12:49:26 AM
Old 12-10-2007
Bug Help in finding the newest file for each directory (Recursively)

finding out the problem ive got part of the solutionin this way:

find /bmd -type f -newer $anio$mes$dia$hora$minuto -exec ls -lrtd {} \;

(previously definig the variables
Output
-rw-r----- 1 ftp_coll ict 3251584 Dec 9 23:30 /bmd/boboprd/input/BOBOBSC25480920071209233010000.intec
-rw-r----- 1 ftp_coll ict 2518526 Dec 9 23:49 /bmd/boboprd/input/BOBOBSC25481020071209234956000.intec
-rw-r----- 1 ftp_coll ict 454771 Dec 10 00:00 /bmd/boboprd/BOBOBSC25481120071210000004000.intec
-rw-r----- 1 ftp_coll ict 2324852 Dec 10 00:30 /bmd/boboprd/BOBOBSC25481220071210003007000.intec
-rw-r----- 1 ftp_coll ict 2316639 Dec 9 23:23 /bmd/prod/input/ICTBSC36654520071209232300000.intec
-rw-r----- 1 ftp_coll ict 2871303 Dec 9 23:38 /bmd/prod/input/ICTBSC36654620071209233800000.intec
-rw-r----- 1 ftp_coll ict 1730269 Dec 9 23:53 /bmd/prod/input/ICTBSC36654720071209235301000.intec
but i want the output list just one file (the newest one) for each directory

i woul be grateful to any help. Thanks
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

command find returned bash: /usr/bin/find: Argument list too long

Hello, I create a file touch 1201093003 fichcomp and inside a repertory (which hava a lot of files) I want to list all files created before this file : find *.* \! -maxdepth 1 - newer fichcomp but this command returned bash: /usr/bin/find: Argument list too long but i make a filter all... (1 Reply)
Discussion started by: yacsil
1 Replies

2. UNIX for Dummies Questions & Answers

Argument list too long for Sed command

Hi guys Following command results in sed -i 's/#/\\#/g' /home/test/sqlstents* -bash: /bin/sed: Argument list too long Please help me solve it.. is there any other way i can do this?.. thanks (4 Replies)
Discussion started by: depakjan
4 Replies

3. Shell Programming and Scripting

Argument list too long for date command

Dear Friends, The following script processes a 14508 lines log file. #!/bin/sh while read line do d=`sed 's/* - * \*\/*\/* *\)\] .*/\1/' | tr '/' ' ' | sed 's/\(*\):\(*\)/\1 \2/'` y=`date -d "${d}" "+%Y%m%d%H%M%S"` echo "${y}" done While running the above script, I am... (4 Replies)
Discussion started by: tamil.pamaran
4 Replies

4. Shell Programming and Scripting

Long list file display different time format.

Hi Gurus, I have some weird issue. when using ls -l the result shows different time format: -rw-r--r-- 1 abc gourp1 3032605576 Jun 14 2013 abc -rw-rw-r-- 1 abc gourp1 1689948832 Aug 10 06:22 abc one display 2013 which is year; another one displays 06:22 which is time. ... (4 Replies)
Discussion started by: ken6503
4 Replies

5. UNIX for Advanced & Expert Users

Find command takes too long to complete

Hi, Below is my find command find /opt/app/websphere -name myfolder -perm -600 | wc -l At time it even takes 20 mins to complete. my OS is : SunOS mypc 5.10 Generic_150400-09 sun4v sparc SUNW,T5440 (10 Replies)
Discussion started by: mohtashims
10 Replies

6. UNIX for Dummies Questions & Answers

Getting parameter list is too long in grep command

Hi i am getting below message while using grep command "The parameter list is too long" grep -i 919716499889 * ksh: /usr/bin/grep: 0403-027 The parameter list is too long. please let me know what changes i can do in this command (5 Replies)
Discussion started by: scriptor
5 Replies

7. Shell Programming and Scripting

Find command takes long

Hi, I am trying to search for a Directory called "mont" under a directory path "/opt/app/var/dumps" Although "mont" is in the very parent directory called "dumps" i.e "/opt/app/var/dumps/mont" and it can never be inside any Sub-Directory of "dumps"; my below find command which also checks... (5 Replies)
Discussion started by: mohtashims
5 Replies

8. Shell Programming and Scripting

Find command take too long

Hi, I use the below script that will find n record the entire directory structure for a given folder. bash-3.2$ more mkdir.sh find . -type d |while read rec do echo "mkdir $rec" echo "chmod -R 777 $rec" #done done >> moht.sh The problem is the folder i m running this script... (10 Replies)
Discussion started by: mohtashims
10 Replies

9. Shell Programming and Scripting

How to find list of missing files based on the file format?

Hi All, In the file names we have dates. Based on the file format given by the user, if any file is not existed for a particular date with in a given interval we should consider that file is missing. I have the below files in the directory /bin/daily/voda_files. ... (9 Replies)
Discussion started by: nalu
9 Replies

10. Shell Programming and Scripting

Assistance with my Find command to identify last part of a file name and report the name found

Hello Forum, We have two bootstraps of Chef in our environment which are identified by colour: /var/chef/cache/cookbooks/bootstrap_cookbooks_version_green and /var/chef/cache/cookbooks/bootstrap_cookbooks_version_red I'm attempting to identify which version is installed based on the name... (11 Replies)
Discussion started by: greavette
11 Replies
nisls(1)							   User Commands							  nisls(1)

NAME
nisls - list the contents of a NIS+ directory SYNOPSIS
nisls [-dglLmMR] [name...] DESCRIPTION
For each name that is a NIS+ directory, nisls lists the contents of the directory. For each name that is a NIS+ object other than a direc- tory, nisls simply echos the name. If no name is specified, the first directory in the search path is listed. See nisdefaults(1). OPTIONS
The following options are supported: -d Treat NIS+ directories like other NIS+ objects, rather than listing their contents. -g Display group owner instead of owner when listing in long format. -l List in long format. This option displays additional information about the objects such as their type, creation time, owner, and access rights. The access rights are listed in the following order in long mode: nobody, owner, group owner, and world. -L This option specifies that links are to be followed. If name actually points to a link, it is followed to the linked object. -m Display modification time instead of creation time when listing in long format. -M Master only. This specifies that information is to be returned from the master server of the named object. This guarantees that the most up to date information is seen at the possible expense that the master server may be busy. -R List directories recursively. This option will reiterate the list for each subdirectory found in the process of listing each name. ENVIRONMENT VARIABLES
NIS_PATH If this variable is set, and the NIS+ name is not fully qualified, each directory specified will be searched until the object is found. See nisdefaults(1). EXIT STATUS
The following exit values are returned: 0 Successful operation. 1 Operation failed. ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Availability |SUNWnisu | +-----------------------------+-----------------------------+ SEE ALSO
nisdefaults(1), nisgrpadm(1), nismatch(1), nistbladm(1), nis_objects(3NSL), attributes(5) NOTES
NIS+ might not be supported in future releases of the SolarisTM Operating Environment. Tools to aid the migration from NIS+ to LDAP are available in the Solaris 9 operating environment. For more information, visit http://www.sun.com/directory/nisplus/transition.html. SunOS 5.10 10 Dec 2001 nisls(1)
All times are GMT -4. The time now is 10:36 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy