Sponsored Content
Top Forums Shell Programming and Scripting Moving Files from one directory to another directory Post 302379147 by erice on Wednesday 9th of December 2009 04:13:25 PM
Old 12-09-2009
mv is destructive, it will delete the original copy after the move, are you sure you don't want to cp first? then rm after you verify the integrity of the file?


Code:
#!/bin/ksh

for file in `ls storage_directory`
do
     mv storage_directory/$file temp_directory/$file
     echo "$file has been moved to temp_directory" >> somelogfile.txt
done


Last edited by pludi; 12-09-2009 at 06:21 PM.. Reason: code tags, please...
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

moving files from a unix directory to a windows directory

Any body any ideas i'm failry new to this so any help would be appreciated. Cheers Steve (2 Replies)
Discussion started by: gleads
2 Replies

2. Shell Programming and Scripting

Moving files not directory.

Hi, I want to move only files not subdirectories. I issued the below command, but subdirectories are also gets moved. mv /ucrrpd/input/upload/ /ucsspd/common/history/ In the above case, all subdirectories in /ucrrpd/input/upload/ also gets moved to /ucsspd/common/history/ I want to... (1 Reply)
Discussion started by: senthil_is
1 Replies

3. Shell Programming and Scripting

Creating date directory and moving files into that directory

I have list of files named file_username_051208_025233.log. Here 051208 is the date and 025233 is the time.I have to run thousands of files daily.I want to put all the files depending on the date of running into a date directory.Suppose if we run files today they should put into 05:Dec:08... (3 Replies)
Discussion started by: ravi030
3 Replies

4. Shell Programming and Scripting

Moving files to specified directory.

Hi I have made a shell script which moves files from a trash bin back to the original directory and also has the option to restoring the file to a directory that is specified by the user. The restoring it to the original directory is working fine, the restoring it to a specified directory is now.... (2 Replies)
Discussion started by: Jodi
2 Replies

5. Shell Programming and Scripting

Moving all files from 1 directory to another

For example i have a directory called name and another called school how to remove first 5 files from name into school? thanks for helping (1 Reply)
Discussion started by: cryogen
1 Replies

6. Shell Programming and Scripting

Grepping file names, comparing them to a directory of files, and moving them into a new directory

got it figured out :) (1 Reply)
Discussion started by: sHockz
1 Replies

7. UNIX for Dummies Questions & Answers

Moving all files in a directory to another directory and archiving them

Hi All, i need to move all files in a directory to some other directory and need to archive them,,, Ex.. Source_Path/my_directory/ files in it are... acw.csv 123.txt bge.dat etc ..and we dont know how many files does my_directory contains and all are with different extensions ..so i need... (6 Replies)
Discussion started by: dssyadav
6 Replies

8. UNIX for Dummies Questions & Answers

Help with moving files from one directory to another directory.

Hi all, Please help me creating a job that runs on every monday. And the job must have a script to move the files from directory1 to directory2 based on date. eg: directory1 = usr/appl/src/archive; directory2 = usr/appl/failed filename : PHDG_90021.txt when the job runs,it must move... (1 Reply)
Discussion started by: Vasanth_bala1
1 Replies

9. Shell Programming and Scripting

Moving Files one directory to another directory shell script

Hi, Could you please assist how to move the gz files which are older than the 90 days from one folder to another folder ,before that it need to check the file system named "nfs" if size is less than 90 or not. If size is above 90 then it shouldn't perform file move and exit the script throwing... (4 Replies)
Discussion started by: venkat918
4 Replies

10. Shell Programming and Scripting

Moving files to a directory with a variable name

I have this shell script which i am going to package into an application: cd /Users/william/Desktop Cleaning; mkdir "date"; cp ~/Desktop/* ~/"date"; how would i point to the directory with the name unknown to cp? (2 Replies)
Discussion started by: ws1
2 Replies
Locale::Codes::LangFam(3pm)				 Perl Programmers Reference Guide			       Locale::Codes::LangFam(3pm)

NAME
Locale::Codes::LangFam - standard codes for language extension identification SYNOPSIS
use Locale::Codes::LangFam; $lext = code2langfam('apa'); # $lext gets 'Apache languages' $code = langfam2code('Apache languages'); # $code gets 'apa' @codes = all_langfam_codes(); @names = all_langfam_names(); DESCRIPTION
The "Locale::Codes::LangFam" module provides access to standard codes used for identifying language families, such as those as defined in ISO 639-5. Most of the routines take an optional additional argument which specifies the code set to use. If not specified, the default ISO 639-5 language family codes will be used. SUPPORTED CODE SETS
There are several different code sets you can use for identifying language families. A code set may be specified using either a name, or a constant that is automatically exported by this module. For example, the two are equivalent: $lext = code2langfam('apa','alpha'); $lext = code2langfam('apa',LOCALE_LANGFAM_ALPHA); The codesets currently supported are: alpha This is the set of three-letter (lowercase) codes from ISO 639-5 such as 'apa' for Apache languages. This is the default code set. ROUTINES
code2langfam ( CODE [,CODESET] ) langfam2code ( NAME [,CODESET] ) langfam_code2code ( CODE ,CODESET ,CODESET2 ) all_langfam_codes ( [CODESET] ) all_langfam_names ( [CODESET] ) Locale::Codes::LangFam::rename_langfam ( CODE ,NEW_NAME [,CODESET] ) Locale::Codes::LangFam::add_langfam ( CODE ,NAME [,CODESET] ) Locale::Codes::LangFam::delete_langfam ( CODE [,CODESET] ) Locale::Codes::LangFam::add_langfam_alias ( NAME ,NEW_NAME ) Locale::Codes::LangFam::delete_langfam_alias ( NAME ) Locale::Codes::LangFam::rename_langfam_code ( CODE ,NEW_CODE [,CODESET] ) Locale::Codes::LangFam::add_langfam_code_alias ( CODE ,NEW_CODE [,CODESET] ) Locale::Codes::LangFam::delete_langfam_code_alias ( CODE [,CODESET] ) These routines are all documented in the Locale::Codes::API man page. SEE ALSO
Locale::Codes The Locale-Codes distribution. Locale::Codes::API The list of functions supported by this module. http://www.loc.gov/standards/iso639-5/id.php ISO 639-5 . AUTHOR
See Locale::Codes for full author history. Currently maintained by Sullivan Beck (sbeck@cpan.org). COPYRIGHT
Copyright (c) 2011-2012 Sullivan Beck This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. perl v5.16.2 2012-10-11 Locale::Codes::LangFam(3pm)
All times are GMT -4. The time now is 07:50 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy