#!/bin/bash#Remove the mer.*_ in file name is all of the files in a dirfunctionGetdir () { forElementinch' ls $` DoDir_or_file= $"/"$element if[-D$dir _or_file] then Getdir$dir _or_file Else #deal with all file in DirMv$dir _
Problem: The storage data in the cluster increases, so that the datanode space is almost full (previously DFS. Data. dir =/data/HDFS/dfs/data), and the hard disk monitoring of the machineProgramNon-stop alarm.
A storage hard disk is doubled for
Python Batch Rename file method is very simple we will use Listdir and rename directory traversal can be implemented to achieve the file command, the following collation of some methods.
Two interfaces to the OS are used:
1, list all the files in
We've renamed the file, and we've used the rename function. Oh, well, crap, I'm not saying much. Let's take a look at the code that reads the catalog file and then names the file.
function Checkdir ($dir _path){if (Is_dir ($dir _path)){if ($dir
Rename file function usage: img_1jpg, img_2jpg, and img_3jpg are saved in img_1, img_2, img_3, and largejpg respectively.
File rename function usage
Invalid.
$ S = explode ("n", trim ('DIR/B E: 11-2caps'); // Obtain all file names in
Download the test version:Http://www.symental.com/sfw/xrename.zip
Xrename, also known as the file folder super rename tool, can help you quickly rename a batch of files or folders according to the specified requirements, for example, replace
File rename function usage.$ S = explode ("n", trim ('DIR/B E: 11-2caps tutorial '); // Obtain all file names in this path// Print_r ($ s );Foreach ($ s as $ rs){$ Name = explode (".", $ rs );$ File_name = $ name [0]; // Obtain the name of the
two interfaces to the OS are used :
1, list all the files in the folder (also contains the directory)
Os.listdir (PATH)Return a list containing the names of the "entries in" directory given by Path. The list is in arbitrary order. It does not
Batch Rename a rule file name using the backgroundFor example:Send_message_20160802_01_log.logSend_message_20160802_02_log.logSend_message_20160802_03_log.logSend_message_20160802_04_log.logSend_message_20160802_05_log.logNeed to be renamed
Batch Rename and rename the unpleasing parentheses, but they are not pleasing to the eye. I was still prepared to see how to compile a batch rename batch. Later I thought that as long as I had to edit a batch of www.2cto.com without parentheses, I
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.