Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Batch Renaming: Change files' extensions in many sub-directories Post 302216635 by rubin on Sunday 20th of July 2008 05:00:42 PM
Old 07-20-2008
OK, cd to the directory where you think your zzz files ( /public_html/files ?? ) are, and run:

Code:
find . -type f -name "*.zzz"

If you still can't find them run :

Code:
find / -type f -name "*.zzz"

and post the output, CTRL+C as soon as you see some results.

This the output that I get ( I'm on linux too):
Code:
[ tmp]$ls -1
a_1.zzz
b_1.zzz
blah_1.jpg
blah_2.jpg
c_1.zzz
directory.zzz
other_directory

[ tmp]$find . -type f -name "*.zzz" 
./c_1.zzz
./a_1.zzz
./b_1.zzz
./directory.zzz/a_2.zzz
./directory.zzz/c_2.zzz
./directory.zzz/b_2.zzz

[tmp]$find . -type f -name "*.zzz" | xargs -i  echo  '{}' '{}'_disable
./c_1.zzz ./c_1.zzz_disable
./a_1.zzz ./a_1.zzz_disable
./b_1.zzz ./b_1.zzz_disable
./directory.zzz/a_2.zzz ./directory.zzz/a_2.zzz_disable
./directory.zzz/c_2.zzz ./directory.zzz/c_2.zzz_disable
./directory.zzz/b_2.zzz ./directory.zzz/b_2.zzz_disable

[tmp]$find . -type f -name "*.zzz" | xargs -t -i  mv   '{}' '{}'_disable
mv ./c_1.zzz ./c_1.zzz_disable 
mv ./a_1.zzz ./a_1.zzz_disable 
mv ./b_1.zzz ./b_1.zzz_disable 
mv ./directory.zzz/a_2.zzz ./directory.zzz/a_2.zzz_disable 
mv ./directory.zzz/c_2.zzz ./directory.zzz/c_2.zzz_disable 
mv ./directory.zzz/b_2.zzz ./directory.zzz/b_2.zzz_disable 

[ tmp]$find . -type f -name "*.zzz_*" 
./c_1.zzz_disable
./b_1.zzz_disable
./a_1.zzz_disable
./directory.zzz/c_2.zzz_disable
./directory.zzz/b_2.zzz_disable
./directory.zzz/a_2.zzz_disable

Copy/Paste your output of the above commands ( samples of course ).
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

A Batch job to delete files from various directories

Hi, I have a shell script to find files older than 'X' days ($2) in directory path ($1) and delete them. Like this: my_file_remover.sh /usr/home/c 90 Now, I need to modify this script and add it in CRON, so that it checks other directories also. Like: my_file_remover.sh /usr/home/c... (3 Replies)
Discussion started by: guruparan18
3 Replies

2. Shell Programming and Scripting

Batch changing file extensions

We are moving from an OpenVMS server to a Unix server and I have a problem with ftp'ing files. When I ftp the VMS server from the Unix server, I need to "mget" some files, for example "mget test_file*.txt;". The semicolon is necessary because OpenVMS has multiple versions of the file (eg... (5 Replies)
Discussion started by: cdines
5 Replies

3. UNIX for Dummies Questions & Answers

Renaming files after their directory name in multiple sub directories

So I am not sure if this should go in the shell forum or in the beginners. It is my first time posting on these forums. I have a directory, main_dir lets say, with multiple sub directories (one_dir through onehundred_dir for example) and in each sub directory there is a test.txt. How would one... (2 Replies)
Discussion started by: robotsbite
2 Replies

4. UNIX for Dummies Questions & Answers

Moving files out of multiple directories and renaming them in numerical order

Hi, I have 500 directories each with multiple data files inside them. The names are sort of random. For example, one directory has files named e_1.dat, e_5.dat, e_8.dat, etc. I need to move the files to a single directory and rename them all in numerical order, from 1.dat to 1000(or some... (1 Reply)
Discussion started by: renthead720
1 Replies

5. UNIX for Dummies Questions & Answers

Batch Renaming of Files

Hello all, thanks for your time (and this forum, what an awesome resource for newbs like myself!) Anyways, I've been given the task of importing content from a directory of about...7000 HTML files. They are all named appropriately and broken down by name depending on what book they belong too.... (8 Replies)
Discussion started by: gratefulhokie
8 Replies

6. Shell Programming and Scripting

Renaming of files with different extensions on the same path to .found with the help of loop

hi , I have certain files at the same path with differeent extensions like .dat , .txt etc ...........i need to rename them with extension .found at the same path with the help of loop.... also the files names will be like this ; abc_2010_c1.dat abc_2010_c2.dat xyz_2010_c1.txt (2 Replies)
Discussion started by: amitpta
2 Replies

7. Shell Programming and Scripting

script for renaming a batch of files

hi i have a folder full of files. some of the names are quite off because the dimensions were the same and i had to put a 'b' after the initial number so that it didnt overwrite. what i want is a script in unix to overwrite the filwe name leaving some of the title intact, e.g. below are some... (3 Replies)
Discussion started by: shabs1985
3 Replies

8. OS X (Apple)

Batch file to move video files and retain sub-directories

I have just purchased my first ever Apple computer - and am therefore new to UNIX also. I would like to create a simple "batch file" (apologies if this is the wrong terminology) to do the following: When I plug my camera into the MAC it automatically downloads photos and videos into a new... (1 Reply)
Discussion started by: mm0mss
1 Replies

9. Shell Programming and Scripting

Renaming files in multiple directories

Hi I have the following file structure and I want to rename all the abc.jar files to abc_backup.jar rock@server:~/rakesh> ls -R .: test1 test2 test3 ./test1: abc.jar ./test2: abc.jar ./test3: abc.jar (2 Replies)
Discussion started by: rakeshkumar
2 Replies

10. Shell Programming and Scripting

Need help in batch renaming files with bash shell script.

I have some 50+ files in the following format : abcd_vish_running_ZEBRA_20140818.dat_08-14-2014_23:08:23 abcd_vish_running_ZEB-RA_20140818.dat_08-14-2014_23:08:35 abcd_vish_running_ZEB_RA_20140818.dat_08-14-2014_23:08:37 abcd_vish_running_RI-NG_20140818.dat_08-14-2014_23:08:42... (5 Replies)
Discussion started by: SriRamKrish
5 Replies
term(4) 						     Kernel Interfaces Manual							   term(4)

NAME
term - Terminal driver tables for nroff DESCRIPTION
The nroff(1) command uses driver tables to customize its output for various types of output devices. These driver tables are written as C programs and compiled and installed in /usr/share/lib/term/tabname. The name specifier is the name of a terminal type as used with nroff -Tname. The structure of the tables is as follows: #define INCH 240 struct { int bset; int breset; int Hor; int Vert; int Newline; int Char; int Em; int Halfline; int Adj; char *twinit; char *twrest; char *twnl; char *hlr; char *hlf; char *flr; char *bdon; char *bdoff; char *ploton; char *plotoff; char *up; char *down; char *right; char *left; char *codetab[256-32]; char *zzz; } t; The fields have the following meanings: Bits to set in the c_oflag field of the termio structure before output. For further information, see tty(7). Bits to reset in the c_oflag field of the termio structure before output. Horizontal resolution in fractions of an inch. Vertical resolution in fractions of an inch. Space moved by a newline (linefeed) character in fractions of an inch. Quantum of character sizes in fractions of an inch (that is, a character is a multiple of Char units wide). Size of an em in fractions of an inch. Space moved by a half-linefeed (or half-reverse-linefeed) character in fractions of an inch. Quantum of white space in fractions of an inch (that is, white spaces are a multiple of Adj units wide). Note: if this value is less than the size of the space character (in units of Char; see the following fields for how the sizes of characters are defined), nroff outputs fractional spaces using plot mode. Also, if nroff is used with the -e flag, it sets Adj to equal Hor. The set of characters used to initialize the terminal in a mode suitable for nroff The set of characters used to restore the terminal to normal mode. The set of characters used to move down one line. The set of characters used to move up one-half line. The set of characters used to move down one-half line. The set of characters used to move up one line. The set of charac- ters used to turn on hardware boldface mode, if any. The set of characters used to turn off hardware boldface mode, if any. The set of characters used to turn on hardware italics mode, if any. The set of characters used to turn off hardware italics mode, if any. The set of characters used to turn on hardware plot mode (for Diablo type mechanisms), if any. The set of characters used to turn off hardware plot mode (for Diablo type mechanisms), if any. The set of characters used to move up one resolution unit (Vert) in plot mode, if any. The set of characters used to move down one resolution unit (Vert) in plot mode, if any. The set of charac- ters used to move right one resolution unit (Hor) in plot mode, if any. The set of characters used to move left one resolution unit (Hor) in plot mode, if any. Definition of characters needed to print an nroff character on the terminal. The first byte is the number of character units (Char) needed to hold the character; that is, ``01'' is one unit wide, ``02'' is two units wide, and so on. The high-order bit (0200) is on if the character is to be underlined in underline mode (.ul). The rest of the bytes are the characters used to produce the character in question. If the character has the sign (0200) bit on, it is a code to move the termi- nal in plot mode. It is encoded as follows: Vertical motion Horizontal motion Negative (up or left) motion Positive (down or right) motion Number of such motions to make A zero terminator at the end. All quantities that are in units of fractions of an inch should be expressed as INCH*num/denom, where num and denom are respectively the numerator and denominator of the fraction; that is, 1/48 of an inch would be written as ``INCH1/48''. If any sequence of characters does not pertain to the output device, that sequence should be given as a null string. The source code for the terminal name is in /usr/share/lib/term/tabname. When a new terminal type is added, the makefile Makefile.install in that directory should be updated. Building New nroff Drivers The /usr/share/lib/term/mktab.o object module is an nroff compiler-independent driver table generator tool. It is intended to be used as follows: cc -o /tmp/mktab tabxxx.c mktab.o, /tmp/mktab > tabxx Default nroff Drivers The following nroff drivers are provided: Dumb 10-pitch printer with no halfline or upline capability. Generic crt terminal (linked to lpr). LN03S ASCII printer. VT100 crt terminal. Default pseudo-printer device for the man(1) and catman(8) commands. NOTE: The lp driver as supplied by Compaq is linked to the vt100 device. Your system administrator can change the definition of lp to another device. FILES
Driver tables Source file for the driver tables RELATED INFORMATION
tty(7) delim off term(4)
All times are GMT -4. The time now is 06:42 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy