|
|||||||
| Forums | Search Forums | Register | Forum Rules | Man Pages | Albums | FAQ | Members | Calendar | Search | Today's Posts | Mark Forums Read |
| Solaris The Solaris Operating System, usually known simply as Solaris, is a Unix-based operating system introduced by Sun Microsystems. The Solaris OS is now owned by Oracle. |
|
|
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
Hi All,
I want to move the files in to different folders based on the files month in the file timestamp. For example All the september files in the directory should moves into the folder "sep_bkp_files" , August files in to aug_bkp_files folder... Please help me to achive the above issue. I am using solaris OS. Thanks, Velava |
| Sponsored Links | ||
|
|
#2
|
||||
|
||||
|
post the output of ls -lrt
or is the filename having the timestamp ? |
| Sponsored Links | ||
|
|
#3
|
|||
|
|||
|
Quote:
Yes, the fiename having the timestamp. |
|
#4
|
||||
|
||||
|
if u provide the example filename, then i can help u
|
| Sponsored Links | |
|
|
#5
|
|||
|
|||
|
filenames will be, -rw-rw-r-- 1 b2binta1 b2badmin 16515066 Sep 18 00:57 test1.txt -rw-rw-r-- 1 b2binta1 b2badmin 22824 Sep 18 01:30 test2.txt -rw-rw-r-- 1 b2binta1 b2badmin 41844 Sep 18 01:30 test3.txt -rw-rw-r-- 1 b2binta1 b2badmin 22824 Sep 18 01:36 sample1.txt -rw-rw-r-- 1 b2binta1 b2badmin 213024 Sep 18 01:36 sample2.txt -rw-rw-r-- 1 b2binta1 b2badmin 60864 Sep 18 04:34 hello.csv Thanks |
| Sponsored Links | |
|
|
#6
|
|||
|
|||
|
Code:
dest=/path/to/september/
touch -t 201209010000 /tmp/d1
touch -t 201209305959 /tmp/d2
find /path/to/files -type f |
while read fname
do
mv $fname $dest
donetry that. |
| Sponsored Links | |
|
|
#7
|
|||
|
|||
|
Quote:
it is not working as expected and it is moving all other month files as well. Thanks |
| Sponsored Links | ||
|
![]() |
| Tags |
| script from ksh, solaris 10 |
| Thread Tools | Search this Thread |
| Display Modes | |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Move files to Folders | diva_thilak | Shell Programming and Scripting | 5 | 07-23-2009 01:53 AM |
| Move folders containing certain files | xavix | UNIX for Dummies Questions & Answers | 3 | 02-21-2009 05:43 AM |
| How do you move lines of numbers based on the month | terryporter51 | Shell Programming and Scripting | 11 | 06-15-2008 12:54 AM |
| how to move files into different folders based on filename | italia5 | UNIX for Dummies Questions & Answers | 7 | 08-23-2006 10:04 AM |
|
|