Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Rename multiple files, changing prefix, extension and dropping characters Post 302642427 by Peasant on Thursday 17th of May 2012 11:38:35 AM
Old 05-17-2012
You can try this in working directory :
Code:
ls -1 | sed 's/\(^0\{1,4\}\)\([0-9][0-9]\)\(.*\)/mv & newa0\2.abc/ ' # | sh

After checkin the output pipe it to sh (remove the #) Smilie
This User Gave Thanks to Peasant For This Post:
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Renaming multiple files, to get rid of extension

I have a good script to rename multiple files, but what's the best way I can remove some text from multiple filenames? Say I have a directory with 35 files with a .XLS at the end, how can I rename them to remove the .XLS but keep everything the same, without having to mv manually. Thanks. (6 Replies)
Discussion started by: nj78
6 Replies

2. UNIX for Dummies Questions & Answers

Removing prefix from multiple files and renaming file extension

Hello i have the files in this format pdb1i0t.ent pdb1lv7.ent pdb1pp6.ent pdb1tj2.ent pdb1xg2.ent pdb2b4b.ent pdb2ewe.ent Now i have to remove the prefix pdb from all the files and also i need to change the extension of .ent to .txt The new file should look like this ... (3 Replies)
Discussion started by: empyrean
3 Replies

3. Shell Programming and Scripting

Combining multiple files into one with the same name/different extension

I've been trying to find information in regard to creating a script that will generate HTML files. I currently have a series of files that contain code I need to surround with a <textarea> tag for easy viewing. I have about a thousand files that contain code, one file that contains the HTML code up... (10 Replies)
Discussion started by: 12o
10 Replies

4. Shell Programming and Scripting

Rename files and directories with special characters

Hello guys, I was looking for a shell script that removes all the special characters from the files and the subdirectories recursively. I could not locate it any more. Dose any body have a similar script that dose that? Thanks for the help. AV (0 Replies)
Discussion started by: avatar_007
0 Replies

5. Shell Programming and Scripting

ksh command to rename all files with no extension

hi! i want to rename all files with no extension with the extension DAT. with this command ls |grep -v "\\." i can list files but i dont know how i am going to rename them.. so i tried FILE_LIST=ls |grep -v "\\." for TEST_FILE in ${FILE_LIST} do mv $TEST_FILE... (2 Replies)
Discussion started by: kouppoua
2 Replies

6. Shell Programming and Scripting

Rename all files (filename with spaces) to different extension

Hi, I have files with filenames as below. SGM Daily Sales Email-en-us-05312012.xlwa I want to rename it in .xls. I am writing a script to change this, as there can be multiple files in subfolders. I have the following script. #!/bin/ksh for oldfile in $(find... (1 Reply)
Discussion started by: mac4rfree
1 Replies

7. Red Hat

How to rename files to files with mv extension?

currently in my directories $ ls -lrth total 32K -rw-r--r-- 1 oracle oinstall 864 Feb 25 16:01 cor_bin_gateway_cnt.sql -rw-r--r-- 1 oracle oinstall 782 Feb 25 16:01 mer_bin_gateway_cnt.sql I want to rename files with *.sql to *.mv extension, but when I execute the following $ mv... (1 Reply)
Discussion started by: jediwannabe
1 Replies

8. UNIX for Dummies Questions & Answers

Rename multiple files in shell bash, changing elements order.

Hi, I want to rename several files like this: example: A0805120817.BHN A0805120818.BHN ..... to: 20120817.0805.N 20120818.0805.N ...... How can i do this via terminal or in shell bash script ? thanks, (6 Replies)
Discussion started by: pintolcv
6 Replies

9. Shell Programming and Scripting

How to rename all files at a time by appending some characters at the begining?

Hi I have a list a filename in a directory starting with particular pattern for example: abc_1234.txt abc_7565.txt abc_7676.txt abc_7765.txt i need to rename all these files by appending bck. or bck_ Expected output: bck.abc_1234.txt bck.abc_7565.txt bck.abc_7676.txt... (1 Reply)
Discussion started by: Little
1 Replies

10. Shell Programming and Scripting

Curl command to download multiple files with a file prefix

I am using the below curl command to download a single file from client server and it is working as expected curl --ftp-ssl -k -u ${USER}:${PASSWD} ftp://${HOST}:${PORT}/path/to/${FILE} --output ${DEST}/${FILE} let say the client has 3 files hellofile.101, hellofile.102, hellofile.103 and I... (3 Replies)
Discussion started by: r@v!7*7@
3 Replies
FS_QUOTA(1)						       AFS Command Reference						       FS_QUOTA(1)

NAME
       fs_quota - Displays the quota used in the volume containing a directory or file

SYNOPSIS
       fs quota [-path <dir/file path>+] [-help]

       fs q [-p <dir/file path>+] [-h]

DESCRIPTION
       The fs quota command displays the percent of quota consumed in the volume that contains each specified directory or file.

       To display more detailed information about the volume and the partition it resides on, use the fs examine and fs listquota commands.

       To set volume quota, use the fs setquota or fs setvol command.

CAUTIONS
       Currently, the maximum size of a volume is 2 terabytes (2^31 bytes).

OPTIONS
       -path <dir/file path>
	   Names each file or directory for which to display the quota consumed in its parent volume. Partial pathnames are interpreted relative
	   to the current working directory, which is also the default value if this argument is omitted.

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

OUTPUT
       The output reports the percent of volume quota used, in the following format:

	  <percent>% of quota used.

EXAMPLES
       The following command lists the percent quota used of the volume housing the current working directory:

	  % fs quota
	  17% of quota used.

       The following command lists the percent quota used of both the volume housing the current working directory's parent directory and the
       volume housing the directory /afs/abc.com/usr/smith:

	  % fs quota -path .. /afs/abc.com/usr/smith
	  43% of quota used.
	  92% of quota used.

PRIVILEGE REQUIRED
       The issuer must have the "r" (read) permission on the ACL of the root directory of the volume that houses the file or directory named by
       the -path argument, and "l" (list) permission on the ACL of each directory that precedes it in the pathname.

SEE ALSO
       fs_examine(1), fs_listquota(1), fs_setquota(1), fs_setvol(1)

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							       FS_QUOTA(1)
All times are GMT -4. The time now is 05:12 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy