Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Bash script to rename all files within a folder... Post 302477516 by jim mcnamara on Sunday 5th of December 2010 03:59:47 PM
Old 12-05-2010
One way:
Code:
cd ./directory
cnt=1
for fname in *
do
    mv $fname file${cnt}.avi
    cnt=$(( $cnt + 1 ))
done

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Hello - new here - bash script - need to rename and zip files.

I'm working on a project that basically unzips three zip files. When these unzip they create about 70+ directories with subdirectories of year/month with about 3 to 9 pdf files in each directory. Basically, I'm needing to figure out a way to zip these pdf files up. for instance the script... (1 Reply)
Discussion started by: Aixia
1 Replies

2. UNIX for Dummies Questions & Answers

rename files in a folder

i have a folder that contains 100's of files: abc, bca, def, ghi.... i want to rename abc with 1, bca with 2, def with 3, ghi with 4 and so on. my way, i create a file.txt with contents: 1 2 3 4 i use while loop to rename my files. without using file.txt, i just want to rename abc with... (4 Replies)
Discussion started by: tjmannonline
4 Replies

3. Shell Programming and Scripting

rename all the files in a folder..

Hi Guys, I have 5000 files in a folder. all are .DAT files. I want to rename them as .TXT files. I tried the following command. mv *.DAT *. TXT But it is throwing an error. Can you please tell me what am i doing wrong. Thanks & Regards, Magesh. (11 Replies)
Discussion started by: mac4rfree
11 Replies

4. Shell Programming and Scripting

sed to rename files in a folder - please help with script

Hello, I am new to shell scripting and stuck on renaming files in a folder. The files have the format chp01_00001.wav chp01_00002.wav .... chp02_00001.wav chp02_00002.wav .... but I want them to have the following names: chp_bloomy_00001.wav chp_bloomy_00002.wav chp_bloomy_00003.wav... (8 Replies)
Discussion started by: Bloomy
8 Replies

5. Shell Programming and Scripting

Bash script to sort files into folder according to a string in the filename

Hi all. I am very new to linux scripting and i have a task i can only solve with a script. I need to sort files base on the date string in their filenames and create a folder using the same date string then move the files to their respective folders. Scenario: Folder Path:... (1 Reply)
Discussion started by: ace47
1 Replies

6. UNIX for Dummies Questions & Answers

Bash script to rename files in a directory

Dear friends, I have created a script to rename all files in a directory by appending the file name with username (who created the file), the date it was created. For example, "apple.doc" should be renamed to "johnFeb23apple.doc" where "john" is the owner and "Feb23" is file created date. It... (4 Replies)
Discussion started by: djsnifer
4 Replies

7. UNIX for Dummies Questions & Answers

Bash script to execute a program to rename files

I just can't figure it out , so please just give me a pice of advise how to: The existing Linux program foo2bar takes as its only argument the name of a single foo file and converts it to an appropriately-named bar file. Provide a script that when executed will run foo2bar against all foo... (4 Replies)
Discussion started by: raymen
4 Replies

8. Shell Programming and Scripting

Been working since 25+ hrs: Bash Script to rename files supposedly direct but difficult to execute

:wall::wall::wall: Hi I have horrible script below, need help in renaming ls -l output into new filename format: Desired output: cp -pv original_path/.* newDirectory/owner_of_file.%dd%mm%y.file_extension.first_8_characters_of_original_filename localuser@localuser:~ vi... (3 Replies)
Discussion started by: wolf@=NK
3 Replies

9. Shell Programming and Scripting

Bash script read specific value from files of an entire folder

Hello, I heva a problem creating a script that read specifc value from all the files of an entire folder I have a number of email files into a directory and i need to extrect from each file 2 specific values. After that i have to put them into a new file that looks like that: To: value1 ... (1 Reply)
Discussion started by: ahmenty
1 Replies

10. Shell Programming and Scripting

Simply Bash Script to Confirm that there are 2 Files in Same Folder

Im looking for 2 Files -> *.WAV and *.wav with find . -name 'unavail.wav' -o -name 'unavail.WAV' I need to list the Folders that contains these 2 Files? Thx in advance (13 Replies)
Discussion started by: valdez
13 Replies
BP_SEARCH2TRIBE(1p)					User Contributed Perl Documentation				       BP_SEARCH2TRIBE(1p)

NAME
search2tribe - Turn SearchIO parseable reports(s) into TRIBE matrix SYNOPSIS
Usage: search2tribe [-o outputfile] [-f reportformat] [-w/--weight] file1 file2 .. DESCRIPTION
This script is probably too slow for most people's uses. It is better to use something like scripts/searchio/fastam9_to_table, -m 9 output from BLAST, or the blast2table from the BLAST O'Reilly book to get a tabular output from these programs and then feed the table into MCL with the mcxdeblast script and the --m9 option. This script will turn a protein Search report (BLASTP, FASTP, SSEARCH) into a Markov Matrix for TribeMCL clustering. The options are: -o filename - the output filename [default STDOUT] -f format - search result format (blast, fasta) (ssearch is fasta format). default is blast. -w or --weight VALUE - Change the default weight for E(0.0) hits to VALUE (default=200 (i.e. 1e-200) ) -h - this help menu Additionally specify the filenames you want to process on the command-line. If no files are specified then STDIN input is assumed. You specify this by doing: search2tribe < file1 file2 file3 AUTHOR
Jason Stajich, jason-at-bioperl-dot-org perl v5.14.2 2012-03-02 BP_SEARCH2TRIBE(1p)
All times are GMT -4. The time now is 10:49 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy