You will have to work out the process for doing one, then call do that in a loop for all. I have a few to questions pose in response first:-
Is this homework/assignment? There are specific forums for these.
What have you tried so far, other than a your cp?
What output/errors do you get?
What OS and version are you using?
What are your preferred tools? (C, shell, perl, awk, etc.)
What logical process have you considered? (to help steer us to follow what you are trying to achieve)
Most importantly, What have you tried so far?
The suggestion from chacko193 may or may not work depending on your OS & shell, hence the questions above.
There are probably many ways to achieve most tasks, so giving us an idea of your style and thoughts will help us guide you to an answer most suitable to you so you can adjust it to suit your needs in future.
By way of explanation, cp page*.jpg*.jpg will be expanded to actually be:-
The process will copy all files that match either page*.jpg or *.jpg over the last file alphabetically that matches *.jpg so if you have page999.jpg, that will have been overwritten, unless your OS (unspecified) refuses to multiple copy unless the last item in the list is a directory.
We're all here to learn and getting the relevant information will help us all.
I have several hundred files in one directory which I need to move to another directory with the new extension, for example:
/bb/data/rptmgr* are in the source directory need to be moved to
/bb/data55/rptmgr*.new
Is there an efficient way to do it? Thanks -A (4 Replies)
How do I remove non-printable characters from all txt files and output the results to one file?
I've tried the following:
tr -cd '\n' < *.txt > out.txt
and it gives ambiguous redirect error.
How can I get it to operate on all txt files in the current directory and append the output to... (1 Reply)
Hi all, I have some files like:
pickup.0000043200.t001.t001.data
pickup.0000043200.t001.t002.data
pickup.0000043200.t002.t001.data
pickup.0000043200.t002.t002.data
pickup.0000043200.t003.t001.data
pickup.0000043200.t003.t002.data
I need to rename these files to
... (3 Replies)
Hi everyone,
I'm very green in Linux.
Please help me to solve my problem.
I have thousands of files and I want to change their names.
They have naming convection: prefix_date_date+1_suffix.nc
prefix: ext-GLORY
date_date+1: 20020101_20020102
and two types of suffix: gridV_R20020130 and... (3 Replies)
Hi
I need to reanme the multiple file using unix script
I have multiple file
like:
sample_YYYYMMDD.xls
test new_YYYYMMDD.xls
simple_YYYYMMDD.xls
I need to rename this file
sample.xls
testnew.xls
SIMPLE.xls
thanks (8 Replies)
Hi,
In my directory I have many files, for e.g.
file_123
file_124
file_125
file_126
file_127
Instead of renaming these files one by one, I would like to rename them at a same time using same command... they should appear like
123
124
125
126
127
What command(awk or ls or... (3 Replies)
Hey guys, I am the definition of a newbie. I am in the process of trying to rip all my dvds onto a new HTPC I setup. While doing this, I am also trying to organize a bunch of other files I already have to proper naming conventions. So far I have just been naming each file separately (I am on a... (4 Replies)
Hi,
I have hundreds of files with XXX in their file name and I want to rename all of them with YYY in place of XXX.
for ex:
$ ls -1
123XXX789
345XXX678
Output
$ ls -1
123YYY789
345YYY678
I know we can loop in each file and sed to replace and rename each file but ren *XXX* *YYY*... (4 Replies)
Hey guys,
I have wrote the following script to apply a module named "trinity" on my files. (it takes two input files and spit a trinity.fasta as output)
#!/bin/bash -l
#SBATCH -p node
#SBATCH -A <projectID>
#SBATCH -n 16
#SBATCH -t 7-00:00:00
#SBATCH --mem=128GB
#SBATCH --mail-type=ALL... (1 Reply)
OS : Oracle Linux 6.8
shell : bash
As shown below, I have multiple files like below (query1-extract_aa, query1-extract_ab, query1-extract_ac, ....)
$ ls -l
total 235680
-rw-rw-r-- 1 reportusr reportusr 30M May 3 11:25 query1-extract_aa
-rw-rw-r-- 1 reportusr reportusr 30M May 3 11:25... (5 Replies)
Discussion started by: kraljic
5 Replies
LEARN ABOUT DEBIAN
mrename
MRENAME(1) General Commands Manual MRENAME(1)NAME
mrename - program to rename files
SYNOPSIS
mrename 'pattern' prefix [option]
DESCRIPTION
This manual page documents briefly the mrename command. This manual page was written for the Debian GNU/Linux distribution because the
original program does not have a manual page.
mrename is a tool for easy and automatic renaming of many files. The 'pattern' is the pattern to search files to rename (quoted to avoid
that bash resolve it), and prefix is the prefix that will be added to the name of each file. The two alternative options for copying or
moving files in the new name are explained below. All parameters are needed, and you have to stay and launch the script in the same direc-
tory of the files to be renamed. The program should be able to write in this directory.
OPTIONS
There are only the following three options.
-c The option -c will copy each file with the new filename.
-m The option -m will move each file in the new filename.
-h Display help.
EXAMPLE
If you have a directory with two jpeg images prof.jpg and forp.jpg and you want to add them a prefix like item0, item1 etc.. (that is
item0prof.jpg, item1forp.jpg etc..) do this:
cd /path/to/the/images
mrename '*.jpg' item -c
to copy each matching file into another with the new name
mrename '*.jpg' item -m
to rename each file without keeping a copy with the previous name
Word-Wide-Web:
http://alfalinux.sourceforge.net/mrename.php3
AUTHOR :
Giancarlo -rofus- Erra
e-mail: rofus@mindless.com
This manual page was written by Dr. Guenter Bechly <gbechly@debian.org>, for the Debian GNU/Linux system (but may be used by others). It is
distributed under the GPL just like mrename itself.
October 22, 2000 MRENAME(1)