All Questions

Tagged with
Filter by
Sorted by
Tagged with
3
votes
2answers
106 views

Rename photos to match video titles

I have a mostly automated media server and currently have everything going into one folder and being sorted out by file extension into the correct locations. At the moment the photos are coming in ...
12
votes
4answers
1k views

How to rename multiple files in a directory at the same time

I have directory say /var/tmp/abc which has 4 files: 12345-ram-3e3r5-io9490-89adu9.csv 45434-dam-qwe35-to9490-43adu9.csv 11234-cam-yy3r5-ro9490-85adu9.csv 14423-sam-hh3r5-uo9490-869du9.csv I want to ...
1
vote
1answer
32 views

how to rename a number of files using wildcard as prefix

Assume I have many files names something like: foo_192.168.1.1.sh bar_192.168.1.1.sh baz_192.168.1.1.sh qux_192.168.1.1.sh and I want to rename them all to foo_192.168.1.100.sh bar_192.168.1.100....
0
votes
1answer
60 views

How to rename a file with different name? [closed]

I have a file named servername_test_LINUX_test_test_2019-04-19.xls I have to create multiple copies of this file, with the condition that server name should be changed in each file created e.g. ...
0
votes
1answer
30 views

How to fix this command mass renaming files to match a text file [closed]

for file in *; do read line; mv -v "${file}" "${line}"; done < /var/www/html/uploads/songs.txt It works as in changing all 700 files. But it doesn't seem to do it in the correct order. I feel ...
1
vote
2answers
47 views

How do I mass remove certain characters from directory/file names

What's a command I could use to do this on fedora 29 I need to remove [,], and -. If possible just remove the characters. Otherwise I'm good with replacing them as '_' I have 2,400+ files and ...
0
votes
3answers
64 views

Move or rename subfolders

I have a folder structure like this: /ms/files/a/ /fb/files/a/ /db/files/a/ It should be like this: /ms/files/b/ /fb/files/b/ /db/files/b/ I can find the folders I need to move or rename using ...
2
votes
5answers
653 views

I want to rename all files in a directory from *.ts to *.mkv [duplicate]

Rename all the files in .ts files in a directory My echo command works but not if I try to make it a new variable. #!/bin/sh for file in "${1}"/*.ts; do echo ${file} | sed -e 's|.ts|.mkv|' ...
0
votes
1answer
36 views

Change file name while copying based on source path

I have a large number of files in directories of the format */*/*/*/*.txt and I would like to copy them into a different place while replacing the forward-slashes in the path with underscores. For ...
0
votes
2answers
33 views

Renaming part of name of all files in a directory tree if match

I have a directory tree like this . |-- players | |-- red_alice.plr | |-- red_bob.plr |-- resources | |-- red_cash.rsc | |-- red_food.rsc I want to go through all directories and rename any ...
1
vote
2answers
64 views

Make script to create subdirectories based on file name and move matching files into it [duplicate]

A folder has a huge number of files; each pair of files has the same name but different extensions (.obj and .mtl). I want to make a folder for each pair of files with the same name, then move each ...
0
votes
2answers
75 views

Batch rename media files

I have an Enigma2 FreeSat recorder that I've now hooked up to my Plex Media Server. Plex can see and play the files from the Enigma2 just fine, but the file naming makes this unattractive. How can I ...
0
votes
3answers
44 views

move a list of files to a list of locations

I'd like to move multiple files at the same time to specific new locations. Say I have the following wrong name | c.txt | a.txt | b.txt | Correct name| a.txt | b.txt | c.txt | I'd then like to ...
0
votes
4answers
101 views

Recursively rename all the files without changing their extensions?

How to recursively rename all the files in several layers of subdirectories without changing their extensions? Below's a toned down version (to save room) of what I've got. For argument's sake, I ...
2
votes
2answers
96 views

trying to Rename multiple file names within all directories of a project

ive recently been trying to change the names around in my project and have been having some trouble getting the task done properly. my problem is when I try to use find . -type f -print0 | xargs -0 ...
-1
votes
3answers
47 views

Renaming files by the day they created

I have files I would like to rename it using the date they created. How can I do this automatically? Looking at the properties for every file then renaming it is a real pain. For example In a folder ...
3
votes
2answers
324 views

Renaming files to remove parenthesized strings

I have a collection of files with names like these: Ace of Aces (Europe).mp4 Action Fighter (USA, Europe) (v1.2).mp4 Addams Family, The (Europe).mp4 Aerial Assault (USA).mp4 After Burner (World).mp4 ...
0
votes
1answer
59 views

Rename Files to Consecutive Integers [duplicate]

I have bunch of files in one directory, like these: 0002.b3120c4bcbf3101e661161ee7efcb8bf 0003.acfc5ad94bbd27118a0d8685d18c89dd 0004.e8d5727378ddde5c3be181df593f1712 0005....
6
votes
4answers
936 views

Change some file names (prefix to postfix)

I have a directory containing thousands of files with names t_00xx_000xxx.png and 00xx_000xxx.png. I want to change the names of the files which starts with t_, like t_00xx_000xxx.png to 00xx_000xxx_t....
8
votes
4answers
398 views

Rename multiple files with 2 conditions/replacements in one line?

I'm trying to rename a few images: IMG_1.JPG IMG_2.JPG IMG_3.JPG I want to replace IMG with img and .JPG with .jpg - I know how to do the second part: $ rename 's/\.JPG$/\.jpg/' *.JPG My problem ...
3
votes
4answers
512 views

How to rename tar.gz files based on their match in the text file

I have many tar.gz files in a folder on my Linux machine and also text file with tar.gz file names and matching sample names. Current_directory |_______TDF.tar.gz |_______DFG.tar.gz ...
0
votes
2answers
87 views

Change extension of all file names containing specific string

When I get a file whose name contains the string "x264", I wish to change its extension to ".mp4" (for reasons too detailed to explain here). Examples: Seinfeld_S02E05_x264.mkv -> ...
0
votes
1answer
45 views

To Make File name according to their IDs

I want to replace each file name with their specific IDs. My files are 30,000 and so their respective IDs. Can it be possible to fetch ID which is inside in each file on line number 2 and become a ...
-3
votes
3answers
871 views

Rename Files with increment Numbers

I have files in /root/test/access.log.1 to 999 and /root/test/error.log.1 to 999. I would like to rename access.log.1 to access.log.2 and move to /var/log/archives/, and same way error.log.1 to ...
0
votes
2answers
36 views

Using Perl's rename with groups [duplicate]

I've a set of files named in the following manner: _9978967868768763ghjgj7598983678hjva_week1-6.pdf _78637832bdsjh275637bkkaww786b_week12-32.pdf 8786767867868978713bkwkhjhkjqw_week1-622.pdf ...
0
votes
4answers
506 views

How to remove `_` from all file-names in a directory

In bash, I have an unzipped directory where I have many file names that start with _. I'm pretty sure I can use rename or mv to simply remove the _ prefix of each file that has it. I try: for ...
0
votes
5answers
89 views

Rename a HTML file based on the content of a tag

I have a lot of html files that I want to rename according to the content of the tag h1. Any suggestion on how to do it on bash? Example of a file: <!DOCTYPE html><html lang="pt-BR">&...
0
votes
1answer
77 views

Renaming multiple files by matching variable words in a directory [closed]

I've multiple files in a directory and I want to rename it and only remove matching words from the file name. Example files: 8 - build a php mvc application - finished (part 8_9).mp4 9 - build a php ...
0
votes
2answers
262 views

How to use the bash shell parameter expansion for filename manipulation

I would like to rename a list of MP3 in the same directory like : 001 - toto1.mp3 002 - toto3.mp3 003 - toto5.mp3 004 - toto7.mp3 005 - toto9.mp3 toto10.mp3 toto35.mp3 toto59.mp3 toto75.mp3 I tried ...
3
votes
3answers
2k views

Count number of columns in CSV files and rename if less than 11 columns

I need to count the number of columns in CSV files. If less than 11, rename the file appending the .bad suffix. I tried this but it's short of what I need: head -1 myfile.csv | sed 's/[^,]//g' | wc -...
5
votes
2answers
259 views

Find files with similar names, delete the oldest, rename the most recent

I have this situation where there's a lot of files with similar names (but they all follow a pattern) in different subfolders file1 file1 (Copy) /folder1/file2.txt /folder1/file2 (Copy).txt /folder1/...
2
votes
1answer
59 views

Reorder path elements of a directory tree

I have a directory tree where the path elements correspond to specific properties of the file at a particular path. For example, something like this: $ tree . ─ a ─ 1 ─ y ─ 334f │   │   └── z ─ 6410 ...
3
votes
5answers
4k views

rename files to change spaces to underscore

I have a load of files(mp3, wav, txt, doc) that have been created in MS Windows and they have spaces in their names. eg The file of whoever.doc I would like to rename them all at once, replacing the ...
2
votes
1answer
205 views

How to copy and add prefix to file names in one step from another directory?

I want to copy and rename multiple files from one directory to another. Particularly, I want something like this: /tmp/tmp.XXX/aaa.original.txt /tmp/tmp.XXX/bb5.original.txt /tmp/tmp.XXX/x2x.original....
1
vote
5answers
581 views

Rename file names in multiple directories

I have several directories with files out of sequence because the titles are displayed before the file number. I want to match and replace the end of all the files, minus the extension, so the number ...
1
vote
4answers
99 views

Use wildcard output as a variable in an arithmetic computation

I have files with names and directory paths as follows: t10n2/data/file.dat0, t10n2/data/file.dat1, t10n2/data/file.dat2, ... I wish to change the names of the files using an arithmetic operation ...
2
votes
6answers
3k views

UNIX: How to change all hidden files to visible in a multiple sub directories

I have hundreds of sub directories in a directory that all have hidden files in them that I need to remove the period at the beginning of them to make them visible. I found a command to go into each ...
0
votes
4answers
512 views

renaming file with date to a different date in shell script

I have files in my home dir as member_net.2017-04-20.control member_elig_net.2017-04-20.control mdcr_contractr_net.2017-04-20.control I want to rename the files to a different date like in the ...
0
votes
2answers
51 views

Change one part of the name of more than 1000 files

I have a set of about more than 1000 files that their names are such as IR.ANJ.G1.E.20060102.185428.mseed with G1 in common. I am going to change G1 in all files to SH. For example, IR.ANJ.G1.E....
2
votes
1answer
2k views

(Bash) Renaming Files Extension

I am having problems trying to create a script to rename all of the files in my directory to .txt on Linux. This is what I have so far. #!/bin/bash location_number=$(find /hw1/textarchive | wc -l) ...
11
votes
3answers
2k views

Who renamed a directory?

I couldn't find the answer to this anywhere. How can I know who renamed a directory? ls -al shows only the name of user who created that dirctory.
0
votes
2answers
219 views

Removing extension of multiple file without using loop in linux [closed]

Sample files: RBFATL001USCGA002.--K1234-- RCAVTL001USCGA043.--K2135-- Output: RBFATL001USCGA002 RCAVTL001USCGA043
0
votes
5answers
809 views

Remove a specific suffix from all the files in a directory

I have a genotype file which I have split it into more than 2000 5K SNPs files by using split -d geno_file the output that I get is something like this: table_subset_0001 table_subset_0002 ...
1
vote
2answers
114 views

MV Sub-Directories up one level but not to root

I have several folders in the following structure that I would like to sort. For example: /root/sub1/aaaa/bbbb/cccc/dddd /root/sub2/aaaa/bbbb/cccc/dddd /root/sub3/aaaa/bbbb/cccc/dddd /root/sub4/aaaa/...
0
votes
1answer
493 views

How to rename multiple filenames using find/rename

I have on a Samba server lots of files in directories/subdirectories containing special chars. The problem is that, the files (containing a special chars) are not visible when I try to view files ...
1
vote
2answers
494 views

Renaming files to the prefix and the middle portion of the file name

I have a script which at one point does the following: for src in $(find -H "$ROOT_DIR" -maxdepth 5 -name '*.test' -not -path '*.git*') do fixed_filename=$(echo "$(basename "${src%.*}")" | sed '...
1
vote
0answers
56 views

Convert multiple group of PNG files to multilayered ICO files

Let say I've many files named e.g.: FirstIcon_16.png FirstIcon_32.png FirstIcon_colored_16.png FirstIcon_colored_32.png SecondIcon_16.png SecondIcon_32.png SecondIcon_colored_16.png ...
3
votes
2answers
60 views

Renaming files according to a number of chars from the directory name

I have a number of directories like these : ./lab-results.n3668.2017-01-16 ./lab-results.n471.2017-02-24 ./tests.n287.2017-01-28 ./tests.n4501.2017-03-04 They contain unfortunately only one file but ...
9
votes
4answers
1k views

How to move and recreate a folder at the same time?

I have a folder called statistics in an Ubuntu server in which data files are regularly stored. How can I rename statistics folder to backup-xx while re-creating statistics folder to be available for ...
2
votes
2answers
35 views

Change the end of multiple similar filenames [duplicate]

I have many files that look similar to this: 56.mp3?referredby=rss What I want to do is remove the ?referredby=rss so they'll be like this: 56.mp3 How would I do this?