General :: Rename A File By Replacing Specific Letters In The File?

May 11, 2010

I used a script that renamed my file eg 'echo webutil.olb | tr [A-Z] [a-z]' i wanted to rename it back to webutil.olb. How do i do this for many other files that i have

View 3 Replies


ADVERTISEMENT

CentOS 5 :: Command To Find And Remove Specific Letters From A File?

Nov 4, 2009

I have a file with tens of thousands of lines. I need to remove specific letters eg eggs, from every line that has the letters in it. Is there a command which can help me do that easily?

View 4 Replies View Related

General :: Replacing A String In A File With The Contents Of Another File?

Jun 15, 2010

I would like to know how I can replace a string in one file with the complete contents of another life.

View 10 Replies View Related

General :: Find Folders With ONLY One Specific File In And Delete File And Folde

Oct 21, 2009

Many folders within a subdirectory some of which have lots of data in and some of which have only one specific file called produkt.fil inside.I need a command to find and delete those folders that contain ONLY the file produkt.fil - if other files exist (doesnt matter what they are) then they should be left alone. Note: produkt.fil exists in all of the folders always.

View 5 Replies View Related

General :: Replacing Text In A File?

Jul 26, 2010

how to replace following text in the file name.cfg ?I need to replace

name:=inet.hr=>1|inet.hr=>1
with
name:=none
I am using
sed -i 's/name:=inet.hr=>1|inet.hr=>1/name:=none/g' name.cfg

View 4 Replies View Related

Ubuntu :: Rename A File Then The Entire File Is Selected And Not Only The First Part?

Feb 13, 2011

I'm using Ubuntu for about a half year. Currently version 10.10. The next problem I have with Nautilus: He have it in ListView. If I want to rename a file then the entire file is selected and not only the first part. So the file extension is also selected. I think this is a bug, whoich can be found on the Internet, but I do not find a solution. Does anyone here have a solution?

View 4 Replies View Related

General :: Replacing The Text In Same File Using SED Command?

Oct 11, 2010

I have a String like "A.words=Ajay,Anil" in file A.And it contains a lot of other information also. I wanted to replace "Ajay,Anil" with "Vijay,Vinay" with sed command with using existing file only(not using another file)

View 9 Replies View Related

General :: Rename A File Say Old.txt To New.txt Using Commands?

May 19, 2010

How would I rename a file say old.txt to new.txt in Linux using commands?

would it be...?

rename old.txt new.txt

View 2 Replies View Related

General :: Automatically Rename A File In Samba?

Apr 15, 2011

Is there any method to automatically renaming a file when it is automatically put in a shared file in samba on debian ?

View 1 Replies View Related

General :: Replacing Word Occurrence With An Increasing Number In A File Using Bash?

Aug 2, 2010

I have a file in the form below, and wish to replace each start line with an increasing number. So instead of:

Code:
start
content content
start
content content
start

[Code]....

After several searches and a bit of messing around, it's clear I'm missing something, so was wondering if anyone could offer any insight?

View 17 Replies View Related

General :: Bulk File Rename Not Working As Expected?

Jun 25, 2011

Y want to rename a bunch of files and directories to remove the space on the names, easy enough right?

Code:
for source in $(find ./); do target=$(echo "$source"|sed -e 's/ /_/g'); mv -f "$source" $target; done

Well, I thought that should have work but the problem is that $source comes up broken, when I run it with echo instead of mv I get the echo with broken names.

Code:
In this case "$source"="This is the file I want to rename"
$ echo "$source"

[Code]....

View 3 Replies View Related

General :: Traverse The File System And Rename (xargs Or Sed)?

May 15, 2011

I need your inputs on performing some operations:-

a. Traverse from top Level directory, find all the directories

b. Rename all these directories to <original name>.dir

c. Once the renaming is done - search from top level and retain only those directories which has .txt content in them.

d. Delete rest all.....

Can i use xargs here to perform operation a and b , or will sed will be useful.

View 14 Replies View Related

General :: Sed - Replacing Only Text With Several Specific Lines Excluded

Jun 17, 2010

As much as I didn't want to ask a sed question, especially considering there's already one on this page I've looked as best I could and cant find the solution. Id like to use sed to replace occurrences of a pattern but exclude two or 3 specific lines that are not consecutive. For example I know with 1,10 i could exclude the first 10 lines, what is the syntax if I just wanted to exclude line 3 and 7. The sed command I'm working with right now is for rearranging Ethernets.

cat /etc/udev/rules.d/70-persistent-net.rules | sed -e '/'"$found1fullmac"'/!s/eth1/'"found1eth"'/' > /etc/udev/rules.d/70-persistent-net.rules

I would like to replace $found1fullmac with two variables representing line numbers to exclude from the replacement.

View 6 Replies View Related

General :: Rename Multiple File By Moving Part Of The Name To End Of Extension?

Aug 26, 2009

How do you rename:

abc123.txt
abc124.txt
abc125.txt

to

abc.txt.123
abc.txt.124
abc.txt.125

