LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Red Hat
User Name
Password
Red Hat This forum is for the discussion of Red Hat Linux.

Notices



Reply
 
Search this Thread
Old 08-28-2009, 10:30 AM   #1
vikibd007
LQ Newbie
 
Registered: Aug 2008
Posts: 4

Rep: Reputation: 0
File contains replace command?


i want to replace one files total text contains with another files text contains from my fedora console.

for example:
Two files:-

/newresolv.conf
&
/etc/resolv.conf

i want replace to the total text contains of "resolv.conf" file with the "newresolv.conf" file's inside total text contains but "resolv.conf" file's name can't be change...only the inside text contains have to replace.


can any1 give me the command?

Last edited by vikibd007; 08-28-2009 at 10:51 AM.
 
Old 08-28-2009, 10:38 AM   #2
centosboy
Senior Member
 
Registered: May 2009
Location: london
Distribution: centos5
Posts: 1,137

Rep: Reputation: 116Reputation: 116
Quote:
Originally Posted by vikibd007 View Post
i want to replace one files total text contains with another files text contains from my fedora console.

can any1 give me the command?
could you please clarify the question? perhaps giving an example.
 
Old 08-28-2009, 03:42 PM   #3
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Servers: Debian Squeeze and Wheezy. Desktop: Slackware64 14.0. Netbook: Slackware 13.37
Posts: 8,563
Blog Entries: 29

Rep: Reputation: 1179Reputation: 1179Reputation: 1179Reputation: 1179Reputation: 1179Reputation: 1179Reputation: 1179Reputation: 1179Reputation: 1179
Code:
cat /newresolv.conf > /etc/resolv.conf
 
Old 08-28-2009, 03:55 PM   #4
forrestt
Senior Member
 
Registered: Mar 2004
Location: Cary, NC, USA
Distribution: Fedora, Kubuntu, RedHat, CentOS, SuSe
Posts: 1,288

Rep: Reputation: 99
Even easier:
Code:
cp newresolv.conf /etc/resolv.conf
 
  


Reply

Tags
console


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Command Line File Replace MissingLink Linux - Newbie 3 02-06-2009 03:47 AM
Linux command to find and replace string within text file chips11 Linux - Newbie 5 11-24-2008 03:25 PM
command to replace a few entries on a file bostonthunder777 Linux - Server 4 10-18-2007 11:21 AM
Need command to search and replace text in file acascianelli AIX 12 04-11-2007 09:16 PM
help! Script or command needed to replace text in a file. farmerjoe Linux - Newbie 2 01-02-2005 04:07 PM


All times are GMT -5. The time now is 08:16 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration