Sponsored Content
Top Forums UNIX for Advanced & Expert Users moving multiple files --recursively using BSD Post 82823 by lingam on Wednesday 7th of September 2005 01:51:24 AM
Old 09-07-2005
Not using FreeBSD , Smilie but if the following find command can display the files you want to move .
find ./dir -type f -iname "*.t[argz]*[bz2]" -print
then you might try this
#find ./dir -type f -iname "*.t[argz]*[bz2]" -print > /tmp/file.list
#tar cvf - `cat /tmp/file.list` | ( cd /target_dir;tar xvf - )
now you just have to remove the old files .
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

moving and renaming multiple files

Greetings, I know i can use the mv command to move and rename one file. How can I do this with multiple files? example pic01.bmp to pic0001.bmp how can i perform this function on an entire directory of sequential files and keep them in sequence? Hints, suggestions are most welcome:) ... (1 Reply)
Discussion started by: rocinante
1 Replies

2. Shell Programming and Scripting

Moving multiple files and renaming them on the fly

Hi All, Being new to scripting I am facing a new situation. We have an application that generates a file lets say dumpfile for each user under the users home directory when they execute the application. This is quite a huge file and imagine having that for over 40 users on a daily basis. The... (1 Reply)
Discussion started by: daemongk
1 Replies

3. Shell Programming and Scripting

using mv command for moving multiple files in a folder

Hi, I have a requirement where I need to move Bunch of folders containing multiple files to another archive location. i want to use mv command .I am thinking when we use mv command to move directory does it create directory 1st and then move all the files ? e.g source... (4 Replies)
Discussion started by: rkmbcbs
4 Replies

4. UNIX for Dummies Questions & Answers

Need help in moving files recursively

Hi, I have d1,d2,d3 directories / /home/abc/d1 /home/abc/d2 /home/abc/d3 d1,d2 and d3 also have subdirctories. d1-->d11-->d12 d2-->d22-->d23 d3-->d33-->d34 All these directories have files like date_filename.txt so I want to find the files recusively for a particular date from... (1 Reply)
Discussion started by: jagadish_gaddam
1 Replies

5. UNIX for Dummies Questions & Answers

Zip multiple files recursively via UNIX

Hello, After searching, I didn't find any answer to execute my task. Her what I want to achieve on my MAC : Create a ZIP file (not tar.gz or other) from a file I want the ZIP created to have the name of the original file I want to do this on multiple files (314 exactly) So at the end the... (3 Replies)
Discussion started by: anou
3 Replies

6. UNIX for Advanced & Expert Users

Moving multiple files based on the pattern

I want to search for a particular file name patterns and move them to a specific folder, is it possible to do it with awk or sed? (1 Reply)
Discussion started by: rudoraj
1 Replies

7. Shell Programming and Scripting

[SOLVED] moving multiple files? mv

HI I have a list of files that are incorrectely names and I need to move them to new name .. I tried few things that has not worked so far can you help ? I need to rename all thes eifle ( tere are over 100 ) xldn0357bap.orig.new xldn0389bap.orig.new xldn0439bap.orig.new... (12 Replies)
Discussion started by: mnassiri
12 Replies

8. Shell Programming and Scripting

Moving and renaming multiple files in a directory

Hi. I am trying to automate the movement and renaming of a number of files in a directory. I am using the 'mv' command as I do not have access to 'rename'. I have the following scripted FILES=$(ls /transfer/move/sys/mail/20130123/) if ; then for i in ${FILES} ; do mv... (4 Replies)
Discussion started by: jimbojames
4 Replies

9. UNIX for Dummies Questions & Answers

Moving multiple datestamped files (Linux)

Hello all, I'm writing a script that will allow me to move files into a sub-directory for archiving. These files, specifically, are output files that result at the end of a process. The issue I'm having is that while moving files from one place to another is relatively an easy task, grabbing... (2 Replies)
Discussion started by: galileo1
2 Replies

10. Shell Programming and Scripting

Search/Replace in multiple files recursively

Hi there, I am using AIX and trying to search and replace a string with another string in multiple files in different directories. I wanted to search replace in steps so I don't change all of the instance anywhere in the server at once, minimizing impact. STEP 1: -------- I first searched... (5 Replies)
Discussion started by: zaino22
5 Replies
ARGZ_ADD(3)						     Library Functions Manual						       ARGZ_ADD(3)

NAME
argz_add, argz_add_sep, argz_append, argz_count, argz_create, argz_create_sep, argz_delete, argz_extract, argz_insert, argz_next, argz_replace, argz_stringify - functions to handle an argz list SYNOPSIS
#include <argz.h> error_t argz_add(char **argz, size_t *argz_len, const char *str); error_t argz_add_sep(char **argz, size_t *argz_len, const char *str, int delim); error_t argz_append(char **argz, size_t *argz_len, const char *buf, size_t buf_len); size_t argz_count(const char *argz, size_t argz_len); error_t argz_create(char * const argv[], char **argz, size_t *argz_len); error_t argz_create_sep(const char *str, int sep, char **argz, size_t *argz_len); error_t argz_delete(char **argz, size_t *argz_len, char *entry); void argz_extract(char *argz, size_t argz_len, char **argv); error_t argz_insert (char **argz, size_t *argz_len, char *before, const char *entry); char * argz_next(char *argz, size_t argz_len, const char *entry); error_t argz_replace(char **argz, size_t *argz_len, const char *str, const char *with, unsigned int *replace_count); void argz_stringify(char *argz, size_t len, int sep); DESCRIPTION
These functions are glibc-specific. An argz vector is a pointer to a character buffer together with a length. The intended interpretation of the character buffer is array of strings, where the strings are separated by NUL bytes. If the length is nonzero, the last byte of the buffer must be a NUL. These functions are for handling argz vectors. The pair (NULL,0) is an argz vector, and, conversely, argz vectors of length 0 must have NULL pointer. Allocation of nonempty argz vectors is done using malloc(3), so that free(3) can be used to dispose of them again. argz_add() adds the string str at the end of the array *argz, and updates *argz and *argz_len. argz_add_sep() is similar, but splits the string str into substrings separated by the delimiter delim. For example, one might use this on a Unix search path with delimiter ':'. argz_append() appends the argz vector (buf,buf_len) after (*argz,*argz_len) and updates *argz and *argz_len. (Thus, *argz_len will be increased by buf_len.) argz_count() counts the number of strings, that is, the number of NUL bytes, in (argz,argz_len). argz_create() converts a Unix-style argument vector argv, terminated by (char *) 0, into an argz vector (*argz,*argz_len). argz_create_sep() converts the NUL-terminated string str into an argz vector (*argz,*argz_len) by breaking it up at every occurrence of the separator sep. argz_delete() removes the substring pointed to by entry from the argz vector (*argz,*argz_len) and updates *argz and *argz_len. argz_extract() is the opposite of argz_create(). It takes the argz vector (argz,argz_len) and fills the array starting at argv with point- ers to the substrings, and a final NULL, making a Unix-style argv vector. The array argv must have room for argz_count(argz,argz_len) + 1 pointers. argz_insert() is the opposite of argz_delete(). It inserts the argument entry at position before into the argz vector (*argz,*argz_len) and updates *argz and *argz_len. If before is NULL, then entry will inserted at the end. argz_next() is a function to step trough the argz vector. If entry is NULL, the first entry is returned. Otherwise, the entry following is returned. It returns NULL if there is no following entry. argz_replace() replaces each occurrence of str with with, reallocating argz as necessary. If replace_count is non-NULL, *replace_count will be incremented by the number of replacements. argz_stringify() is the opposite of argz_create_sep(). It transforms the argz vector into a normal string by replacing all NULs except the last by sep. RETURN VALUE
All argz functions that do memory allocation have a return type of error_t, and return 0 for success, and ENOMEM if an allocation error occurs. BUGS
Argz vectors without final NUL may lead to Segmentation Faults. NOTES
These functions are a GNU extension. Handle with care. SEE ALSO
envz(3) ARGZ_ADD(3)
All times are GMT -4. The time now is 05:23 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy