Sponsored Content
Full Discussion: moving dir subdir and files
Top Forums Shell Programming and Scripting moving dir subdir and files Post 302360114 by zaxxon on Thursday 8th of October 2009 07:02:12 AM
Old 10-08-2009
Why write a script? Why not just issue a mv on it/them?

Also please generally use [code] and [/code] tags when posting data, code, logs etc. ty.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Moving file(s) from dir to dir

Hi, I am fairly new to writing scripts. I am trying to write a script that moves either One or All of the files from one directory to another. I know how to make the actual command to do it, but i don't quite know how to add operators to it, ie -i or -a. I want -i to move one file from... (4 Replies)
Discussion started by: SirJoeh
4 Replies

2. Shell Programming and Scripting

replace string in multiple files, dir and subdir

Hello, I have a directory www with multiple directories. Every directory has site name with .htm, .html, .php files or sub directories with .htm, .php, .html file as example - www - sitename 1 - site 1 - sitename 2 - sitename 3 What I'm looking for is a... (7 Replies)
Discussion started by: andyjill
7 Replies

3. Shell Programming and Scripting

Moving file from one dir to Another with Given Qualifier

Hi, I want to Move files from one dir to another dir on same mount point. The source dir may contain subdir or files within it. Search the files or subfolder which is older then a given datetime . Move the file recursively and after each successful move of file make an entry to log... (2 Replies)
Discussion started by: rkmbcbs
2 Replies

4. Shell Programming and Scripting

Perform action in dir if dir has .git subdir

Hi, I want to run git status for the dir which has subdir ".git" in it with dir path mentioned in output log? If a dir does not have .git subdir then skip that dir. Dir will have 100 main dirs & 500 + subdirs and so on. I appreciate all your help :b: (4 Replies)
Discussion started by: dragon.1431
4 Replies

5. Shell Programming and Scripting

moving files from a dir in one machine to a dir in another machines

Hi, I am a unix newbie.I need to write a shell script to move my oracle READ WRITE datafiles from one serevr to another. I need to move it from /u01/oradata/W1KK/.. to /u01/oradata/W2KK, /u02/oradata/W1KK/.. to /u02/oradata/W2KK. That is, I actaully am moving my datafiles from one database to... (2 Replies)
Discussion started by: mathews
2 Replies

6. Shell Programming and Scripting

Problem with moving a file to another dir.

Hi frnds The following is the code #!/bin/ksh ############################################################## # # # Created by eDB Dev - 27-May-2011 # # ... (1 Reply)
Discussion started by: balesh
1 Replies

7. Shell Programming and Scripting

Copy files from subdir

Hey, How can I copy files from subdirectories without copy the subdir and copy it to a higher dir For example: /home/test/subdir/file1 copy file1 to /home or another dir thanx (11 Replies)
Discussion started by: Eclecticaa
11 Replies

8. Shell Programming and Scripting

Move all files from dir and subdir to Archive with File name as complete path_filename

HI, I need to move all files from a dir & its all subdir to Archive folder which is indise dir only. and moved filename should changed to complete path ( Like Dir_subdir_subdir2_.._filename ). also all files names shoud capture in a file in order to mail I written below code ... (11 Replies)
Discussion started by: minijain7
11 Replies

9. UNIX for Dummies Questions & Answers

copying the dir/subdir structure from one server to another?

Hi All, I want to copy the dir/subdir structure from SERVER-A to SERVER-B without copying all the files in each dir. Is it possible using SCP / SFTP command? For example, SERVER-A has following two dir/subdirectories and files under each subdir. ... (1 Reply)
Discussion started by: Hangman2
1 Replies

10. UNIX for Dummies Questions & Answers

How do I create a tar file for only dir and its subdir structures??

How do I create a tar file for only dir and its subdir structures?? (4 Replies)
Discussion started by: vx04
4 Replies
mvdir(1M)																 mvdir(1M)

NAME
mvdir - move a directory SYNOPSIS
dir newdir DESCRIPTION
moves one directory tree into another existing directory (within the same file system), or renames a directory without moving it. dir must be an existing directory. If newdir does not exist but the directory that would contain it does, dir is moved and/or renamed to newdir. Otherwise, newdir must be an existing directory not already containing an entry with the same name as the last pathname component of dir. In this case, dir is moved and becomes a subdirectory of newdir. The last pathname component of dir is used as the name for the moved directory. refuses to move dir if the path specified by newdir would be a descendent directory of the path specified by dir. Such cases are not allowed because cyclic sub-trees would be created as in the case, for example, of which is prohibited. does not allow directory to be moved. Only users who have appropriate privileges can use EXTERNAL INFLUENCES
International Code Set Support Single- and multi-byte character code sets are supported. AUTHOR
was developed by OSF and HP. SEE ALSO
cp(1), mkdir(1), mv(1). STANDARDS CONFORMANCE
mvdir(1M)
All times are GMT -4. The time now is 03:31 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy