Skip to content
Advertisement

Tag: file-rename

awk renamed few files and left few to renamed

I am trying to replace part of filenames based on matching string of filename from another file. Filenames are in following format: where digits before first _ represent station code, which I want to replace with its station name from another file named radiosonde.csv. For example : I want change 36872_20190806_00.csv to ALMATY_20190806_00.csv change 38064_20190806_00.csvto KYZYLORDA_20190806_00.csv Data of radiosonde is

Recursively change file name in folder and subfolders without changing file path

I have files in a format like 639486572_016b0f3d-9ec3-4ad1-84ae-c98b68390322.wav. The files reside in a folder and sub-folder format that resembles a date. ./2019/05/31/639486572_016b0f3d-9ec3-4ad1-84ae-c98b68390322.wav. The goal is to remove everything before and including the _. Which im able to do with rename -v ‘s/$.+_//’ But when I try to couple this with find it seems to rename all the files found in

Modification of file names

I have a list of more than 1000 files on the following format. I am on Linux and want to change them as follows Using rename and awk I managed to get The remaining task is now to remove the last field that holds the year. Answer A solution that uses sed to generate the new names and the rename

Bash oneliner to rename filenames

I often would like to easily rename a bunch of files. I always have to struggle with find, grep, xargs and sed to simply to the job. I would like to understand how I can do a better job using PCRE Here my files: I would rename the dot files properly as I can do with this oneliner: However I

How to uppercase file name but exclude extension

Is it possible to use rename to uppercase a file but exclude its extension? ie: I want to rename the file foo_bar.ext to FOO_BAR.ext I tried with rename ‘y/a-z/A-Z/’ foo_bar.ext, but the whole file (including extension) gets uppercased FOO_BAR.EXT Answer You are asking rename to convert all the instances of [a-z] to [A-Z]. Instead, capture the desired string into a

Is rename() atomic?

I am not being able to check this via experiments and could not gather it from the man pages as well. Say I have two processes, one moving(rename) file1 from directory1 to directory2. Say the other process running concurrently copies the contents of directory1 and directory2 to another location. Is it possible that the copy happens in such a way

Advertisement