Sponsored Content
Full Discussion: Using rename
Top Forums Shell Programming and Scripting Using rename Post 303013382 by kristinu on Tuesday 20th of February 2018 01:56:47 PM
Old 02-20-2018
Using rename

Renaming files using rename on the following files

Code:
rename 's/.99999/.99999.sac.pzs/g' *.99999

Code:
sac_pzs_iv_esml_hhz__2013.074.10.18.23.0000_2599.365.23.59.59.99999
sac_pzs_iv_favr_hhe__2010.187.00.00.00.0000_2599.365.23.59.59.99999
sac_pzs_iv_favr_hhn__2010.187.00.00.00.0000_2599.365.23.59.59.99999
sac_pzs_iv_favr_hhz__2010.187.00.00.00.0000_2599.365.23.59.59.99999
sac_pzs_iv_galf_hhe__2006.300.12.00.00.0000_2599.365.23.59.59.99999
sac_pzs_iv_galf_hhn__2006.300.12.00.00.0000_2599.365.23.59.59.99999
sac_pzs_iv_galf_hhz__2006.300.12.00.00.0000_2599.365.23.59.59.99999
sac_pzs_iv_gib_hhe__2009.273.13.18.00.0000_2599.365.23.59.59.99999
sac_pzs_iv_gib_hhn__2009.273.13.18.00.0000_2599.365.23.59.59.99999
sac_pzs_iv_gib_hhz__2009.273.13.18.00.0000_2599.365.23.59.59.99999
sac_pzs_iv_haga_hhe__2006.111.00.00.00.0000_2599.365.23.59.59.99999
sac_pzs_iv_haga_hhn__2006.111.00.00.00.0000_2599.365.23.59.59.99999
sac_pzs_iv_haga_hhz__2006.111.00.00.00.0000_2599.365.23.59.59.99999
sac_pzs_iv_havl_hhe__2005.131.00.00.00.0000_2017.252.14.20.60.99999
sac_pzs_iv_havl_hhn__2005.131.00.00.00.0000_2017.252.14.20.60.99999
sac_pzs_iv_havl_hhz__2005.131.00.00.00.0000_2017.252.14.20.60.99999
sac_pzs_iv_hlni_hhe__2009.058.16.00.00.0000_2599.365.23.59.59.99999
sac_pzs_iv_hlni_hhn__2009.058.16.00.00.0000_2599.365.23.59.59.99999
sac_pzs_iv_hlni_hhz__2009.058.16.00.00.0000_2599.365.23.59.59.99999
sac_pzs_iv_hmdc_hhe__2005.131.00.00.00.0000_2599.365.23.59.59.99999
sac_pzs_iv_hmdc_hhn__2005.131.00.00.00.0000_2599.365.23.59.59.99999

Problem Solved

Last edited by kristinu; 02-20-2018 at 03:03 PM..
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

rename using mv ?

Hi all how can can remove the underscore from this number in this series _1234567.abc _1234567.abcd I was trying mv _1234567* 1234567 but did not work ? thanks s (2 Replies)
Discussion started by: simon2000
2 Replies

2. UNIX for Dummies Questions & Answers

how can I rename the following=-^

I have a file named -^, I want to look at it, rename, etc. Any help out there?? (5 Replies)
Discussion started by: nj78
5 Replies

3. Shell Programming and Scripting

rename while doing ftp

hi friends, I writing a script to psot dataset to ceratin server.....while doing ftp I have to rename the file while which is in present server like present :test server filename data.097878. ftp server: it sholu be renamed as data.097878.zip thanks, The thing is that while... (1 Reply)
Discussion started by: Nagabhushan
1 Replies

4. UNIX for Dummies Questions & Answers

rename files help

Hi, I've already search for this issue but I found different scripts for rename files, but I don't know how to customize it for my needs. Here's what I want to do: I have a lot of files inside many directories, like this: /aa/01.txt /aa/02.txt /ab/01.txt /ab/02.txt I want all those files... (2 Replies)
Discussion started by: piltrafa
2 Replies

5. Shell Programming and Scripting

rename

hi, im doin an assignment which requires you to build a shell script to do the MS DOS style equivilant (sp?) of the rename function. What i have to do is a loop which checks the following rules and output messages (same): Can't have anything after target Can't have more than one dot Can't... (1 Reply)
Discussion started by: bohoo
1 Replies

6. UNIX for Dummies Questions & Answers

need help with rename

hi guys i am writing a script to change the filename which is enterered as input to lower case letter even if one letter is upper case i have to change it to lower case i get the input and use sed comand should i use like that sed/s/a-z/A-Z/d will it be like that can u please help me (8 Replies)
Discussion started by: farhan_t49
8 Replies

7. Shell Programming and Scripting

Rename files

Hi, I am new to Unix and i have a requirement where i need to write a shell script where i have to loop through various files present in a directory and rename them based on below criteria. Files in the folder are in the following format. _YYYYMMDD.dat] SDL_V1_20100530.dat... (6 Replies)
Discussion started by: bishoo
6 Replies

8. UNIX for Dummies Questions & Answers

Rename a file

how to rename a file if I don't know file location ? Can we below command : $ find / | mv file1.txt I am not sure........can any1 help me out ? Thanks, Tushar Joshi:mad: (1 Reply)
Discussion started by: tusharjoshi
1 Replies

9. Shell Programming and Scripting

How to use function 'rename' ?

hello, all I have following files: file_1 file_2 file_3 ... file_9 Now I want to rename them as: file_001 file_002 file_003 ... file_009 how to use function 'rename' to accomplish this task? (2 Replies)
Discussion started by: littlewenwen
2 Replies

10. UNIX for Dummies Questions & Answers

Using rename

I want to rename files Files show like this 1977SSD_rsdtst.pdf 1976SDP_rstdtsr.pdf 1943FDT_rstdsrt.pdf 1996DFF_stdstrd.pdf I want to introduce _ after the year, and move the characters to the end to get 1977_rsdtst_SSD.pdf 1976_rstdtsr_SDP.pdf 1943_rstdsrt_FDT.pdf... (4 Replies)
Discussion started by: kristinu
4 Replies
pbput(1)							     bikeshed								  pbput(1)

NAME
pbput - compress and encode arbitrary files to pastebin.com pbputs - compress, encrypt, encode arbitrary files to pastebin.com pbget - decode and decompress arbitrary files from pastebin.com SYNOPSIS
pbput [FILENAME] cat foo | pbput pbputs [FILENAME] [GPG_USER] cat foo | pbputs [GPG_USER] pbget URL [DIRECTORY] DESCRIPTION
pbput is a program that can upload text files, binary files or entire directory structures to a pastebin, such as pastebin.com. pbget is a program that be used to retrieve content uploaded to a pastebin by pbput. pbputs operates exactly like pbput, except it encrypts the data. An optional GPG_USER argument is allowed, which will sign and encrypt the data to the target user in one's keyring (which could be oneself!). Otherwise, the user is prompted for a symmetric passphrase for encrypting the content with gpg(1) before uploading. pbget will automatically prompt the receiving user for the pre-shared passphrase. pbput and pbputs can take its input either on STDIN, or as a FILENAME argument. - If STDIN is used, then the receiving user's pbget will simply paste the input on STDOUT. - If a FILENAME or DIRECTORY is passed as an argument, then it is first archived using tar(1) to preserve the file and directory attributes pbget takes a URL as its first, mandatory argument. Optionally, it takes a DIRECTORY as a second parameter. If the incoming data is in fact a file or file structure in a tar(1) archive, then that data will be extracted in the specified DIRECTORY. If no DIRECTORY is speci- fied, then a temporary directory is created using mktemp(1). In any case the uploaded/downloaded data is optionally tar(1) archived, always lzma(1) compressed, optionally gpg(1) encrypted, and always base64(1) encoded. http://pastebin.com is used by default. EXAMPLES
$ pbput /sbin/init http://pastebin.com/BstNzasK $ pbget http://pastebin.com/BstNzasK sbin/init INFO: Output is in [/tmp/pbget.bG67DwY6Zl] $ cat /etc/lsb-release | pbput http://pastebin.com/p43gJv6Z $ pbget http://pastebin.com/p43gJv6Z DISTRIB_ID=Ubuntu DISTRIB_RELEASE=11.04 DISTRIB_CODENAME=natty DISTRIB_DESCRIPTION="Ubuntu 11.04" $ pbputs /etc/shadow Enter passphrase: http://pastebin.com/t2ZaCYr3 $ pbget http://pastebin.com/t2ZaCYr3 Enter passphrase: root:09cc6d2d9d63371a425076e217f77698:15096:0:99999:7::: daemon:*:15089:0:99999:7::: bin:*:15089:0:99999:7::: sys:*:15089:0:99999:7::: .... SEE ALSO
pastebinit(1), lzma(1), base64(1), tar(1), gpg(1), mktemp(1) AUTHOR
This manpage and the utility was written by Dustin Kirkland <kirkland@ubuntu.com> for Ubuntu systems (but may be used by others). Permis- sion is granted to copy, distribute and/or modify this document under the terms of the GNU General Public License, Version 2 or later pub- lished by the Free Software Foundation. On Debian systems, the complete text of the GNU General Public License can be found in /usr/share/common-licenses/GPL, or on the web at http://www.gnu.org/licenses/gpl.txt. bikeshed 6 Oct 2010 pbput(1)
All times are GMT -4. The time now is 09:38 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy