Sponsored Content
Top Forums Shell Programming and Scripting Rename Files in remote directory Post 302907886 by rbatte1 on Wednesday 2nd of July 2014 08:32:51 AM
Old 07-02-2014
You have been asked before to use CODE tags. It's not hard to do and it makes code/data far easier to read. Highlight the text and press the CODE icon, or manually wrap the text in [CODE] & [/CODE]

Anyway, I'm assuming that this is a listing from the remote server you are connecting to with ssh. Could you try:-
Code:
find /tmp -name "abc*log" -type f -size +100c|while read file
do
   printf "mv $file ${file}_BKUP\n"
   mv $file ${file}_BKUP
done

Does that help at all? The printf just produces some trace output. You can remove it if you are happy it works.



Robin

Last edited by rbatte1; 07-02-2014 at 09:33 AM.. Reason: Emboldening
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

rename files in remote server via ftp

Hi All, I want to rename set of files in the remote server which iam unable to do . i can rename only one file at a time . for example ftp $REMOTESERVER { rename $NAME1 $NAME2 } is working whereas ftp $REMOTESERVER { rename $NAME1*.dat $NAME2*.data } is not working ...... (4 Replies)
Discussion started by: dineshr85
4 Replies

2. Shell Programming and Scripting

Rename many files in a directory

Hi, I have around 100 xml file in a directory. I need to rename the files from .xml to .xml1. So i tried using the following command: mv *.xml *.xml1 but i am getting the following error mv: when moving multiple files, last argument must be a directory Try `mv --help' for more... (8 Replies)
Discussion started by: ananthi_ku
8 Replies

3. Shell Programming and Scripting

FTP files from different directory from remote server to one directory in local

Hi All, I want to search for .log files from folders and sub folders in remote server and FTP them to one particular folder in the local machine. I dont want to copy the entire directory tree structure, just have to take all the .log files from all the folders by doing a recursive search from the... (3 Replies)
Discussion started by: dassv
3 Replies

4. UNIX for Dummies Questions & Answers

rename files based on their respective directory name

I have a number of files in directories labeled like this: /Data/tr_gray/tr_DTI/dti_FA.nii.gz (the brackets here represent a range of number that the files are labeled with) I need to rename each dti_FA.nii.gz file according to the name of the folder it resides in. For example, the file ... (3 Replies)
Discussion started by: tk0034
3 Replies

5. UNIX for Dummies Questions & Answers

Bash script to rename files in a directory

Dear friends, I have created a script to rename all files in a directory by appending the file name with username (who created the file), the date it was created. For example, "apple.doc" should be renamed to "johnFeb23apple.doc" where "john" is the owner and "Feb23" is file created date. It... (4 Replies)
Discussion started by: djsnifer
4 Replies

6. Shell Programming and Scripting

How to Rename List of files in a directory

How can i rename list of files in a directory? (4 Replies)
Discussion started by: knip
4 Replies

7. Shell Programming and Scripting

Copy down remote files and rename them to include the server name with full path

I need to pull down a good bit of files for another support team for an upgrade project. I have a server.list with all of the server names. I need to do two parts: FIRST: I have this example, but it does not list the server name in front of each line. #! /bin/bash for server in $(<... (10 Replies)
Discussion started by: asnatlas
10 Replies

8. UNIX for Dummies Questions & Answers

Rename files in a directory and move them

I have a directory e2e_ms_xfer/cent01 this contains the multiple files some of which will be named below with unique date time stamps e2e_ms_edd_nom_CCYYMMDD_HHMM.csv What I want to do is in a loop 1) Get the oldest file 2) Rename 3) Move it up one level from e2e_ms_xfer/cent01 to... (1 Reply)
Discussion started by: andymay
1 Replies

9. Shell Programming and Scripting

How to rename (move) most recent files in directory?

I'm using cygwin32 on Windows. DN is an environment variable pointed at my download directory. This command works to move the single most recent file in my download directory to my current directory: mv "`perl -e '$p = $ARGV; opendir $h, $p or die "cannot opendir $p: $!"; @f = sort { -M $a... (2 Replies)
Discussion started by: siegfried
2 Replies

10. Shell Programming and Scripting

Rename (move) multiple files on remote server using sftp

I want to rename (move) multiple files on remote server. I tried the following command to move all TXT files from my_dir directory to /new_dir. But it does not work. Any help? #!/bin/ksh sftp -dev3 << ABC cd my_dir $(for i in TXT; do echo "ls *.$i" ; rename $x /new_dir/$x;... (1 Reply)
Discussion started by: Soham
1 Replies
KinoSearch1::Search::SearchClient(3pm)			User Contributed Perl Documentation		    KinoSearch1::Search::SearchClient(3pm)

Make a remote procedure call.  For every call that does not close/terminate the socket connection, expect a response back that's been serialized
using Storable.

NAME
KinoSearch1::Search::SearchClient - connect to a remote SearchServer SYNOPSIS
my $client = KinoSearch1::Search::SearchClient->new( peer_address => 'searchserver1:7890', password => $pass, analyzer => $analyzer, ); my $hits = $client->search( query => $query ); DESCRIPTION
SearchClient is a subclass of KinoSearch1::Searcher which can be used to search an index on a remote machine made accessible via SearchServer. METHODS
new Constructor. Takes hash-style params. o peer_address - The name/IP and the port number which the client should attempt to connect to. o password - Password to be supplied to the SearchServer when initializing socket connection. o analyzer - An object belonging to a subclass of KinoSearch1::Analysis::Analyzer LIMITATIONS
Limiting search results with a QueryFilter is not yet supported. COPYRIGHT
Copyright 2006-2010 Marvin Humphrey LICENSE, DISCLAIMER, BUGS, etc. See KinoSearch1 version 1.00. perl v5.14.2 2011-11-15 KinoSearch1::Search::SearchClient(3pm)
All times are GMT -4. The time now is 07:16 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy