10 More Discussions You Might Find Interesting
1. UNIX for Beginners Questions & Answers
Hi All,
I have list of files like below with name abcxyz.timestamp. I need a unix command to pick the latest file from the list of below files. Here in this case the lates file is abcxyz.20190304103200. I have used this unix command "ls abcxyz*|tail -1" but i heard that it is not the appropriate... (2 Replies)
Discussion started by: rakeshp
2 Replies
2. Shell Programming and Scripting
I believe there are couple of syntax issues in my script, couldn't find them :(
can someone help me with fixing it to make it work.
cd /abcde/
#get the latest filename excluding subdirs
filename=`ls -ltr | grep ^- | tail -1 | awk '{print $8}'`
#get system date and file timestamp and... (3 Replies)
Discussion started by: simpltyansh
3 Replies
3. Shell Programming and Scripting
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
4. Shell Programming and Scripting
Hi,
I have a file which generate Timestamp in this format :-
20121012162354
20121114191610
20121210232808
20121216220002
20130106220002
20130127220001
20130203220001
20121012162354
20121114191610
20121210232808
20121216220002
20130106220002
20130127220001
20130203220001 (2 Replies)
Discussion started by: netdbaind
2 Replies
5. UNIX for Dummies Questions & Answers
Hi All,
I am using the below command to find the latest file in a dir:
ls -tr $v_sftphomedir/$v_sourcefile |tail -1
or
ls -t1 $v_sftphomedir/$v_sourcefile |head -1
and the outpur returned is below:
/home/cobr_sftp/var/controllingload/Backup/Dbrwds_Div_1796050246.txt
I need only the... (5 Replies)
Discussion started by: abhi_123
5 Replies
6. UNIX for Dummies Questions & Answers
Hi Friends,
Newbie to shell scripting
Currently i have used the below to sort data based on filenames and datestamp
$ printf '%s\n' *.dat* | sort -t. -k3,4
filename_1.dat.20120430.Z
filename_2.dat.20120430.Z
filename_3.dat.20120430.Z
filename_1.dat.20120501.Z
filename_2.dat.20120501.Z... (12 Replies)
Discussion started by: robertbrown624
12 Replies
7. Shell Programming and Scripting
Hi Friends,
Newbie to shell scripting. Currently i have used the below to sort data based on filenames and datestamp
$ printf '%s\n' *.dat* | sort -t. -k3,4
filename_1.dat.20120430.Z
filename_2.dat.20120430.Z
filename_3.dat.20120430.Z
filename_1.dat.20120501.Z
filename_2.dat.20120501.Z... (1 Reply)
Discussion started by: robertbrown624
1 Replies
8. Shell Programming and Scripting
Hi Everyone,
I am writing a shell script and I am struck here:
I need to find the latest file in a directory depending upon the date.
For example:
The files in the directory are:
Filename_bo_20110619
Filename_bo_20110620
Filename_bo_20110621
Filename_bo_20110622
So here, I want... (2 Replies)
Discussion started by: filter
2 Replies
9. AIX
Hi guys,
I have a directory in UNIX having files with the below format, i need to pickup the latest file having recent timestamp embedded on it, then need to rename it to a standard file name.
Below is the file format:
filename_yyyymmdd.csv, i need to pick the latest and move it with the... (2 Replies)
Discussion started by: kaushik25
2 Replies
10. UNIX for Dummies Questions & Answers
Hi,
i want to search a file in the dir , if file exists for todays date print the message that file found or if file does not exist for todays date/ if file not found i want to display message saying that file not found. How to do this.
Thx for your help. (2 Replies)
Discussion started by: nick12
2 Replies