Basically, I want to move the digits from the filename to after the extension.

It works for one file if I type:
rename 123.txt .txt.123 abc.txt.123

but I have thousands of files like these.

View 1 Replies View Related

General :: How To Rename All Subfolders With Specific Name

Jun 11, 2010

How to go through all the subfolders and rename all the folders named 'Old' to 'New'

View 2 Replies View Related

General :: Copy A File And Rename It At The Same Time While Copying It To The Same Exact Directory?

Jun 26, 2010

Create a copy of the file above and call it commands.sorted. Use the vi command to manually sort this file. I.e. use yy to copy a line, P or p to paste a line, and dd delete a line. Order the commands with the two lines starting with double quotes first. Then list the rest of the command in alphabetical order.

Anyone have any ideas what he's talking about? Can I copy a file and rename it at the same time while copying it to the same exact directory again? Now sure what the two lines things means either. I have an email out to him but it usually takes a long time for him to answer me. I got alot of work to do so everytime I get hung up it kills me.

View 2 Replies View Related

Software :: Check The Contents Of A Text File For A Specific String And Remove It From The File From The Command Prompt?

Oct 14, 2010

I want to be able to check the contents of a text file for a specific string and remove it from the file from the command prompt. I would basically be searching through a number of files and if a specific string is found I would like it removed automatically. pretty much a find and replace, were the replace is nothing. any one got any ideas on how you would do this. I already have the search part sorted just need to be able to remove the string I don't want from the multiple files.

View 4 Replies View Related

Ubuntu :: Specify A Color Of Letters In The File Name?

Jul 24, 2010

Is there any way to specify a color of letters in the file name?For example "my filename 001.txt".Is it possible in Nautilus?

View 1 Replies View Related

Software :: Get First File Of Directory Then Copy To Other Directory Andd Rename The File?

Jan 30, 2011

I want to do the following.

1. have a directory full of subdirectory

2. Pick the first file from every sub and copy that to the main directory and also rename that file to the same name as the subdirectory's name

3. need to work in commandline best is a simple script.

View 4 Replies View Related

General :: RPM - Writing Script In Specific File

Apr 11, 2011

Is it possible to write ksh script in the spec file? The target is after I perform
rpm -i my_rpm.rpm
According to the spec file, ksh script will do some installation & configuration. For example run other script and edit some files.

View 1 Replies View Related

General :: Write File To A Specific Sector?

Jun 28, 2010

I need to copy a file into a Flash memory which is connected to my computer via USB. The file must start at a specific sector.
Can anyone guide me how to do this? (it can be through a C program, a line command, or any other way)

View 8 Replies View Related

General :: File Permission To Specific User?

Jan 13, 2011

i have created a file (by root user) called test.txt. Then i created a user bob. Now i want only bob to read/write/execute this file and no other user shall have any permission on it.

View 3 Replies View Related

General :: Specific File Name Renaming In All Sub Directories?

Apr 4, 2011

I have a dir (pub_html) with 45 sub dirsand in each there is a file with name file123.html) what command can I use to rename all files with this name in all sub dirs to file456.html ? I'm on opensuse 11.3

View 14 Replies View Related

General :: Searching And Replacing Strings In File With Strings In Other Files

Jul 29, 2010

I want to search and replace strings in a file with strings in other files/i need to do it with big strings(string1 is big) and i want to use a txt file for this.But this code not working :

View 14 Replies View Related

General :: Can Get Version Number Of Tar Used To Create Specific Tar File?

May 19, 2010

I need to know the version number of tar used to create a specific tar file. How can I do that?

View 1 Replies View Related

General :: Showing The Line Count Of A Specific File

Mar 30, 2011

Is this the correct way to show the line count of a specific file?

cat file | grep * -c

View 3 Replies View Related

General :: Recursively Find A .doc File That Contains A Specific Word?

Aug 31, 2011

I'm using bash under Ubuntu.Currently this works well for the current directory:catdoc *.doc | grep "specificword" But I have lots of subdirectories with .doc files.How can I search for, let's say, "specificword" recursively?

View 2 Replies View Related

General :: Command For Finding Specific File Types?

Oct 15, 2009

If there is a command I can use to find specific file types? Say if I want to find all the jpg's in my home folder, but they don't have the .jpg extension in the name, how would I do it? Or can I set some kind of size parameter to find them? The ones I want are all from my digicam and roughly the same size.

View 7 Replies View Related

General :: Cannot Find Specific Glibc Tar File For Editing?

Feb 3, 2011

I have the tar file of glibc-2.12.1, but now I want to edit the SPEC file. I can't find it. For those that want a "why", I'm trying to make it smaller. So simply, where is the SPEC file for glibc? (rpmbuild cannot find it in the *.tar.gz file).

View 4 Replies View Related

General :: How To Find A File With Specific String Inside It

May 7, 2010

Is there any way i can find a file with specific word inside it.For example if i want to find a file which has some text written inside it.How would i form a command to search them?

View 5 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved