Sponsored Content
Full Discussion: Moving and renaming files
Top Forums UNIX for Dummies Questions & Answers Moving and renaming files Post 302899919 by Scrutinizer on Friday 2nd of May 2014 11:49:38 AM
Old 05-02-2014
cd to the directory with the A B C ... directories first. Try something like:
Code:
for f in */*
do 
  [ -f "$f" ] && mv "./$f" "$newdir/${f%/*}_${f##*/}"
done

First try it out on some test directories..

Last edited by Scrutinizer; 05-02-2014 at 12:54 PM..
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

moving and renaming multiple 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)
Discussion started by: rocinante
1 Replies

2. Shell Programming and Scripting

Moving multiple files and renaming them on the fly

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)
Discussion started by: daemongk
1 Replies

3. Shell Programming and Scripting

Finding files older than the current date and time and renaming and moving

Hi, I have a very urgent requirement here. I have to find all files in the specified directory but not in the sub directories(The directory name is stored in a variable) which are older than the current date as well as current time and rename it as filename_yyyymmddhhmmss.ext and move it into a... (7 Replies)
Discussion started by: ragavhere
7 Replies

4. UNIX for Dummies Questions & Answers

Moving files out of multiple directories and renaming them in numerical order

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)
Discussion started by: renthead720
1 Replies

5. Shell Programming and Scripting

Need help with shell script for moving/deleting/renaming files

Hi. I need help with a little script that will be used to move some files to their parent directory, delete the directory, rename one file in the parent directory and delete another, then continue to the next. Here's an example: /var/media/Music/Genesis/1970 album - Trespass (2008 Box -... (4 Replies)
Discussion started by: aflower
4 Replies

6. Shell Programming and Scripting

Need script for renaming and moving files one by one...

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)
Discussion started by: nypreH
7 Replies

7. Shell Programming and Scripting

Moving and renaming large ammount of files

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)
Discussion started by: sg3
4 Replies

8. Shell Programming and Scripting

Complex renaming then moving files

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)
Discussion started by: yaledocker
1 Replies

9. Shell Programming and Scripting

Moving and renaming multiple files in a directory

Hi. I am trying to automate the movement and renaming of a number of files in a directory. I am using the 'mv' command as I do not have access to 'rename'. I have the following scripted FILES=$(ls /transfer/move/sys/mail/20130123/) if ; then for i in ${FILES} ; do mv... (4 Replies)
Discussion started by: jimbojames
4 Replies

10. Shell Programming and Scripting

Shell Script for renaming and moving Files - Easy?

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
SVN_LOAD_DIRS(1)					      General Commands Manual						  SVN_LOAD_DIRS(1)

NAME
svn_load_dirs - Load directories into a Subversion repository SYNOPSIS
svn_load_dirs [options] svn_url svn_import_dir [directory ...] DESCRIPTION
This tool can be used for importing one or more directories into a Subversion repository. The difference from "svn import" is that svn_load_dirs can update an existing directory tree, and tag it properly. Only changes from the previous version will be recorded in the revision, so that you can easily apply them on another branch. For example, this is very useful for managing the upstream source when maintaining Debian packages in Subversion. OPTIONS
svn_url The base Subversion URL. svn_import_dir The path relative to svn_url where the directories are to be imported. directory ... The directories to import. If they are not specified on the command line, they are read from standard input. -no_user_input Don't ask any questions. Assume that the answer is yes. -p filename Apply the properties specified in the configuration file filename to matching files. See below for a description of the configura- tion file format. -svn_username username Username to use when committing to the repository. -svn_password password Password to use when committing to the repository. -t tag_dir Create a tag copy in tag_dir, relative to svn_url. tag_dir may contain a regular expression enclosed within '@' characters. It will be replaced by the matching part from the imported directory names. -v Be more verbose. Use multiple times for increased effect. -wc path Use the already checked out working copy at path instead of checking out a new working copy. PROPERTY CONFIGURATION FILE FORMAT
The property configuration file, which is specified by the -p option, contains rules for applying properties to the imported files. It consists of lines of the following format: regular_expression control property_name property_value The meaning of the fields are: regular_expression A Perl-style regular expression matching the files to apply this rule to. control Either "break" or "cont". If set to "break", processing of the current file will stop if this rule matches. If set to "cont", pro- cessing will continue. The latter can be used to set multiple properties for one file. property_name (Optional) The name of the property to set. property_value (Optional) Set the property to this value. The last two fields may be omitted, in which case the rule will not set any properties. This is useful for excluding certain files from subsequent rules. You need to quote the regular_expression, property_name and property_value fields with double quotes ('"') if you have whitespace in them. Single and double quotes can be escaped with backslash (''). EXAMPLES
For example, to import the contents of the foo-1.3 directory into the upstream/current directory of the foo repository: svn_load_dirs svn+ssh://svn.example.org/svn/foo upstream/current foo-1.3 A tag can also be added automatically using the -t option: svn_load_dirs svn+ssh://svn.example.org/svn/foo -t 'upstream/@d+.w+@' upstream/current foo-1.3 Here's an example of a property configuration file: .doc$ break svn:mime-type application/msword .ds(p|w)$ break svn:eol-style CRLF .dos2unix-eol.sh$ break .* break svn:eol-style native This example specifies that .doc files are to be treated as binary files, that .dsp and .dsw files have their line ending characters kept, and that all other files except dos2unix-eol.sh have their line endings converted to the native style. SEE ALSO
/usr/share/doc/subversion-tools/svn_load_dirs.README.gz svn(1) AUTHOR
This manual page was written by Per Olofsson <pelle@dsv.su.se> for the Debian distribution (but may be used by others). Some parts were taken from the README. SVN_LOAD_DIRS(1)
All times are GMT -4. The time now is 01:32 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy