Sponsored Content
Operating Systems Linux Red Hat How to rename files to files with mv extension? Post 302773391 by Yoda on Wednesday 27th of February 2013 08:53:26 PM
Old 02-27-2013
Quote:
Originally Posted by jediwannabe
[oracle@svk-cent57 mviews]$ mv *.sql *.mv
mv: target `*.mv' is not a directory
That is not gonna work.

Use a for loop with parameter substitution:
Code:
for file in *.sql
do
        mv "$file" "${file%.*}.mv"
done

 

10 More Discussions You Might Find Interesting

1. HP-UX

Files without extension

I am brand new to hp unix systems. I see some files without extension on this system. If I type name of the file it shows me so many detail but does not take me back to command prompt. What are these files and how do I come back to command prompt? Please help (1 Reply)
Discussion started by: rajahindustani
1 Replies

2. Shell Programming and Scripting

rename files Ax based on strings found in files Bx

Hi, I'm not very experienced in shell scripting and that's probably why I came across the following problem: I do have several hundred pairs of text files (PF00x.spl and PF00x.shd) where the first file (PF00x.spl) needs to be renamed according a string that is included in the second file... (12 Replies)
Discussion started by: inCH
12 Replies

3. UNIX for Dummies Questions & Answers

How to list files with no extension together with *.prog files?

Hi, I know that to list files with no extension, we can use.. ls -1 | grep -v "\." And to list .prog files, we can use.. ls -1 *.prog or ls -1 | grep '.prog$' (4 Replies)
Discussion started by: adshocker
4 Replies

4. 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

5. UNIX for Dummies Questions & Answers

Rename multiple files, changing prefix, extension and dropping characters

I'm currently only able to perform some very basic functions, so hope this makes sense... I have a set of about 27 files that need to be renamed from something like this: 000012ABCDEFGHIJ.XXX.YYY.ZZZ 000078KLMNO.XXX.YYY.ZZZ 000099PQ.XXX.YYY.ZZZ to something like this: newa012.abc... (11 Replies)
Discussion started by: bbmcg
11 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. Shell Programming and Scripting

Script to unzip files and Rename the Output-files

Hi all, I have a many folders with zipped files in them. The zipped files are txt files from different folders. The txt files have the same names. If i try to find . -type f -name "*.zip" -exec cp -R {} /myhome/ZIP \; it fails since the ZIP files from different folders have the same names and... (2 Replies)
Discussion started by: pmkenya
2 Replies

8. Shell Programming and Scripting

Python - glob () - How to grep same files with different extension files

Hi I Have a directory and i have some files below abc.txt abc.gif gtee.txt ghod.pid umni.log unmi.tar How can use glob function to grep abc files , i have created a variable "text" and i assigned value as "abc", please suggest me how can we use glob.glob( ) to get the output as below... (2 Replies)
Discussion started by: kumar85shiv
2 Replies

9. UNIX for Dummies Questions & Answers

Display the .csv extension files based on .done extension fine

Hi All, I want to fetch the files based on .done file and display the .csv files and Wil take .csv files for processing. 1.I need to display the .done files from the directory. 2.next i need to search for the .Csv files based on .done file.then move .csv files for the one directory ... (2 Replies)
Discussion started by: girija.g6
2 Replies

10. Shell Programming and Scripting

SBATCH trinity for multiple files and rename/move the output files

Hey guys, I have wrote the following script to apply a module named "trinity" on my files. (it takes two input files and spit a trinity.fasta as output) #!/bin/bash -l #SBATCH -p node #SBATCH -A <projectID> #SBATCH -n 16 #SBATCH -t 7-00:00:00 #SBATCH --mem=128GB #SBATCH --mail-type=ALL... (1 Reply)
Discussion started by: @man
1 Replies
SVK::Command::Info(3)					User Contributed Perl Documentation				     SVK::Command::Info(3)

NAME
SVK::Command::Info - Display information about a file or directory SYNOPSIS
info [PATH | DEPOTPATH]... OPTIONS
-R [--recursive] : descend recursively DESCRIPTION
For example, here's the way to display the info of a checkout path: % svk info ~/dev/svk Checkout Path: /Users/gugod/dev/svk Depot Path: //svk/local Revision: 447 Last Changed Rev.: 447 Last Changed Date: 2006-11-28 Copied From: /svk/trunk, Rev. 434 Merged From: /svk/trunk, Rev. 445 You can see the result has some basic information: the actual depot path, and current revision. Next are advanced information about copy and merge source for this depot path. The result of "svk info //svk/local" is almost the same as above, except for the "Checkout Path:" line is not there, because you are not referring to a checkout path. Note that the revision numbers on "Copied From:" and "Merged From:" lines are for the source path (//svk/trunk), not the target path (//svk/local). The example above state that, //svk/local is copied from the revision 434 of //svk/trunk, and //svk/local was merged from the revision 445 of //svk/trunk. Hence if you do a "svk log -r 434 //svk/local", svk would tell you that //svk/local does not exist at revision 434. So far there is no easy way to tell the actual revision number of //svk/local right after a copy or merge. If the target is a depot path, or the corresponding depot path of the target checkout path is actually a mirroring path, the output of this command will look like this: % svk info //svk/trunk Depot Path: //svk/trunk Revision: 447 Last Changed Rev.: 445 Mirrored From: svn://svn.clkao.org/svk, Rev. 1744 So you can see this depot path is mirrored from a remote repository, and so far mirrored up to revision 1744. perl v5.10.0 2008-08-04 SVK::Command::Info(3)
All times are GMT -4. The time now is 09:27 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy