07-12-2016
Search and Copy Files
Hi All
Need your help, I am looking for a script to search for files with specific extension as .log and then copy the latest one to a different folder.
Here is the scenario
/dev/abc/xyz/a_2_122920131.log
/dev/abc/xyz/a_2_123020131.log
/dev/abc/xyz/b_2_12302013.log
/dev/abc/xyz/b_2_12312013.log
/dev/abc/xyz/c_2_12312013.log
I want to search for all such files for all folders under home and then copy the latest one for each one of them
So for above scenario I should be able to copy follwoin
/dev/abc/xyz/copy/a_2_12302013.log
/dev/abc/xyz/copy/b_2_12312013.log
/dev/abc/xyz/copy/c_2_12312013.log
Any inputs will help
Thanks...
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
Hi I need to search the some ftp files created in last 24 hours and copy them to a directory with date stamp attached to it.
Iam using following command to search the files
find $CA_OUT_PATH/*/ftp_out -type f -mtime -1
but now how to copy these files to some other directory one by one
with... (1 Reply)
Discussion started by: sreenusola
1 Replies
2. Shell Programming and Scripting
Hi I need to search the some ftp files created in last 24 hours and copy them to a directory with date stamp attached to it.
Iam using following command to search the files
find $CA_OUT_PATH/*/ftp_out -type f -mtime -1
but now how to copy these files to some other directory one by one ... (1 Reply)
Discussion started by: sreenusola
1 Replies
3. Shell Programming and Scripting
Hi All,
server16.na.in.com UNKNOWN ftpuser "CWD" dms-imrm/Delasco_Invoices_DayForward_Scan" 250 -
server16.na.in.com UNKNOWN ftpuser "PWD" 257 -
server16.na.in.com UNKNOWN ftpuser "CWD Private" 250 -
server16.na.in.com UNKNOWN ftpuser "PWD" 257 -
server16.na.in.com UNKNOWN... (7 Replies)
Discussion started by: Tuxidow
7 Replies
4. Shell Programming and Scripting
Can i search in a file for more than one string at a time? And copy the next string after that and paste it in column style? Is it possible? Thanks! (4 Replies)
Discussion started by: kingpeejay
4 Replies
5. Shell Programming and Scripting
Hello
Im new to this forums, I would like some help regarding a script that I need in order to copy some files. Heres the scenario:
I need to search several files which have a particular code inside, lets say "test" all of them on different directories. I need to copy all of them on a new... (4 Replies)
Discussion started by: c.watson
4 Replies
6. SuSE
Hello Linux Masters,
I am not a linux expert therefore i need help from linux gurus.
Well i have a requirement where i need to search all files based on first patterns and after seraching all files then serach second pattern in all files which i have extracted based on first pattern.... (1 Reply)
Discussion started by: Black-Linux
1 Replies
7. Shell Programming and Scripting
I am a newbie and would like some help with the following -
Trying to search fileA for a string similar to -
AS11000022010 30.4 31.7 43.7 53.8 60.5 71.1 75.2 74.7 66.9 56.6 42.7 32.5 53.3
I then want to replace that string with a string from fileB - ... (5 Replies)
Discussion started by: ncwxpanther
5 Replies
8. Shell Programming and Scripting
So I have extremely limited experience with shell scripting and I was hoping someone could point out a few commands I need to use in order to pull this off with a shell script like BASH or whatnot (this is on OS X).
I need to search out for filenames with account numbers in the name itself... (3 Replies)
Discussion started by: flyawaymike
3 Replies
9. Shell Programming and Scripting
Hi All,
I am new to shell srcipting.
Problem :
I need to write a script which copy the log files from /prod/logs directory based on todays date like (Jul 17) and place it to /home/hzjnr0 directory and then search the copied logfiles for the string "@ending successfully on Thu Jul 17". If... (2 Replies)
Discussion started by: mail.chiranjit
2 Replies
10. UNIX for Dummies Questions & Answers
HI everyone,
I been to this site before for help and found my answers on other threads now I am posting my own :).
I have a list of file names with out extensions on an txt file. I need a way for the script to search on the server for each file name and copy the files over to a new directory.... (12 Replies)
Discussion started by: sergiol
12 Replies
LEARN ABOUT SUSE
gnome-search-tool
gnome-search-tool(1) General Commands Manual gnome-search-tool(1)
NAME
gnome-search-tool - the GNOME Search Tool
SYNOPSIS
gnome-search-tool [options]
or select Search for Files... from a Main Menu or from the Places menu in a Menu Bar
DESCRIPTION
GNOME Search Tool is a utility for finding files on your system. To perform a basic search, you can type a filename or a partial filename,
with or without wildcards. To refine your search, you can apply additional search options.
GNOME Search Tool uses the find, grep, and locate UNIX commands. The case sensitivity of the search depends on your operating system. For
example, on Linux, the find, grep, and locate commands support the -i option, so all searches are case-insensitive.
For full documentation see the GNOME Search Tool online help.
OPTIONS
--help Show help message
--named=STRING
Set the text of "Name contains" search option
--path=PATH
Set the text of "Look in folder" search option
--sortby=VALUE
Sort files by one of the following: name, folder, size, type, or date
--descending
Set sort order to descending, the default is ascending
--start
Automatically start a search
--contains=STRING
Select and set the "Contains the text" search option
--mtimeless=DAYS
Select and set the "Date modified less than" search option
--mtimemore=DAYS
Select and set the "Date modified more than" search option
--sizemore=KILOBYTES
Select and set the "Size at least" search option
--sizeless=KILOBYTES
Select and set the "Size at most" search option
--empty
Select the "File is empty" search option
--user=USER
Select and set the "Owned by user" search option
--group=GROUP
Select and set the "Owned by group" search option
--nouser
Select the "Owner is unrecognized" search option
--notnamed=STRING
Select and set the "Name does not contain" search option
--regex=PATTERN
Select and set the "Name matches regular expression" search option
--hidden
Select the "Show hidden and backup files" search option
--follow
Select the "Follow symbolic links" search option
--mounts
Select the "Exclude other filesystems" search option
AUTHOR
GNOME Search Tool was originally written by George Lebl (<jirka@5z.com>). Version 2 was written by Dennis M. Cranston (<den-
nis_cranston@yahoo.com>).
This manual page was originally written by Jochen Voss <voss@mathematik.uni-kl.de>. Version 2 was written by Dennis M. Cranston (<den-
nis_cranston@yahoo.com>).
SEE ALSO
find(1), locate(1), grep(1)
gnome-utils 2.27.1 March 16 2009 gnome-search-tool(1)