Sponsored Content
Top Forums Shell Programming and Scripting want to delete timestamp from todays file Post 42928 by maverick on Friday 7th of November 2003 05:50:26 AM
Old 11-07-2003
google i think i was not clear it is not a single file that arrives

-rw-r--r-- 1 comprod commercial 2417281 Nov 6 09:15 fbdemo.01.20031106:09:15:49
-rw-r--r-- 1 comprod commercial 51873 Nov 6 09:11 fbappr.01.20031106:09:11:30
-rw-r--r-- 1 comprod commercial 0 Nov 6 09:10 fbdoe.01.20031106:09:10:40
-rw-r--r-- 1 comprod commercial 55674 Nov 6 09:10 fbcom.01.20031106:09:10:02
-rw-r--r-- 1 comprod commercial 0 Nov 6 09:09 fbcan.01.20031106:09:09:23
-rw-r--r-- 1 comprod commercial 52767 Nov 6 09:08 fbbur.01.20031106:09:08:46
-rw-r--r-- 1 comprod commercial 640878 Nov 6 09:08 fbres.01.20031106:09:08:30
-rw-r--r-- 1 comprod commercial 20431 Nov 6 09:08 fbab.01.20031106:09:08:14
-rw-r--r-- 1 comprod commercial 160386 Nov 6 09:08 fbcntl.01.20031106:09:08:11
-rw-r----- 1 comprod commercial 3910752 Oct 28 02:59 pgrep.01.20031028:02:59:56

this is my actual entry for today in pwd
i want all the files to be stripped of their time stamp and be moved to some other directory
here is desired out come

-rw-r----- 1 comprod commercial 2417281 Nov 7 05:31 fbdemo.01.20031106
-rw-r----- 1 comprod commercial 51873 Nov 7 05:31 fbappr.01.20031106
-rw-r----- 1 comprod commercial 0 Nov 7 05:30 fbdoe.01.20031106
-rw-r----- 1 comprod commercial 55674 Nov 7 05:29 fbcom.01.20031106
-rw-r----- 1 comprod commercial 0 Nov 7 05:28 fbcan.01.20031106
-rw-r----- 1 comprod commercial 52767 Nov 7 05:28 fbbur.01.20031106
-rw-r----- 1 comprod commercial 640878 Nov 7 05:27 fbres.01.20031106
-rw-r----- 1 comprod commercial 20431 Nov 7 05:27 fbab.01.20031106
-rw-r----- 1 comprod commercial 160386 Nov 7 05:23 fbcntl.01.20031106

:-) thanks in advance
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to list todays file

Hi Friends, How to list todays file from a directory listing of files for amny dates. I tried with the following options but not working : find . -name "esi01v*" -mtime 1 -ls find . -name "esi01v*" -ctime 1 -ls find . -name "esi01v*" -mtime 1 Please advise (19 Replies)
Discussion started by: unx100
19 Replies

2. Shell Programming and Scripting

How to grep a string in todays file

Hello guys - I am new to Unix. I am trying to understand how to grep a perticular string in todays file? I am trying this syntax but not getting what I am looking for: % grep `date '+%d/%b/%Y'` For instance there are 2 files generated today with same data. I am trying to find them and... (21 Replies)
Discussion started by: DallasT
21 Replies

3. Shell Programming and Scripting

Delete log file entries based on the Date/Timestamp within log file

If a log file is in the following format 28-Jul-10 ::: Log message 28-Jul-10 ::: Log message 29-Jul-10 ::: Log message 30-Jul-10 ::: Log message 31-Jul-10 ::: Log message 31-Jul-10 ::: Log message 1-Aug-10 ::: Log message 1-Aug-10 ::: Log message 2-Aug-10 ::: Log message 2-Aug-10 :::... (3 Replies)
Discussion started by: vikram3.r
3 Replies

4. Shell Programming and Scripting

Getting a relative timestamp from timestamp stored in a file

Hi, I've a file in the following format 1999-APR-8 17:31:06 1500 3 45 1999-APR-8 17:31:15 1500 3 45 1999-APR-8 17:31:25 1500 3 45 1999-APR-8 17:31:30 1500 3 45 1999-APR-8 17:31:55 1500 3 45 1999-APR-8 17:32:06 1500 3 ... (1 Reply)
Discussion started by: vaibhavkorde
1 Replies

5. UNIX for Dummies Questions & Answers

How to compare a file by its timestamp and store in a different location whenever timestamp changes?

