Sponsored Content
Top Forums UNIX for Advanced & Expert Users Recursive search for filenames containing .. Post 302577942 by zaxxon on Wednesday 30th of November 2011 10:10:28 AM
Old 11-30-2011
You could then redirect the output of the find to a file "listfile" for example and then use the following to rename them, assuming that every dot (more than one consecutive) being replaced by an underscore ie. 3 dots = 3 underscores:
Code:
while read L; do mv $L $(echo $L|sed '/\.\{2,\}/ {s/\./_/g}'); done < listfile

Just have to be careful that you you don't start your find with a dot as starting directory.
 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

non recursive search in the current directory only

Hi, Am trying for a script which should delete more than 15 days older files in my current directory.Am using the below piece of code: "find /tmp -type f -name "pattern" -mtime +15 -exec /usr/bin/ls -altr {} \;" "find /tmp -type f -name "pattern" -mtime +15 -exec /usr/bin/rm -f {} \;" ... (9 Replies)
Discussion started by: puppala
9 Replies

2. UNIX for Dummies Questions & Answers

recursive search and ftp

Could someone help me in recursive search and ftp'ing the files to remote server? The host machine will have /dir1/dira/list_of_files1 /dir1/dirb/list_of_files2 /dir1/dirc/list_of_files3 . . . so., I need to search from dir1 recursively (only one level down) and find all the files that... (1 Reply)
Discussion started by: brahmi
1 Replies

3. UNIX for Advanced & Expert Users

Recursive directory search using ls instead of find

I was working on a shell script and found that the find command took too long, especially when I had to execute it multiple times. After some thought and research I came up with two functions. fileScan() filescan will cd into a directory and perform any operations you would like from within... (8 Replies)
Discussion started by: newreverie
8 Replies

4. Shell Programming and Scripting

recursive search and copy

Hello again. Well, I need help again sooner as I thought. Now I want to search for files with a known name within all subdirs, and copy the to differently named files in the same directory. For example if I had only one file to copy, I would just usecp fileName newFileNamebut to do this... (1 Reply)
Discussion started by: cabaciucia
1 Replies

5. Shell Programming and Scripting

Recursive search on pattern between two strings

Objective: Recursively search all files under a directory for SQL statements that end with ";" Sample input: UPDATE table1 set col=val UPDATE table2 set cola=vala ,colb=valb; UPDATE table3 set col=val Expected output: UPDATE table2 set cola=vala ,colb=valb; (1 Reply)
Discussion started by: krishmaths
1 Replies

6. UNIX for Dummies Questions & Answers

Help needed - find command for recursive search

Hi All I have a requirement to find the file that are most latest to be modified in each directory. Can somebody help with the command please? E.g of the problem. The directory A is having sub directory which are having subdirectory an so on. I need a command which will find the... (2 Replies)
Discussion started by: sudeep.id
2 Replies

7. Shell Programming and Scripting

Recursive replacement of search string using sed

Dear Unix Forum Group Members, Please do let me know how I can replace the double pipe with single pipe recursively on single record. Sample Input Data: DN set|Call prefix||| Called number address nature 0||| *789|||||||ALL number types 0||| 00||||||||ALL number types 10||... (5 Replies)
Discussion started by: srinu.kadem
5 Replies

8. Shell Programming and Scripting

Recursive folder search faster than find?

I'm trying to find folders created by a propritary data aquisition software with the .aps ending--yes, I have never encountered folder with a suffix before (some files also end in .aps) and sort them by date. I need the whole path ls -dt "$dataDir"*".aps"does exactly what I want except for the... (2 Replies)
Discussion started by: Michael Stora
2 Replies

9. OS X (Apple)

Search recursive

before posting, I have tried to find my answer elsewhere. no luck. I need to find a file buried in a folder somewhere. Master folder has 10 sub folders. each sub folder has folders too. I found this but it does nothing I am on Mac and use Applescript. do shell script "find... (2 Replies)
Discussion started by: sbrady
2 Replies
GOPHFILT(1)						      General Commands Manual						       GOPHFILT(1)

NAME
gophfilt - oneshot connection to gopher document server SYNOPSIS
gophfilt [-t type] [-p path] [-h host] [-s port] [-i item] DESCRIPTION
The gophfilt program is a oneshot command line driven version of a gopher client, suitable for use in shell- or awk-scripts. The Internet Gopher is a distributed document delivery service. It allows a neophyte user to access various types of data residing on mul- tiple hosts in a seamless fashion. This is accomplished by presenting the user a hierarchical arrangement of documents and by using a client-server communications model. The Internet Gopher Server accepts simple queries, and responds by sending the client a document. Gophfilt can operate in either of two modes. The first one is in the spirit of unix filters, in that it accepts requests on stdin and writes results to stdout. The request is in the form of a tab-delimited .cache item. For example: 1Master Gopher at UMN 1/ gopher.tc.umn.edu 70 (Or in string notation) "1Master Gopher at UMN 1/ gopher.tc.umn.edu 70 " This example would result in the retrieval of the root directory from the Master Gopher. Gophfilt's other mode permits the construction of a gopher request from arguments provided on the command line. In this "manual" mode, at least the path and type items must be provided. The default host and port are taken from the file conf.h at module build time. -p specifies the path to the requested data. From our "filter" example above, the field "1/" is the path. -t specifies the type of the requested data. From our example above, the leading "1" character is the type (directory, in this case). -h specifies the name of the host where the server is to be found. The default host (CLIENT1_HOST from file conf.h) is used if not pro- vided. -s specifies the service (port) that the server is monitoring. The default port (CLIENT1_PORT from file conf.h) is used if not provided. -i specifies a search item. This field immediately follows the path field in the transmitted request. -T specifies a receiver timeout in seconds. This is the maximum time that gophfilt will wait for more data. If the "timeout" return value is noticed by the calling program, any data received to that point should be considered suspect. To recreate using manual operation the request from our example, one would execute the following command. gophfilt -t 1 -p 1/ -h gopher.tc.umn.edu -s 70 MORE EXAMPLES
Here is an example that demonstrates the usefulness of the gophfilt. This specific example only works on the Rutgers campus, but illus- trates the point gophfilt -t 0 -p "webster default SPELL" -i flatulence -h hangout.rutgers.edu -s 770 | gophfilt This example requests a selector item from the Webster's Dictionary, and then pipes that item to gophfilt for subsequent retrieval of the actual definition. The result is available on stdout for use. RETURNS
Gophfilt returns the following completion codes on exit: 0 Successful completion. -1 Error in parsing command line arguments. -2 Manual operation and insufficient parameters were provided. -3 Piped operation and unable to read selector from stdin. -4 Unsupported item type requested. -5 Unable to connect to specified host and port combination. -6 Error encountered writing to stdout. -7 Timeout occurred while waiting for more data. GOPHFILT(1)
All times are GMT -4. The time now is 02:08 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy