Sponsored Content
Top Forums Shell Programming and Scripting moving files between directories !! Post 302500883 by debu000 on Tuesday 1st of March 2011 11:26:26 PM
Old 03-02-2011
moving files between directories !!

hi

i have a list of directory in a text file with all directories name in a column.(this is not exactly a file but i need to do a grep and awk on a file to find that list)

i have the source folders like

Code:
    abchome/abc/xxyz/nl_xxabc/mm/[directories list to pick up from a file]/ v01
    abchome/abc/xxyz/nl_xxabc/mm_new/[directories list to pick up from a file]/ v01
    abchome/abc/xxyz/nl_xxabc/mm_old/[directories list to pick up from a file]/ v01

out of 5 versions i need to move two versions.Lets say v03 and v05.

destination directories
Code:
abcprojs/abc/projs/mm/[directories similar to the list in that file]/

WHAT I WANT IS TO MOVE THE V01 TYPE OF DIRECTORIES FROM THE SOURCE TO DESTINATION BY A SHELL SCRIPT..

aNY HELP WOULD BE APPRECIATED..Smilie
really need some detail answer..
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

moving directories to new directories on multiple servers

Hi - I am new to unix scripts...I need to move several directories on multiple servers to new directories. (0 Replies)
Discussion started by: mackdaddy07
0 Replies

2. Shell Programming and Scripting

Bash and Awk for creating directories and moving files

I have a security system that FTPs the camera files to my machine, however I want to sort the pictures (taken every 30s) into directories by hour. Every picture uses the following file format. yymmddhhmmsstt.jpg (where tt is the milliseconds) I am thinking the for loop is best for file... (11 Replies)
Discussion started by: Kiint
11 Replies

3. UNIX for Dummies Questions & Answers

Moving files between directories using SFTP

I want to connect to an SFTP server, GET some files, then move those files to a different directory on the SFTP server so I don't try to GET them next time. But there doesn't seem to be a way to move files between directories on the remote server from SFTP. I missing something obvious? And if... (6 Replies)
Discussion started by: cjhancock
6 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

Moving files from several directories into parent

I am fairly new to bash(but am proficient in C++), and have only completed a few simple scripts. This is my first script that I actually need to do a serious task. All of my audiobooks are stored in traditional MP3 format: Music/Artist/Album/*.mp3 (which in this case is... (0 Replies)
Discussion started by: gamendorf
0 Replies

6. Shell Programming and Scripting

moving files to different directories

im trying to move media and other files which are in a specified directory to another directory and create another one if it does not exits(where the files will go),them also create a directory will the remaining files with different extensions will go.my first problem is that my script is not... (8 Replies)
Discussion started by: elginmulizwa
8 Replies

7. UNIX for Dummies Questions & Answers

Selective moving of directories

Hi there, I'm fairly new to Unix and have been getting my head round the command line for a FreeNAS install that I just did. I need to move a whole bunch of directories from one location to another and need a bit of help! I understand the basics of the 'mv' command but am not sure how to specify... (2 Replies)
Discussion started by: randomgooner
2 Replies

8. Shell Programming and Scripting

Need Help Moving Long List Of Files Into Directories

I am very new to BASH and I am having difficulties moving a long list of image files into similarly named directories. I've been trying to come with a script all night and no luck. Here is what my list of files looks like: DSC_0059_01.jpg DSC_0059_02.jpg DSC_0059_03.jpg DSC_0059_04.jpg... (5 Replies)
Discussion started by: jowens1138
5 Replies

9. UNIX for Dummies Questions & Answers

Moving directories

Hi Can I ask a (probably) easy question? I have a range of files in nested directories: subj_01/session_1/AAA/safe.txt subj_01/session_1/AAA/sample.txt subj_01/session_1/DDD/results.txt This is repeated for three sessions for each of subj_{01..026} Is there a way of copying the... (9 Replies)
Discussion started by: montywaite
9 Replies

10. Shell Programming and Scripting

Archiving and moving files into directories, creating directories, etc.

how can i move "dataName".sql.gz into a folder called 'database' and then move "$fileName".tar.gz * .htaccess into a folder called 'www' with the entire gzipped file being "$fileName".tar.gz? Is this doable or overly complex. so mydemo--2015-03-23-1500.tar.gz > database -... (5 Replies)
Discussion started by: wyclef
5 Replies
install(1M)															       install(1M)

NAME
install - install commands SYNOPSIS
dira] dirb] dirc] group] user] file [dirx ...] DESCRIPTION
is a command most commonly used in ``makefiles'' (see make(1)) to install a file (updated target file) in a specific place within a file system. Each file is installed by copying it into the appropriate directory, thereby retaining the mode and owner of the original command. The program prints messages telling the user exactly what files it is replacing or creating and where they are going. is useful for installing new commands, or new versions of existing commands, in the standard directories (i.e. etc.). If no options or directories (dirx...) are given, searches a set of default directories and in that order) for a file with the same name as file. When the first occurrence is found, issues a message saying that it is overwriting that file with file (the new version), and proceeds to do so. If the file is not found, the program states this and exits without further action. If one or more directories (dirx ...) are specified after file, those directories are searched before the directories specified in the default list. Options Options are interpreted as follows: Installs a new command (file) in the directory specified by dira, only if it is not found. If it is found, issues a message saying that the file already exists, and exits without overwriting it. Can be used alone or with the option. Forces file to be installed in given directory, whether or not one already exists. If the file being installed does not already exist, the mode and owner of the new file will be set to and respectively. If the file already exists, the mode and owner will be that of the already existing file. Can be used alone or with the or options. Ignores default directory list, searching only through the given directories (dirx ...). Can be used alone or with any other options other than and If file is not found in any of the searched directories, it is put in the directory specified in dirc. The mode and owner of the new file will be set to and respectively. Can be used alone or with any other options other than and If file is found, this option saves the ``found'' file by copying it to in the directory in which it was found. This option is useful when installing a normally busy text file such as or where the existing file cannot be removed. Can be used alone or with any other options other than Causes file to be owned by group group. This option is available only to users who have appropriate privileges. Can be used alone or with any other option. Causes file to be owned by user user. This option is available only to users who have appropriate privileges. Can be used alone or with any other option. Suppresses printing of messages other than error messages. Can be used alone or with any other options. When no directories are specified (dirx ...), or when file cannot be placed in one of the directories specified, checks for the existence of the file If exists, it is used to determine the final destination of file. If does not exist, the default directory list is further scanned to determine where file is to be located. The file contains a list of absolute pathnames, one per line. The pathname is the "official" destination (for example of the file as it appears on a file system. The file serves as a master list for system command destinations. If there is no entry for file in the file the default directory list is further scanned to determine where file is to be located. Cross Generation The environment variable is used to locate the locations file (in the form This is necessary in cases where cross generation is being done on a production system. Furthermore, each pathname in is appended to (for example, and used as the destination for file. Also, the default directories are also appended to so that the default directories are actually and The file does not exist on a distribution tape; it is created and used by local sites. WARNINGS
cannot create alias links for a command (for example, vi(1) is an alias link for ex(1)). SEE ALSO
make(1), cpset(1M). install(1M)
All times are GMT -4. The time now is 12:42 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy