Linked Questions

7 votes
4 answers
22k views

There are some extensionless files in current directory (there are not dot in their names). I want to rename like so: filename -> filename.md I tried doing mv * *.md but that didn't help. I am ...
Santosh Kumar's user avatar
9 votes
3 answers
6k views

I am working on a simple shell script to change a file one.PDF to one.pdf. I have this file stored in a folder called Task1. My script is in the same directory as Task1. Called Shell1.sh When I run ...
Callat's user avatar
  • 243
2 votes
2 answers
21k views

Possible Duplicate: Renaming multiple files (changing extension) Suppose that in my current/working directory I have five files: file1.xvg file2.xvg file3.xvg file1.eps file2.eps Is there any way ...
Andrew's user avatar
  • 17.8k
1 vote
2 answers
38k views

How to rename all the files in the directory in such a way the files get added "_1" before ".txt" apac_02_aug_2017_file.txt emea_02_May_2017_file.txt ger__02_Jun_2017_file.txt To ...
Nirmal's user avatar
  • 63
0 votes
3 answers
3k views

I have a directory full of files. I want to rename all the files that match *.py to -backup.py. How do I do that. I know I can use for i in *.py, but from there I'm not sure how to keep the ...
dasElevator's user avatar
1 vote
5 answers
1k views

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|' ...
NasKar's user avatar
  • 13
1 vote
1 answer
1k views

Possible Duplicate: Renaming multiple files (changing extension) Suppose I have a bunch of files with the extension .x and I want to change them so that they have the extension .y. I know $ mv *.x ...
oadams's user avatar
  • 2,365
2 votes
1 answer
279 views

Ubuntu 16.04 I'm pretty new to linux and have a large number of files an the directory dir. These files have postfix _uploaded. Is there a way to rename all this files and set them postfix _handled ...
stella's user avatar
  • 121
0 votes
1 answer
705 views

I want to search and identify multiple files, within a directory, having a particular file extension (.txt) and changing the extension to (.fasta). This is considering not changing the file itself, ...
bretonics's user avatar
  • 215
1 vote
3 answers
162 views

I have a shell script ren.sh #!/bin/bash /usr/bin/mv /home/imp/imp/msgs/$1.PK1 /home/imp/imp/msgs/$1.BRD /usr/bin/mv /home/imp/imp/msgs/$1.PK2 /home/imp/imp/msgs/$1.MIX It works fine, but it only ...
ignatius's user avatar
  • 411
-1 votes
1 answer
188 views

Given that I intent to change files with extensive name of .md to .sh $ ls bath.md breakfast.md brush.md test.sh I wrote it as $ cat test.sh #! /usr/local/bin/bash for f in * do if $f ...
Wizard's user avatar
  • 2,573
846 votes
5 answers
393k views

I have seen -- used in the compgen command. For example: compgen -W "foo bar baz" -- b What is the meaning of the -- in there?
dogbane's user avatar
  • 30.7k
22 votes
4 answers
25k views

It's not completely clear to me, but what is the difference between mv and rename (from util-linux-ng 2.17.2 as /usr/bin/rename)? Are there advantages of one over the other beyond rename accepting ...
Urda's user avatar
  • 346
3 votes
3 answers
3k views

I have over 100 files named like x.assembled.forward.fastq.gz x(n).unassembled.reverse.fastq.gz the problem is that the pipelines that I am working with do not accept 'dots' in the file name and I ...
xyz0o's user avatar
  • 31
7 votes
1 answer
5k views

On CentOS, the rename command uses two simple strings, from and to. rename from to file... while on Debian/Ubuntu it uses a perl-style regular expression. rename [ -v ] [ -n ] [ -f ] perlexpr [ ...
Jacob Ritchie's user avatar

15 30 50 per page