Hi All, I am new to unix programming. I am trying for a requirement and the requirement goes like this..... I have a test folder. Which tracks log files. After certain time, the log file is getting overwritten by another file (randomly as the time interval is not periodic). I need to preserve... (2 Replies)
Discussion started by: mailsara
2 Replies

6. Shell Programming and Scripting

how to get todays file name

Hi ! there can you please tell me how to get full files having today date like if i have files like this(below) , i want to grep only sra + today's date + what ever thing is there after date . grep `sra*$date*.csv` >>> i tried this one but its not working . sra28-08-2011xyz.csv... (1 Reply)
Discussion started by: sravan008
1 Replies

7. UNIX for Dummies Questions & Answers

Script to keep todays files based on Timestamp

Hi i need to keep todays files based on timestamp and archive the remaining files ex: Managerial_Country_PRD_20150907.csv Managerial_Country_PRD_20150906.csv Managerial_Country_PRD_20150905.csv (2 Replies)
Discussion started by: ram1228
2 Replies

8. Shell Programming and Scripting

Script to keep todays files based on Timestamp

Hi i need to keep todays files based on timestamp and archive the remaining files ex: Managerial_Country_PRD_20150907.csv Managerial_Country_PRD_20150907.csv Managerial_Country_PRD_20150906.csv Managerial_Country_PRD_20150905.csv (6 Replies)
Discussion started by: ram1228
6 Replies

9. UNIX for Beginners Questions & Answers

How to list todays file in perticular folder?

How to list todays file in perticular folder Moved thread to appropriate forum (9 Replies)
Discussion started by: pspriyanka
9 Replies

10. Shell Programming and Scripting

How to delete filesappended with timestamp?

I have the following script #!/bin/bash # Script for running the snapshot of target directories now=$(date +'%Y-%m-%d') /bin/hdfs dfs -createSnapshot /apps/hive/warehouse/xyz.db $now How do i delete the same in a script see below a example ... (1 Reply)
Discussion started by: tspk99
1 Replies
DATE_SUNSET(3)								 1							    DATE_SUNSET(3)

date_sunset - Returns time of sunset for a given day and location

SYNOPSIS
mixed date_sunset (int $timestamp, [int $format = SUNFUNCS_RET_STRING], [float $latitude = ini_get("date.default_latitude")], [float $longitude = ini_get("date.default_longitude")], [float $zenith = ini_get("date.sunset_zenith")], [float $gmt_offset]) DESCRIPTION
date_sunset(3) returns the sunset time for a given day (specified as a $timestamp) and location. PARAMETERS
o $timestamp - The $timestamp of the day from which the sunset time is taken. o $format - $format constants +-----------------------+-------------------------------------------+ | constant | | | | | | | description | | | | | | example | | | | +-----------------------+-------------------------------------------+ | SUNFUNCS_RET_STRING | | | | | | | returns the result as string | | | | | | 16:46 | | | | | SUNFUNCS_RET_DOUBLE | | | | | | | returns the result as float | | | | | | 16.78243132 | | | | |SUNFUNCS_RET_TIMESTAMP | | | | | | | returns the result as integer (timestamp) | | | | | | 1095034606 | | | | +-----------------------+-------------------------------------------+ o $latitude - Defaults to North, pass in a negative value for South. See also: date.default_latitude o $longitude - Defaults to East, pass in a negative value for West. See also: date.default_longitude o $zenith - Default: date.sunset_zenith o $gmtoffset - Specified in hours. ERRORS
/EXCEPTIONS Every call to a date/time function will generate a E_NOTICE if the time zone is not valid, and/or a E_STRICT or E_WARNING message if using the system settings or the $TZ environment variable. See also date_default_timezone_set(3) CHANGELOG
+--------+---------------------------------------------------+ |Version | | | | | | | Description | | | | +--------+---------------------------------------------------+ | 5.1.0 | | | | | | | Now issues the E_STRICT and E_NOTICE time zone | | | errors. | | | | +--------+---------------------------------------------------+ RETURN VALUES
Returns the sunset time in a specified $format on success or FALSE on failure. EXAMPLES
Example #1 date_sunset(3) example <?php /* calculate the sunset time for Lisbon, Portugal Latitude: 38.4 North Longitude: 9 West Zenith ~= 90 offset: +1 GMT */ echo date("D M d Y"). ', sunset time : ' .date_sunset(time(), SUNFUNCS_RET_STRING, 38.4, -9, 90, 1); ?> The above example will output something similar to: Mon Dec 20 2004, sunset time : 18:13 SEE ALSO
date_sunrise(3). PHP Documentation Group DATE_SUNSET(3)
All times are GMT -4. The time now is 02:40 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy