Name file with sys date


 
Thread Tools Search this Thread
Operating Systems Solaris Name file with sys date
# 1  
Old 01-21-2011
Name file with sys date

Hi,

I would like to rename log files with sys date as extension.
eg xyz.log --> xyz.log.01-21-2011

How do I do this? Any hints?
# 2  
Old 01-21-2011
Code:
for i in *.log
do
mv "$i" "$i".$(date '+%m-%d-%Y')
done

Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Programming

Interactive Python 3.5+ sys.stdout.write() AND sys.stderr.write() bug?

(Apologies for any typos.) OSX 10.12.3 AND Windows 10. This is for the serious Python experts on at least 3.5.x and above... In script format sys.stdout.write() AND sys.stderr.write() seems to work correctly. Have I found a serious bug in the interactive sys.stdout.write() AND... (2 Replies)
Discussion started by: wisecracker
2 Replies

2. UNIX for Dummies Questions & Answers

How to pick the latest file with date as one among the file name.( not exactly present date.)?

i have files like 1)20131112_abc_01.csv and 2)20131113_abc_01.csv and 3)20131113_abc_02.csv when i try to fetch the file in the next day. it shud pick the third file.. plz help me.. and i use `date +"%Y%m%d"` command to fetch..it fetches the current date... (2 Replies)
Discussion started by: applepie
2 Replies

3. Shell Programming and Scripting

Move all files except sys date (today) files in Solaris 10

I want to move all files from one directory to another directory excluding today (sysdate files) on daily basis. file name is in pattern file_2013031801, file_2013031802 etc (2 Replies)
Discussion started by: khattak
2 Replies

4. Programming

#include file <sys/libcsys.h>: not found

Hi, Currently am working on pooling of messages from one host to another.. I included "#include <sys/libcsys.h>" library in my C code.. But I found in the output as, #include file <sys/libcsys.h>: not found I know that "libcsys.h" library is used for kernel extensions.. I can't figure... (1 Reply)
Discussion started by: Priya Amaresh
1 Replies

5. UNIX for Advanced & Expert Users

sys/sysinfo.h: No such file or directory --> MACOSX 10.6.4

I need a real help to compile a small program which compiles fine with g++ in Linux machines. However I need to compile-it in my machine with g++. I have this problem and I dont know how to solve it: sys/sysinfo.h: No such file or directory could someone please help me? Thanks (2 Replies)
Discussion started by: c_lady
2 Replies

6. OS X (Apple)

sys/sysinfo.h: No such file or directory --> MACOSX 10.6.4

duplicate thread I need a real help to compile a small program which compiles fine with g++ in Linux machines. However I need to compile-it in my machine with g++. I have this problem and I dont know how to solve it: sys/sysinfo.h: No such file or directory could someone please help me? Thanks (0 Replies)
Discussion started by: c_lady
0 Replies

7. Programming

could not open source file "sys/elf_386.h"

Hello All, i am porting my application from SunSolaris to Linux (RHEL4). When i compile my c/c++ code i am getting the following errors. 1. catastrophic error: could not open source file "sys/elf_386.h" #include <sys/elf_386.h> 2. catastrophic error: could not open source file... (2 Replies)
Discussion started by: tsaravanan
2 Replies

8. HP-UX

How to remove swap file sys without reboot?

hi every body i am trying to remove logical volume i configured as a swap device but when i removed by smh i ran " swapinfo" it keeps the device and didn't feel that device removed also i "lvremove /dev/vg01/swapvol" also swapinfo not feel i want it feel that i reduced the swap without reboot... (4 Replies)
Discussion started by: maxim42
4 Replies

9. Shell Programming and Scripting

How to Transfer whole file sys from one server to another

Hi, well i am not that good in shell prog. and just shifted to do this work. i was assigned to look all the dir/ sub-dir in a folder like /usr who are the owners, users and groups for the respective dir/sub-dir. its really a hectic process to see each n every file. i used the command...... (3 Replies)
Discussion started by: krishnadvn
3 Replies

10. UNIX for Advanced & Expert Users

Linux sys date changing

Could anyone help me on related commands in linux for viewing the current date of system & any command for changing the date of system. Tanx --nikk (1 Reply)
Discussion started by: nikk
1 Replies
Login or Register to Ask a Question