LINUX.IE, website of the Irish Linux Users' Group
Tux rules!

   
Home
New Users
Articles
Download
Projects
Community
Vendors

  Print Version
Email to...
 
Archives:


planetILUG

Recent News

News Archive


Join the
ILUG
on FaceBook


Join the
ILUG
on LinkedIn


Join the
ILUG SETI
Group



















 
 :: Mailing Lists

[ILUG] text tip

[ILUG] text tip

P at draigBrady.com P at draigBrady.com
Mon May 24 11:33:09 IST 2004


kevin wrote:
> I am looking for a quick script to alter a load of .php files in a directory 
> and its subdirectories. I just want to swap one line in each file with a new 
> line. Anyone help?

find /dir -name "*.php" |
while read filename; do
     sed 's/old line/new line/' >newfile.$$ <$filename && mv 
newfile.$$ $filename
done

-- 
Pádraig Brady - http://www.pixelbeat.org
--- Following generated by rotagator ---

New Linux networking commands

ifconfig, route, mii-tool etc. are out of date
The new kids on the block are ip and ethtool.

ip link show                          #list interfaces
ethtool interface                     #list interface status
ip link set dev eth0 name home        #rename eth0 to home
ip addr add 1.2.3.4/24 brd + dev eth0 #add ip and mask(255.255.255.0)
ip link set dev interface up          #bring interface up (or down)
ip route add default via 1.2.3.254    #set default route to 1.2.3.254
--



More information about the ILUG mailing list
Read this without the formatting.
                                                                                                    

 

Hosted by HEAnet


Maintained by the ILUG website team. The aim of Linux.ie is to support and help commercial and private users of Linux in Ireland. You can display ILUG news in your own webpages, read backend information to find out how. Networking services kindly provided by HEAnet, server kindly donated by Dell. Linux is a trademark of Linus Torvalds, used with permission. No penguins were harmed in the production or maintenance of this highly praised website. Looking for the Indian Linux Users' Group? Try here. If you've read all this and aren't a lawyer: you should be!
RSS Version
Powered by Dell