Need help with UNIX command to get the latest file from list of files with timestamp
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 one which may not be successful all the time.I was told to use a command by sorting the files based on the timestamp. Please do the needful.
Thanks
Rakesh
Last edited by RavinderSingh13; 03-12-2019 at 03:45 AM..
Hi,
I need to get the latest file from a list of files in a particular directory.
Please could anyone help me out to get the file.
Thank you,
- Jay. (1 Reply)
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... (1 Reply)
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)
I was wondering if there was a command to move files from one directory to another subdirectory based on the timestamp, i.e. moving from directory A files that have a timestamp of before the year 2005 into directory B. Directory B is a subdirectory located in directory A. I was advised to... (4 Replies)
I have a few log files which get generated on a daily basis..So, I need to pick only the ones which get generated for that particular day.
-rw-r--r-- 1 staff 510732676 Apr 7 22:01 test.log040711
-rwxrwxrwx 1 staff 2147482545 Apr 7 21:30 test.log.2
-rwxrwxrwx 1 staff 2147482581 Apr 7 19:26... (43 Replies)
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)
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)
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)
we want to fetch the latest file in a given directory and also the file name should match the below pattern
Example file name ->hrdata-2015-10-13-16-45-26.xml(2015-10-13-16-45-26- it is not current timestamp, we just need to check for the pattern)
We expect the file will have the... (3 Replies)
Discussion started by: vishwanath001
3 Replies
LEARN ABOUT CENTOS
rapid
RAPID(6) Games RAPID(6)NAME
rapid - content download tool for spring
SYNOPSIS
rapid [options] <action> [<argument>]
rapid-spring [options] <action> [<argument>]
DESCRIPTION
Rapid manages downloads of content for the spring RTS engine.
OPTIONS
action in the command line is one of:
upgrade: Install the latest package for all pinned tags.
clean-upgrade: Equivalent to 'upgrade' followed by 'uninstall-unpinned'.
pin: Pins a tag and installs the latest package for that tag.
unpin: Unpins a tag. Does not uninstall any packages.
install: Install a package. Does not pin any tags.
uninstall: Uninstall a package. Unpin its tag if any.
list-tags: List all tags that contain <argument>.
list-pinned-tags: Idem, but only pinned tags.
list-packages: List all packages whose name contains <argument>.
list-installed-packages: Idem, but only installed packages.
uninstall-unpinned: Keep only the pinned tags and all dependencies.
collect-pool: Remove pool files not needed by any installed package.
make-sdd: Extract pool files into a .sdd archive.
these are the possible options:
-h, --help show this help message and exit
--datadir=DATADIR Override the default data directory. (~/.spring on Linux or the one reported by unitsync on Windows)
--unitsync Use unitsync to locate the data directory Spring uses.
--no-unitsync Do not use unitsync.
EXAMPLES
rapid pin xta:latest # installs latest XTA
rapid pin s44:latest # installs latest Spring: 1944
rapid upgrade # upgrade all pinned tags
SEE ALSO rapid-gui(6), spring(6)AUTHOR
Tobi Vollebregt <tobivollebregt@gmail.com>
This manual page was written by Jan Dittberner <jandd@debian.org>, for the Debian project (but may be used by others).
rapid August 2010 RAPID(6)