Fetch the last two days directory names and rename them
Hi All,
I have below directory structure and from these directories, I would like to fetch the last two days list of directories and append a '0' (zero) to those directories.
With the below find command, I am able to fetch the last two days list of directories but unable to combine this with 'mv' command in a shell script (what ever the output from find cmd, those dir should be appended with a '0')
For e.g. from above list, I am able to fetch the last two days directory names 671, 672, 673 and I would like rename these dir as 0671, 0672, 0673.
awk 'NR==FNR{arr;next} $0 in arr' /tmp/Data_mismatch.sh /prd/HK/ACCTCARD_20160115.txt
edit by bakunin: seems that one CODE-tag got lost somewhere. i corrected that, but please check your posts more carefully. Thank you. (5 Replies)
Hi all,
I need to rename more file name in one command or script.
The files have this structure:
XxY - filename.doc
where X and Y are numbers and the x is the letter itself.
I need to rename these files with this structure:
string.S0XEY.filename.doc
the string is a suffix that... (8 Replies)
Hello All
My Questions About Which Unix & Linux Certifications Names In This Days ?
I Mean Red Hat Certifications , Solaris Certifications , IBM Certifications , HP Certifications and BSD Certifications
just i need the names of these Certifications and How can i enter to Certifications... (1 Reply)
I am trying to loop through folders and extract the name of the lowest level subfolder
I was running the script below, it returns
/bb/bin/prd/newyork
/bb/bin/prd/london
/bb/bin/prd/tokyo
I really want
newyork
london
tokyo
I couldn't find a standard variable for the lowest level... (1 Reply)
I hope some one can help me
I have multiple files in a directory with out extension like as below mentioned. But i want to change all the file names along .DDMMYYYYHHMISS format. And all files should have same DDMMYYYYHHMISS.
Scenario:
direcory name = /vol/best/srcfiles
files in a... (4 Replies)
hai,
I am new to Unix, I have a requirement to display owner name , directory or sub directory name, who's owner name is not equal to "oasitqtc".
(here "oasitqtc" is the owner of the directory or sub directory.)
i have a command (below) which will display all folders and sub folders, but i... (6 Replies)
Hi Guys,
I need a help. I have 1130 zip files. Each one of them has files including 1 html file with long file name (includes special charactors, Alphabetic and numbers).
I have copied all 1130 zip files to my linux system and extracted using below command.
Find . -name "*.zip" -exec... (7 Replies)
can anyone please suggest me some ideas for writing a korn shell script which will go back to 36 days from current day and print each day (incremented by 1) in the format yyyy-mm-dd until the current day.
Thanks
Mark (7 Replies)