I have modified your suggestion to the following
but if there is more than 1 file in the source directory, it will only transfer one across and rename it, discarding the remaining files.
Greetings,
I know i can use the mv command to move and rename one file. How can I do this with multiple files?
example
pic01.bmp to pic0001.bmp
how can i perform this function on an entire directory of sequential files and keep them in sequence?
Hints, suggestions are most welcome:)
... (1 Reply)
Hi All,
Being new to scripting I am facing a new situation. We have an application that generates a file lets say dumpfile for each user under the users home directory when they execute the application. This is quite a huge file and imagine having that for over 40 users on a daily basis. The... (1 Reply)
So I am not sure if this should go in the shell forum or in the beginners. It is my first time posting on these forums.
I have a directory, main_dir lets say, with multiple sub directories (one_dir through onehundred_dir for example) and in each sub directory there is a test.txt. How would one... (2 Replies)
Hi,
I have 500 directories each with multiple data files inside them. The names are sort of random. For example, one directory has files named e_1.dat, e_5.dat, e_8.dat, etc. I need to move the files to a single directory and rename them all in numerical order, from 1.dat to 1000(or some... (1 Reply)
Dears,
I need your help!
I got a problem and found some workaround solution but I donno how to realize it.
I have a number of files (about 300 each day) and I need them to be renamed. All these files has fixed number of letters and name looks like this one:... (7 Replies)
Hey, I'm kinda new to the shell scripting and I don't wanna mess things up yet :)
Looking for a solution to the following:
I need to move all the files like "filename.failed.dateandtime" to another directory also renaming them "filename.ready". I can't figure how to do this with multiple files... (4 Replies)
I am a biologist and using an program on a computer cluster that generates a lot of data. The program creates a directory named
ExperimentX (where X is a number) that contains files "out.pdb" and "log.txt". I would like to create a script that renames the out.pdb file to out_ExperimentX.pdb (or... (1 Reply)
Hello,
I would like to rename all available files in a directory from Filename to Filename_Normal.
I tried to use below script but it is giving some error:
#!/bin/sh
for i in `ls`
do
echo Changing $i
mv $i $i_Normal
done
Error received:
Usage: mv src target
or: mv ... (10 Replies)
I have a directory full of directories, say called A B C D E ....
In each of these directories there are files called 1.dsp 2.dsp 3.dsp ..... along with others (with different extensions)
I need to go through each of these directories and move the dsp file to another folder, but with the name now... (6 Replies)
Hey guys,
ive been working on this for about 2hrs now - without any solution.
At first I need to say I dont have skills in linux bash scripting, but I tried to use some codesnippets and manuals from google.
What I want to do:
I have different folders including 2 different filestypes with... (15 Replies)
Discussion started by: peter1337
15 Replies
LEARN ABOUT LINUX
shtool-move
SHTOOL-MOVE.TMP(1) GNU Portable Shell Tool SHTOOL-MOVE.TMP(1)NAME
shtool-move - GNU shtool enhanced mv(1) replacement
SYNOPSIS
shtool move [-v|--verbose] [-t|--trace] [-e|--expand] [-p|--preserve] src-file dst-file
DESCRIPTION
This is a mv(1) style command enhanced with the ability to rename multiple files in a single operation and the ability to detect and not
touch existing equal destinations files, thus preserving timestamps.
OPTIONS
The following command line options are available.
-v, --verbose
Display some processing information.
-t, --trace
Enable the output of the essential shell commands which are executed.
-e, --expand
Expand asterisk in src to be used as ""%"n" (where n is 1,2,...) in dst-file. This is useful for renaming multiple files at once.
-p, --preserve
Detect src-file and dst-file having equal content and not touch existing destination files, thus perserving timestamps. This is useful
for applications that monitor timestamps, i.e. suppress make(1L) repeating actions for unchanged files.
EXAMPLE
# shell script
shtool move -v -e '*.txt' %1.asc
# Makefile
scanner.c: scanner.l
lex scanner.l
shtool move -t -p lex.yy.c scanner.c
HISTORY
The GNU shtool move command was originally written by Ralf S. Engelschall <rse@engelschall.com> in 1999 for GNU shtool.
SEE ALSO shtool(1), mv(1), make(1).
18-Jul-2008 shtool 2.0.8 SHTOOL-MOVE.TMP(1)