Sponsored Content
Top Forums UNIX for Dummies Questions & Answers How to remove first few characters from multiple file names without do loop? Post 302875491 by Paul Moghadam on Tuesday 19th of November 2013 03:43:29 PM
Old 11-19-2013
How to remove first few characters from multiple file names without do loop?

Hi Fellows,

I was wondering how I can remove first few characters from multiple file names without do loop in unix?

e.g.

Code:
water123.xyz
water456.xyz

to

Code:
123.xyz
456.xyz

Thanks

Paul


Thanks.

Last edited by radoulov; 11-19-2013 at 05:16 PM..
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

remove multiple characters once

i have a variable in a bash shell script called $hostname. $hostname will always be different except it will always start with "-s " that is a - an s and a space. so echo $hostname will look like this: -s somehostname.com how can i get rid of the leading -s ? ive tried tr -d but that gets... (2 Replies)
Discussion started by: norsk hedensk
2 Replies

2. Shell Programming and Scripting

Replace characters in all file names in a particular directory

Hi, I have searched the forum on how to mass replace the file names. We are doing the migration and I am trying to accomplish a task where I have to replace all UNIX scripts in a particular directory that start with bdw to fdm... For example: bdw0110137.sh should be fdm0110137.sh Keep the... (4 Replies)
Discussion started by: madhunk
4 Replies

3. Shell Programming and Scripting

Weird Ascii characters in file names

Hi. I have files in my OS that has weird file names with not-conventional ascii characters. I would like to run them but I can't refer them. I know the ascii # of the problematic characters. I can't change their name since it belongs to a 3rd party program... but I want to run it. is there... (2 Replies)
Discussion started by: yamsin789
2 Replies

4. UNIX for Dummies Questions & Answers

Listing full file names with the exact length of 3 characters

This is what I have to do: Display the full file name (including the full path) and file size of all files whose name (excluding the path) is exactly 3 characters long. This is the code I have: find / -printf "Name: %f Path: %h Size: %s (bytes)\n" 2>/dev/null | grep -E "Name: .{3,} Path" |... (7 Replies)
Discussion started by: Joesgrrrl
7 Replies

5. UNIX for Dummies Questions & Answers

How to remove characters from multiple .txt files

Friends, I want to remove charecters from multiple .txt files. Foe example : In this .txt files there are many "ctrl m" present in last of each line in one .txt file. I want to remove "ctrl m" from each line from all .txt files. Need your help regarding this. (4 Replies)
Discussion started by: meetsubhas
4 Replies

6. Shell Programming and Scripting

Finding File Names Ending In 3 Random Numerical Characters

Hi, I have a series of files (upwards of 500) the filename format is as follows CC10-1234P1999.WGS84.p190 each of this files is in a directory named for the file but excluding the extension. Now the last three numeric characters, in this case 999, can be anything from 001 to 999, I need to... (3 Replies)
Discussion started by: roche.j.mike
3 Replies

7. Tips and Tutorials

How to manage file names with special characters

One of the common questions asked are: how do i remove/move/rename files with special (non-printable) characters in their name? "Special" doesn't always mean the same. As there are more and less special characters, some solutions are presented, ranging from simple to very complicated. Usually a... (0 Replies)
Discussion started by: bakunin
0 Replies

8. UNIX for Dummies Questions & Answers

[solved]removing characters from a mass of file names

I found a closed thread that helped quite a bit. I tried adding the URL, but I can't because I don't have enough points... ? Modifying the syntax to remove ! ~ find . -type f -name '*~\!]*' | while IFS= read -r; do mv -- "$REPLY" "${REPLY//~\!]}"; done These messages are... (2 Replies)
Discussion started by: rabidphilbrick
2 Replies

9. Shell Programming and Scripting

Trying to do multiple dir's and multiple file names etc.

What am I missing? find: 0652-009 There is a missing conjunction find: 0652-009 There is a missing conjunction find: 0652-009 There is a missing conjunction find: 0652-009 There is a missing conjunction find: 0652-009 There is a missing conjunction find: 0652-009 There is a missing... (3 Replies)
Discussion started by: xgringo
3 Replies

10. Shell Programming and Scripting

File names with international characters in not getting recognized in Linux server

Hi, I am using image Magick for resizing the images. Everything is working as long as the file names are in English. But when the file names are in European accented fonts like sólido_sitzbezüge_textil_in_design.jpg stándard_gris_thorium_tallisé.jpg NOIR_MÉTALLISÉ.jpg the program is skipping... (7 Replies)
Discussion started by: Merlin Joseph
7 Replies
remove(3)						     Library Functions Manual							 remove(3)

NAME
remove - Removes a file LIBRARY
Standard C Library (libc.so, libc.a) SYNOPSIS
#include <stdio.h> int remove( const char *path ); STANDARDS
Interfaces documented on this reference page conform to industry standards as follows: remove(): POSIX.1, XPG4, XPG4-UNIX Refer to the standards(5) reference page for more information about industry standards and associated tags. PARAMETERS
Points to the file to be removed. DESCRIPTION
The remove() function causes a file named by the pathname pointed to by path to be no longer accessible by that name. A subsequent attempt to open that file using that name will fail unless it is created anew. If the path parameter names a directory, remove(path) is equivalent to calling the rmdir() function on that directory. If path does not name a directory, remove(path) is equivalent to unlink(path). NOTES
If the file operated upon by the remove() function has multiple hard links, the link count in the file is decremented and only the speci- fied file name is removed. RETURN VALUES
Upon successful completion, the remove() function returns 0 (zero). Otherwise, a nonzero value is returned. Refer to the unlink() function and the rmdir() function for information on return values. ERRORS
Refer to the unlink() function and the rmdir() function for information on error conditions. RELATED INFORMATION
Functions: link(2), rename(2), rmdir(2), unlink(2) Standards: standards(5) delim off remove(3)
All times are GMT -4. The time now is 09:12 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy