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
Hello,
I want to rename multiple files at a time and I don't know how to do it.
I have various ".mp3" files, like "band name - music name.mp3" and I want to remove the "band name" from all files.
Anybody knows how to do it using shell script or sed or even perl?
Thanks (7 Replies)
Hi,
can anyone have a ksh script to rename multiple files (ie to remove .Z extension of the files)
can someone correct this?
for i in *.Z
do
var1 = substr($i, 1,at(".Z",$i)-1)
mv $i $var1
done
Thanks..
Antony (13 Replies)
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
... (4 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,
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)
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)
I have multiple files in folder which i want to rename. hence I am using the below command in my script by I get an error:
export XXX_LOG_DIR="${LOG_DIR}/${XXX_HOST}/xxx/${REPORT_DATE}"
mv $XXX_LOG_DIR/*.audit.gz $XXX_LOG_DIR/*.audit.log.gz
But I get the below error:
mv: target... (5 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 FREEBSD
mv
MV(1) BSD General Commands Manual MV(1)NAME
mv -- move files
SYNOPSIS
mv [-f | -i | -n] [-hv] source target
mv [-f | -i | -n] [-v] source ... directory
DESCRIPTION
In its first form, the mv utility renames the file named by the source operand to the destination path named by the target operand. This
form is assumed when the last operand does not name an already existing directory.
In its second form, mv moves each file named by a source operand to a destination file in the existing directory named by the directory oper-
and. The destination path for each operand is the pathname produced by the concatenation of the last operand, a slash, and the final path-
name component of the named file.
The following options are available:
-f Do not prompt for confirmation before overwriting the destination path. (The -f option overrides any previous -i or -n options.)
-h If the target operand is a symbolic link to a directory, do not follow it. This causes the mv utility to rename the file source to
the destination path target rather than moving source into the directory referenced by target.
-i Cause mv to write a prompt to standard error before moving a file that would overwrite an existing file. If the response from the
standard input begins with the character 'y' or 'Y', the move is attempted. (The -i option overrides any previous -f or -n options.)
-n Do not overwrite an existing file. (The -n option overrides any previous -f or -i options.)
-v Cause mv to be verbose, showing files after they are moved.
It is an error for the source operand to specify a directory if the target exists and is not a directory.
If the destination path does not have a mode which permits writing, mv prompts the user for confirmation as specified for the -i option.
As the rename(2) call does not work across file systems, mv uses cp(1) and rm(1) to accomplish the move. The effect is equivalent to:
rm -f destination_path &&
cp -pRP source_file destination &&
rm -rf source_file
EXIT STATUS
The mv utility exits 0 on success, and >0 if an error occurs.
EXAMPLES
Rename file foo to bar, overwriting bar if it already exists:
$ mv -f foo bar
COMPATIBILITY
The -h, -n, and -v options are non-standard and their use in scripts is not recommended.
SEE ALSO cp(1), rm(1), symlink(7)STANDARDS
The mv utility is expected to be IEEE Std 1003.2 (``POSIX.2'') compatible.
HISTORY
A mv command appeared in Version 1 AT&T UNIX.
BSD March 15, 2013 BSD