Sponsored Content
Top Forums Shell Programming and Scripting [Solved] remove file extension Post 302706075 by Lem on Wednesday 26th of September 2012 04:42:55 AM
Old 09-26-2012
Don't you have rename on your system?
Code:
rename 's/\.REMOVE$//' *.REMOVE

--
Bye
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

remove file extension

Hi ALL, I'm new to this forum. Thanks and congrats to all for their great efforts building this site simply superb for all unix administrators. My requirement is to remove extensions of the files in the current directory. I'm doing it using below script which is working but i think it is... (12 Replies)
Discussion started by: prvnrk
12 Replies

2. UNIX for Dummies Questions & Answers

[Solved] Rename file name / remove part of name

I have a whole file structure with jpeg files where I want to remove a part of the file name. An application added in many files a case conflict in the naming "xyz 017.jpg (Case Conflict 1)" So, can someone help me how to get rid of the " (Case Conflict 1)"? What I have is this: find . -name... (2 Replies)
Discussion started by: borobudur
2 Replies

3. Shell Programming and Scripting

[Solved] Giving files .txt extension

Hi there, I have around 145,000 files with no file extension in this directory - /home/adams/29: The file name varies but all end with a number from 0 - 9, e.g. TTFILE_BAT_235496, CCNHATA_RFC_23455 I want to give all these 145,000 .txt extension. Please how do I do that? Thanks (2 Replies)
Discussion started by: Creems
2 Replies

4. UNIX for Dummies Questions & Answers

[Solved] Help to remove a line from a file

Hi, I just upgraded one my server to latest version RHEL, I have many users who will do SSH from another server. I wanted to update all of the users home directory and remove the security key. For example. /home/XYZ/.ssh/known_hosts and remove this hostsname. Please see below and advise.... (2 Replies)
Discussion started by: samnyc
2 Replies

5. Shell Programming and Scripting

[Solved] Remove file older than 90 days

I have crontab job a tar file to a directory ( tar -cvf /tmp/backup/or.`date +%m%d%y`. /ora/db/* ) , it will do it every day . Now I don't want to keep too much files , I just want to keep the file for 90 days , can advise if I want to remove the backup file which are elder than 90 days , can... (1 Reply)
Discussion started by: ust3
1 Replies

6. Shell Programming and Scripting

Remove the file except with particular extension

Hi all i am new for the shell scripting can any one help me with my requirments . i want to delete file older than 21 days everything works fine but in that dir i got the files with should not be deleted with particular extension like (.info):confused:here is the script i wrote .can anyone... (5 Replies)
Discussion started by: vikatakavi
5 Replies

7. Shell Programming and Scripting

[Solved] Howto remove extra space in the file

Hi Gurus, I have a file which contains some special char or space. when using cat -evt I can see the file as following: 0,"0000","abc/def aaa ... (6 Replies)
Discussion started by: ken6503
6 Replies

8. Shell Programming and Scripting

[Solved] Replace extension of filename stored in a variable

Hi there, I have a small question (most like a true beginners question :) ). In a script I have a filename stored in variable (vFile). Through the an input parameter this variable gets its value (for instance cookie.txt). Two new variables are created with the value of vFile, but with a... (2 Replies)
Discussion started by: rberkers
2 Replies

9. Shell Programming and Scripting

Remove the last 15 characters of a filename with respect to leave file extension

how can i remove numbers of characters from the last name of file with respect to not remove the files extension example VFX_Official_Trailer_(HD)__Shhh__-_by_Freddy_Chavez_Olmos_&_Shervin_Shoghian-.mp4 i want to rename this to VFX-Official-Trailer-(HD)-Shhh... (13 Replies)
Discussion started by: ateya
13 Replies

10. UNIX for Beginners Questions & Answers

Bash to remove find and remove specific extension

The bash below executes and does find all the .bam files in each R_2019 folder. However set -x shows that the .bam extension only gets removed from one .bam file in each folder (appears to be the last in each). Why is it not removing the extension from each (this is $SAMPLE)? Thank you :). set... (4 Replies)
Discussion started by: cmccabe
4 Replies
REMOVE(3)								GNU								 REMOVE(3)

NAME
remove - delete a name and possibly the file it refers to SYNOPSIS
#include <stdio.h> int remove(const char *pathname); DESCRIPTION
remove deletes a name from the filesystem. It calls unlink for files, and rmdir for directories. If the removed name was the last link to a file and no processes have the file open the file is deleted and the space it was using is made available for reuse. If the name was the last link to a file but any processes still have the file open the file will remain in existence until the last file descriptor referring to it is closed. If the name referred to a symbolic link the link is removed. If the name referred to a socket, fifo or device the name for it is removed but processes which have the object open may continue to use it. RETURN VALUE
On success, zero is returned. On error, -1 is returned, and errno is set appropriately. ERRORS
EFAULT pathname points outside your accessible address space. EACCES Write access to the directory containing pathname is not allowed for the process's effective uid, or one of the directories in path- name did not allow search (execute) permission. EPERM The directory containing pathname has the sticky-bit (S_ISVTX) set and the process's effective uid is neither the uid of the file to be deleted nor that of the directory containing it. ENAMETOOLONG pathname was too long. ENOENT A directory component in pathname does not exist or is a dangling symbolic link. ENOTDIR A component used as a directory in pathname is not, in fact, a directory. ENOMEM Insufficient kernel memory was available. EROFS pathname refers to a file on a read-only filesystem. CONFORMING TO
ANSI C, SVID, AT&T, POSIX, X/OPEN, BSD 4.3 BUGS
Infelicities in the protocol underlying NFS can cause the unexpected disappearance of files which are still being used. NOTE
Under libc4 and libc5, remove was an alias for unlink (and hence would not remove directories). SEE ALSO
unlink(2), rename(2), open(2), rmdir(2), mknod(2), mkfifo(3), link(2), rm(1), unlink(8) Linux 1994-07-13 REMOVE(3)
All times are GMT -4. The time now is 09:23 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy