Want to mv files form one folder to another by date


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Want to mv files form one folder to another by date
# 8  
Old 04-09-2008
But getting the list of files into a variable with an ls is not really the right way to do it.

Code:
for i in dd*.txt

Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

UNIX script to replace old date with current date dynamically in multiple files present in a folder

I am trying to work on a script where it is a *(star) delimited file has a multiple lines starts with RTG and 3rd column=TD8 I want to substring the date part and I want to replace with currentdate minus 15 days. Here is an example. iam using AIX server $ cat temp.txt RTG*888*TD8*20180201~... (1 Reply)
Discussion started by: Shankar455
1 Replies

2. Shell Programming and Scripting

Delete oldest folder based on folder named as date

Hi, I have a script doing backup to synology server, the script create new folder each day with the date as being folder name i.e. 2018-07-30. Just before creating the new folder I want the script to find the oldest folder from the list and delete it including its content. for example... (3 Replies)
Discussion started by: humble_learner
3 Replies

3. UNIX for Dummies Questions & Answers

Select all files in a folder based on creation date (ls command)

Hi All, <Re-posting in Correct group> I'm trying to select all the files in a folder that starts with a particular name format and are created in a gven date range using 'ls' command...but i'm not successful.... Example : I'm trying to see all the text files in a folder who names start... (6 Replies)
Discussion started by: Satya C1
6 Replies

4. HP-UX

How can I find the size of files added to a folder after a particular date

Hi, I want to find the size of the files added to a folder after a certain date(say 1st of october), I know we can list the files which were created after a certain date , but is there anyway to find the total size of those files ? (3 Replies)
Discussion started by: alookachaloo
3 Replies

5. Shell Programming and Scripting

ksh shell script to add date (YYYYMMDDHHMISS) to all .txt files in a folder

Everyday 15 files are written to a folder \app\where\thefiles\are\destined\CURRFOLDER Task1: I need to add date in YYYYMMDDHHMISS format to each of them. Example: File: ACCOUNT.txt Should be updated as: ACCOUNT_20101005175059.txt Task 2: After I update the files, they need to be ... (2 Replies)
Discussion started by: Duminix
2 Replies

6. Linux

rename files in a folder with date&time stamp

Hi, I want to rename all the files (more than 100 files) in a fodler to another folder with date&time stamp. foe eg, file1.dat file2.dat file3.dat .. to be renamed as file1100629_16_30_15.txt (yy-mon-dd_hh_mi_ss) file1100629_16_30_16.txt .. so on (2 Replies)
Discussion started by: feroz
2 Replies

7. Shell Programming and Scripting

Transfer files with web based form by date

Not sure how I should approach this one. I have server X and Server Y. X is a collector. All files are seperated by hour. Y is used strictly for analysis. I do not always need all files from X. Sometimes other people use Y for analysis and do not always know how to transfer the files from... (3 Replies)
Discussion started by: mrlayance
3 Replies

8. Shell Programming and Scripting

command to list files with path & date in a folder

Hi, I need command to display files with full path and date of files where are generated at every 5hrs in a folder. eg: /u01/app/test/orjthsd_1_1 Sun May 10 19:03:26 2009 /u01/app/test/weoiusd_1_1 Sun May 10 21:00:26 2009 thanks saha (3 Replies)
Discussion started by: saha
3 Replies

9. UNIX for Dummies Questions & Answers

How can i delete files in folder by date?

Hi, I have some files on a folder and i want to delete all the files that were created on July. Thanks, Kobi. (9 Replies)
Discussion started by: kobibn
9 Replies
Login or Register to Ask a Question
SORTM(1)							     [nmh-1.5]								  SORTM(1)

NAME
sortm - sort messages SYNOPSIS
sortm [+folder] [msgs] [-datefield field] [-textfield field] [-notextfield] [-limit days] [-nolimit] [-verbose | -noverbose] [-version] [-help] DESCRIPTION
Sortm sorts the specified messages in the named folder according to the chronological order of the "Date:" field of each message. The -verbose switch directs sortm to tell the user the general actions that it is taking to place the folder in sorted order. The -datefield field switch tells sortm the name of the field to use when making the date comparison. If the user has a special field in each message, such as "BB-Posted:" or "Delivery-Date:", then the -datefield switch can be used to direct sortm which field to examine. The -textfield field switch causes sortm to sort messages by the specified text field. If this field is "subject", any leading "re:" is stripped off. In any case, all characters except letters and numbers are stripped and the resulting strings are sorted datefield-major, textfield-minor, using a case insensitive comparison. With -textfield field, if -limit days is specified, messages with similar textfields that are dated within `days' of each other appear together. Specifying -nolimit makes the limit infinity. With -limit 0, the sort is instead made textfield-major, date-minor. For example, to order a folder by date-major, subject-minor, use: sortm -textfield subject +folder FILES
$HOME/.mh_profile The user profile PROFILE COMPONENTS
Path: To determine the user's nmh directory Current-Folder: To find the default current folder SEE ALSO
folder(1) DEFAULTS
`+folder' defaults to the current folder `msgs"'defaultstoall" `-datefield' defaults to date `-notextfield' `-noverbose' `-nolimit' CONTEXT
If a folder is given, it will become the current folder. If the current message is moved, sortm will preserve its status as current. HISTORY
Timezones used to be ignored when comparing dates: they aren't any more. Messages which were in the folder, but not specified by `msgs', used to be moved to the end of the folder; now such messages are left untouched. Sortm sometimes did not preserve the message numbering in a folder (e.g., messages 1, 3, and 5, might have been renumbered to 1, 2, 3 after sorting). This was a bug, and has been fixed. To compress the message numbering in a folder, use "folder -pack" as always. BUGS
If sortm encounters a message without a date-field, or if the message has a date-field that sortm cannot parse, then sortm attempts to keep the message in the same relative position. This does not always work. For instance, if the first message encountered lacks a date which can be parsed, then it will usually be placed at the end of the messages being sorted. When sortm complains about a message which it can't temporally order, it complains about the message number prior to sorting. It should indicate what the message number will be after sorting. MH.6.8 11 June 2012 SORTM(1)