Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Find and rename file recursively Post 302958305 by krsnadasa on Wednesday 21st of October 2015 05:53:37 AM
Old 10-21-2015
Thanks RudiC and Aia

I just went through documentation of Bash Paramter expansion. Post that these things became quite clear to me. Thank you for your time..
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Batch rename recursively

I would like to replace multiple underscores with hyphens but I have 26,000 files to rename. They are all in one file structure and multiple sub-directories. It would be much simpler if I had a script to do it. Here are some samples of the file names: Example 1... (3 Replies)
Discussion started by: ..Chris..
3 Replies

2. Shell Programming and Scripting

Rename files recursively

hi I have files named 123_234_aaa.jpg 234_231_345.jpg and i wish to rename these files to aaa.jpg and 345.jpg. i.e inital number,_,next number should be removed form the file name. Please let me know how can i do it. (2 Replies)
Discussion started by: vasuarjula
2 Replies

3. Shell Programming and Scripting

Find and Rename File using Terminal

I need help finding a file through terminal and then renaming it automatically. Here is what I have so far to find the file: cd /User/Applications find . */SourceM.app/banner.png | while read line; do mv "$line" banner-.png; done I want the script to rename the file "banner.png" to... (6 Replies)
Discussion started by: rbisconti97
6 Replies

4. Shell Programming and Scripting

Recursively rename some files

Hello, I have one directory with 3 level sub-directories, and about houndard files under those directories. I need a shell script to rename all patern mateched directories and files. For example: the patern is AA in the directory or file name. Orignal directory:... (2 Replies)
Discussion started by: mail4mz
2 Replies

5. Shell Programming and Scripting

Recursively rename directories

I have this directory tree under /apps/myapp/data: imageshack.us/photo/my-images/703/foldersc.png How to recursively rename ONLY directories with 5 digits (00000, 00100, 00200,..., 00007, 00107,...)? I want to add to their name two more zeros: Before: 00107 After: 0000107 Thanks in... (2 Replies)
Discussion started by: Susan_45
2 Replies

6. Shell Programming and Scripting

Problem with Find and rename file

I want to find a file say IIFT and check its size is zero or not. If its zero then I have to rename anothe file say WWFT , which is in another folder to WWFT$Todaysdate. I tried below command: cd dir2 (*File WWFT is in dir2) find dir/ -type f -name 'IIFT*' -size 0 -exec mv WWFT... (3 Replies)
Discussion started by: ammbhhar
3 Replies

7. Shell Programming and Scripting

how to find a pattern from an external file in a directory containing multiple file recursively

Hi, Need your help in this. I have an input file that has multiple enrollment_number, somewhat like 1234567 8901234 9856321 6732187 7623465 Now i have to search and delete these enrollment_number recursively from all the files that are within multiple sub-directories of a... (10 Replies)
Discussion started by: mukulverma2408
10 Replies

8. Shell Programming and Scripting

Find and rename part of a file

hi, Need your help. I need to write a script for below.. i have two files in directory /home/abc as below: Watch_20140203_abc.dat Watchnow_20140203_abc.dat I have to copy this file from /home/abc to /home01/home02 after that i have to rename the date part in above two files... (1 Reply)
Discussion started by: Vivekit82
1 Replies

9. Shell Programming and Scripting

How can I use find command to search string/pattern in a file recursively?

Hi, How can I use find command to search string/pattern in a file recursively? What I tried: find . -type f -exec cat {} | grep "make" \; Output: grep: find: ;: No such file or directory missing argument to `-exec' And this: find . -type f -exec cat {} \; -exec grep "make" {} \;... (12 Replies)
Discussion started by: cola
12 Replies

10. Shell Programming and Scripting

Find file type recursively and move

Hello, I supposed that it was working fine but now I see that it's not working as expected. I am running under ubuntu14.04, trusty. My plan was to search folderA and all subdirectories and move any txt file to destination folder, folderB : find /home/user/folderA/ -type f -iname "*.txt"... (0 Replies)
Discussion started by: baris35
0 Replies
BOS_PRUNE(8)						       AFS Command Reference						      BOS_PRUNE(8)

NAME
       bos_prune - Removes obsolete files from /usr/lib/openafs and /var/log/openafs

SYNOPSIS
       bos prune -server <machine name> [-bak] [-old] [-core]
	   [-all] [-cell <cell name>] [-noauth] [-localauth]
	   [-help]

       bos p -s <machine name> [-b] [-o] [-co] [-a]
	   [-ce <cell name>] [-n] [-l] [-h]

DESCRIPTION
       The bos prune command removes files from the local disk of the server machine named by the -server argument, as specified by one or more of
       the following flags provided on the command line:

       o   The -bak flag removes all files from the /usr/lib/openafs directory that have a ".BAK" extension.

       o   The -old flag removes all files from the /usr/lib/openafs directory that have a ".OLD" extension.

       o   The -core flag removes all files from the /var/log/openafs directory that have a "core." prefix.

       o   The -all flag removes all three types of files at once.

       (If none of these flags are included, the command appears to succeed, but removes no files at all.)

       To display the timestamp on the current, ".BAK", and ".OLD" versions of one or more files, use the bos getdate command.

OPTIONS
       -server <machine name>
	   Indicates the server machine from which to remove files. Identify the machine by IP address or its host name (either fully-qualified or
	   abbreviated unambiguously). For details, see bos(8).

       -bak
	   Removes all files from the /usr/lib/openafs directory that have a ".BAK" extension. Do not combine this flag and the -all flag.

       -old
	   Removes all files from the /usr/lib/openafs directory that have a ".OLD" extension. Do not combine this flag and the -all flag.

       -core
	   Removes all files from the /var/log/openafs directory that have a "core."  prefix. Do not combine this flag and the -all flag.

       -all
	   Combines the effect of the -bak, -old, and -core flags. Do not combine this flag with any of those three.

       -cell <cell name>
	   Names the cell in which to run the command. Do not combine this argument with the -localauth flag. For more details, see bos(8).

       -noauth
	   Assigns the unprivileged identity "anonymous" to the issuer. Do not combine this flag with the -localauth flag. For more details, see
	   bos(8).

       -localauth
	   Constructs a server ticket using a key from the local /etc/openafs/server/KeyFile file. The bos command interpreter presents the ticket
	   to the BOS Server during mutual authentication. Do not combine this flag with the -cell or -noauth options. For more details, see
	   bos(8).

       -help
	   Prints the online help for this command. All other valid options are ignored.

EXAMPLES
       The following example removes all files from the /usr/lib/openafs directory on the machine "fs3.abc.com" that have a ".BAK" or ".OLD"
       extension.

	  % bos prune -server fs3.abc.com -bak -old

       The following example removes all files from the /usr/lib/openafs directory on the machine "db2.abc.com" that have a ".BAK" or ".OLD"
       extension, and all files from the /var/log/openafs directory that have a "core."  prefix.

	  % bos prune -server db2.abc.com -all

PRIVILEGE REQUIRED
       The issuer must be listed in the /etc/openafs/server/UserList file on the machine named by the -server argument, or must be logged onto a
       server machine as the local superuser "root" if the -localauth flag is included.

       The bos prune command cannot be run against servers which are in restricted mode.

SEE ALSO
       KeyFile(5), UserList(5), bos(8), bos_getdate(8)

COPYRIGHT
       IBM Corporation 2000. <http://www.ibm.com/> All Rights Reserved.

       This documentation is covered by the IBM Public License Version 1.0.  It was converted from HTML to POD by software written by Chas
       Williams and Russ Allbery, based on work by Alf Wachsmann and Elizabeth Cassell.

OpenAFS 							    2012-03-26							      BOS_PRUNE(8)
All times are GMT -4. The time now is 05:59 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy