10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
Have a file in this format This is line one ; line_one
This is line two ; line_two
This is line three ; line_three
This is line four ; line four. I'm trying to make each line a new file called line_one
line_two
line_three
line_four. Tried using split -1 but then I'm back needing to rename... (3 Replies)
Discussion started by: jimmyf
3 Replies
2. Shell Programming and Scripting
Hi all,
could any provide me a solution for the below requirement.
I have two files namely abc.log.1 and abc.log.2
The above files have time stamp as Dec 08 and Dec 09
I need to rename the files as abc.log.1_20141208 and abc.log.2_20141209 and move to another bkp directory.
Thanks in... (2 Replies)
Discussion started by: bhaskar t
2 Replies
3. Shell Programming and Scripting
I'm trying to create a bash function that will allow me to rename a file name emails.txt to last monday's date
renem ()
{
d=`date -d last-monday`
mv ~/emails.txt ~/myemails/$d
}
but i en up wit this error any suggestion
mv: target `2014' is not a directory (3 Replies)
Discussion started by: robshal
3 Replies
4. UNIX for Advanced & Expert Users
hello,
can someone please suggest a script to rename a file that was generated today and filename that being generated daily starts with date, its a xml file.
here is example.
# find . -type f -mtime -1
./20130529_4995733057260357019.xml
#
this finename should be renamed to this format.... (6 Replies)
Discussion started by: bobby320
6 Replies
5. Shell Programming and Scripting
All,
I wanted to copy the files
From:
Daily_XYZ_TEST_1.csv
Daily_XYZ_TEST_2.csv
Daily_XYZ_TEST_3.csv
Daily_XYZ_TEST_4.csv
To:
Daily_ABC_TEST_1.csv
Daily_ABC_TEST_2.csv
Daily_ABC_TEST_3.csv
Daily_ABC_TEST_4.csv
I have tried the rename command but it is not working (5 Replies)
Discussion started by: alfredo123
5 Replies
6. Shell Programming and Scripting
Hi!
Please see our current script:
#!/usr/bin/ksh
if (egrep "This string is found in the log" /a01/bpm.log)
then
mailx -s "Error from log" me@email.com, him@email.com </a01/bpm.log
fi
To the above existing script, we need to add the following change:
1) After finding the string,... (7 Replies)
Discussion started by: atechcorp
7 Replies
7. Shell Programming and Scripting
I am trying to rename files based on the created/born date of the file. I Have a total of 4000 files that i am trying to do this with and would like it to be log_yyyymmddhh.gz right now the files are maillog.???.gz.
Can anyone point me in the right direction of how to get this done via scipt?
... (4 Replies)
Discussion started by: Paulb
4 Replies
8. Shell Programming and Scripting
Hi all,
in BIN/SH I need to group and count files by date.
Ie:
ls -la
-rw-r--r-- 1 aaa dba 122 Jul 13 14:28 as1.tmp
-rw-r--r-- 1 aaa dba 122 Jul 13 15:27 as2.tmp
-rw-r--r-- 1 aaa dba 122 Jul 21 17:04 as3.tmp
-rw-r--r-- 1 aaa dba 122 Jul 23 15:45 as4.tmp
-rw-r--r-- 1 aaa... (8 Replies)
Discussion started by: ric79
8 Replies
9. Shell Programming and Scripting
File.jpg
I want to copy and rename this as 2008-12-02.jpg
I tried this copy File.jpg date '%y-%m-%d-%H:%M:%S'.jpg
This doesnt work.... what do i do? (1 Reply)
Discussion started by: hdogg
1 Replies
10. Shell Programming and Scripting
Hi,
I want to get the line count of the file from the 2nd line of the file ? The first line is header so want to skip that.
Thanks. (8 Replies)
Discussion started by: smc3
8 Replies