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)
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)
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)
i have the following in my directory x:
3 files with the word "LIST" inside the files
2 files without the word "LIST"
1 folder (sudirectory)
i want to get the filename of the latest file (timestamp) with the word "LIST".
by the way the script and the list of files are in seperate... (4 Replies)
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)
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)
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)
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)
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)