Sponsored Content
Full Discussion: get latest file
Top Forums Shell Programming and Scripting get latest file Post 38050 by oombera on Saturday 5th of July 2003 11:01:10 AM
Old 07-05-2003
Try this:

find . -name "*" -print | xargs grep -l "Kevin" | xargs ls -lt | head -n 1
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

How to Grab the latest file

I have been trying to use the find command to grab the latest file in a directory and move it to another area. I can't seem to get only that file, I end up getting everything for the day. Any ideas? Thank you (1 Reply)
Discussion started by: n9ninchd
1 Replies

2. UNIX for Dummies Questions & Answers

Getting latest file from ftp

Hi, i have multile JAMA01.DAT.* files in my ftp. how can i get the latest file in from the ftp by executing the script :rolleyes:? Regards, Arun S (3 Replies)
Discussion started by: arunavlp
3 Replies

3. Shell Programming and Scripting

How do I get the name of latest file?

1) How do I get the name of latest file in a variable? 2) Is it safe to delete all files from a dir I am doing cd $dir_name if return_code > 0 rm * fi what are other alternates to delete all files from a dir in a shell script? :) (5 Replies)
Discussion started by: Hangman2
5 Replies

4. Shell Programming and Scripting

how to get the latest file

I am trying to scp the latest file which ends with "_abc.log". Can some help me figure out how can do that? (3 Replies)
Discussion started by: shehzad_m
3 Replies

5. Shell Programming and Scripting

To get the latest file

Hi Experts Team, I wish to store the latest file name of partcular pattern in the remote server in a variable. i tried this LATEST_FILE=`ssh ${USER_ID}@${REMOTE_HOSTNAME} 'ls -t ${SOURCE_DIRECTORY}/${SOURCE_FILEPATTERN}'` but its nt working..pls guide me.. Regards, Kanda (2 Replies)
Discussion started by: spkandy
2 Replies

6. Shell Programming and Scripting

Rename The Latest File

i need to get the latest file based on timestamp. assuming that i have the following files: $ ls -latr total 40 drwxr-sr-x 6 pcrdftdv pcrdgrp 512 Jun 30 12:53 .. -rwxrwxrwx 1 pcrdftdv pcrdgrp 6 Jul 07 13:35 sample1.csv -rwxr-xr-x 1 pcrdftdv pcrdgrp 6... (3 Replies)
Discussion started by: wtolentino
3 Replies

7. Shell Programming and Scripting

search for latest file

Hi, In need to write a bash script which will be run periodically to check the files in a target directory. This receives files on an ad hoc basis and the script need to compare the time stamp of the latest file received with system time and write a message to the server log file if the time... (2 Replies)
Discussion started by: mark_s_g
2 Replies

8. Shell Programming and Scripting

Shell script to get the latest file from the file list and move

Hi, Anybody help me to write a Shell Script Get the latest file from the file list based on created and then move to the target directory. Tried with the following script: got error. A=$(ls -1dt $(find "cveit/local_ftp/reflash-parts" -type f -daystart -mtime -$dateoffset) | head... (2 Replies)
Discussion started by: saravan_an
2 Replies

9. Shell Programming and Scripting

Retaining latest file

Hi All, I have a requirement where there are 2 files saved on unix directory with names anil_111 and anil_222. I just have to retain the latest file and delete the old file from the directory. Please help me with the shell script to perform this. Thanks, Anil (7 Replies)
Discussion started by: anil029
7 Replies

10. Shell Programming and Scripting

Picking the latest file based on a timestamp for a Dynamic file name

Hi , I did the initial search but could not find what I was expecting for. 15606Always_9999999997_20160418.xml 15606Always_9999999998_20160418.xml 15606Always_9999999999_20160418.xml 9819Always_99999999900_20160418.xml 9819Always_99999999911_20160418.xmlAbove is the list of files I... (4 Replies)
Discussion started by: chillblue
4 Replies
cachefspack(1M) 					  System Administration Commands					   cachefspack(1M)

NAME
cachefspack - pack files and file systems in the cache SYNOPSIS
cachefspack [-h] [-i | -p | -u] [-f packing-list] [-U cache-directory] [file...] DESCRIPTION
The cachefspack utility is used to set up and maintain files in the cache. This utility affords greater control over the cache, ensuring that the specified files are in the cache whenever possible. cachefspack does not pack files when the backfileystem type for the cachefs mount is NFSv4. This is because only pass-through support is available for cachefs with NFSv4. OPTIONS
The following options are supported: -f packing-list Specify a file containing a list of files and directories to be packed. Options within subdirectories and files can also be specified. The format and rules governing packing-list are described on the packingrules(4) manual page. Directories are packed recursively. Symlinks that match a regular expression on a LIST command are followed. Sym- links encountered while recursively processing directories are not followed. -h Help. Print a brief summary of all the options. -i View information about the packed files. -p Pack the file or files specified by file. This is the default behavior. -u Unpack the file or files specified by file. -U cache-directory Unpack all files in the specified cache directory. OPERANDS
The following operands are supported: file A path name of a file to be packed or unpacked. USAGE
See largefile(5) for the description of the behavior of cachefspack when encountering files greater than or equal to 2 Gbyte ( 2 **31 bytes). EXAMPLES
Example 1: Packing a File in the Cache The following example packs the file projects in the cache: % cachefspack -p projects Example 2: Packint Files in the Cache The following example packs the files projects, updates, and master_plan in the cache: % cachefspack -p projects updates master_plan Example 3: Unpacking a File From the Cache The following example unpacks the file projects from the cache: % cachefspack -u projects Example 4: Unpacking Files From the Cache The following example unpacks the files projects, updates, and master_plan from the cache: % cachefspack -u projects updates master_plan Example 5: Unpacking All Files From in a Cache Directory The following example unpacks all files in the cache directory cache1: % cachefspack -U /cache/cache1 Example 6: Using a Packing List The following example illustrates the use of a packing list to specify files to be packed in the cache. The contents of lists.pkg are as follows: IGNORE SCCS BASE /src/junk LIST *.c LIST *.h The following command packs all files in the /src/junk directory which have .c and .h extensions, and do contain the string SCCS in the file's path name: % cachefspack -f lists.pkg EXIT STATUS
0 Successful completion. >0 An error occurred. ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Availability |SUNWcsu | +-----------------------------+-----------------------------+ SEE ALSO
cfsadmin(1M), mount_cachefs(1M), packingrules(4), attributes(5), largefile(5) SunOS 5.10 18 Mar 2004 cachefspack(1M)
All times are GMT -4. The time now is 05:12 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy