Sponsored Content
Top Forums UNIX for Dummies Questions & Answers mv command: mv vs rename operation Post 302431920 by sweety123 on Wednesday 23rd of June 2010 08:36:16 AM
Old 06-23-2010
mv command: mv vs rename operation

Hi all,

I wish to know about a simple concept of mv command in UNIX. Is moving a file to a different directory takes longer than renaming it in the same direcotry using the mv command?

The scenerio is that I have to transfer a file from one directory to a location which is regularly scanned by some "program" for the file. This "program" moves the file to some other system. Now if the input file is huge, the "program" may transfer the file before the whole file is moved to this location.

So I decided to move the file with a different name to the second location. Once this operation is complete then I would rename the file to the original name so that the "program" can transfer the file.

My query is that whether the renaming would take same time as move operation? If so, then my approach may not work......Please suggest......

Thanks in advance.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

how to rename multiple files with a single command

Hi I have following list of files at a path: 01.AR.asset 01.AR.index 01.AR.asset.vf 01.AR.asset.xv I want to rename all these files as follows: 73.AR.asset.Z 73.AR.index.Z 73.AR.asset.vf.Z 73.AR.asset.xv.Z Can any body give me a single command to acheive the above results. ... (5 Replies)
Discussion started by: tayyabq8
5 Replies

2. Shell Programming and Scripting

how to rename all the files with one command?

How do i rename all the files using a script ? My server create log files and save them with numbering behind the name. for e.g. daily_20080101.log.0001 and so on ... How do a script and crontab it to remove all the numbering? Please help thanks. (2 Replies)
Discussion started by: filthymonk
2 Replies

3. Shell Programming and Scripting

sed command for substring operation

Hi All, Input=abcDEF_1.6k1 I need to use ‘sed' command to get 1.6 value and store to some variable from the given input. Please help me in getting the command. Regards, Kalai (2 Replies)
Discussion started by: kalpeer
2 Replies

4. Shell Programming and Scripting

Rename file using sed command

Greetings, I am very new to the UNIX shell scripting and would like to learn. However, I am currently stuck on how to process the below sample : Filename : DOCabcdef24387987ab90d.xml Pattern "DOC"+any character using and +".xml" And i want to change the second part of that file (any... (20 Replies)
Discussion started by: fanny_tirtasari
20 Replies

5. Shell Programming and Scripting

Column operation : cosne and sine operation

I have a txt file with several columns and i want to peform an operation on two columns and output it to a new txt file . file.txt 900.00000 1 1 1 500.00000 500.00000 100000.000 4 4 1.45257346E-07 899.10834 ... (4 Replies)
Discussion started by: shashi792
4 Replies

6. Shell Programming and Scripting

ksh command to rename all files with no extension

hi! i want to rename all files with no extension with the extension DAT. with this command ls |grep -v "\\." i can list files but i dont know how i am going to rename them.. so i tried FILE_LIST=ls |grep -v "\\." for TEST_FILE in ${FILE_LIST} do mv $TEST_FILE... (2 Replies)
Discussion started by: kouppoua
2 Replies

7. Shell Programming and Scripting

sed command to skip the first line during find and replace operation

Hi Gurus, I did an exhaustive search for finding the script using "sed" to exclude the first line of file during find and replace. The first line in my file is the header names. Thanks for your help.. (4 Replies)
Discussion started by: ks_reddy
4 Replies

8. Shell Programming and Scripting

Having trouble with find rename jpg command

Hi, I have a large series of directories and subdirectories with many jpgs in them. I need to do two things: 1. Create a copy of each jpg found within it's own subdirectory 2. Rename this copied jpg such that apple.jpg becomes apple_m.jpg I have tried to run the following commands in... (1 Reply)
Discussion started by: atharvan13
1 Replies

9. UNIX for Beginners Questions & Answers

Move and Rename in One Command

Hey all, I really need help with some homework I'm having on UNIX. This probably sounds stupid, but I'm being asked to move a file to a specific directory and rename it a specified name in one command. I know how to do it in more than one command, I just can't seem to figure it out using only one... (1 Reply)
Discussion started by: ayylmao12
1 Replies

10. UNIX for Dummies Questions & Answers

FTP rename command help

I have to ftp and rename the file with #finished# extension after successfully transfer. In some environments the command rename ABCD.dat ABCD.#finished# is working fine, but some environments its not working, I have to use escape character something like : rename ABCD.dat ABCD.\#finished\# Why is... (3 Replies)
Discussion started by: srikanth38
3 Replies
rename(3tcl)						       Tcl Built-In Commands						      rename(3tcl)

__________________________________________________________________________________________________________________________________________________

NAME
rename - Rename or delete a command SYNOPSIS
rename oldName newName _________________________________________________________________ DESCRIPTION
Rename the command that used to be called oldName so that it is now called newName. If newName is an empty string then oldName is deleted. oldName and newName may include namespace qualifiers (names of containing namespaces). If a command is renamed into a different namespace, future invocations of it will execute in the new namespace. The rename command returns an empty string as result. EXAMPLE
The rename command can be used to wrap the standard Tcl commands with your own monitoring machinery. For example, you might wish to count how often the source command is called: rename ::source ::theRealSource set sourceCount 0 proc ::source args { global sourceCount puts "called source for the [incr sourceCount]'th time" uplevel 1 ::theRealSource $args } SEE ALSO
namespace(3tcl), proc(3tcl) KEYWORDS
command, delete, namespace, rename Tcl rename(3tcl)
All times are GMT -4. The time now is 03:13 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy