LVOware
PRATTICO Consulting
Sunday May 27, 2012
Home
Search
Advanced Search
Category Search
Affiliates
Acknowledgements
Cool Links
Username
Password
Remember me
Forgot your password
?
Create an account
Who's Online
We have 21 guests online
Newest Member
beyondimagem
Hit Counter
9133558 Visitors
cool Statistics
coolcommands:
1330
Categories:
83
Total queries:
595500
Members:
16437
Category Search coolcommands.com
Select Category:
AIX
AIX Hardware Components
AIX Logical Volume Manager (LVM)
apache
Application
ASM
awk
Backup/Restore
bash
Checkpoint Firewall-1
coolscripts
CPU
DB2
Disk
DST
EMC
Environment
Epoch Time
File
Filesystem
Firmware
FTP
General UNIX
HACMP
Hitachi
HMC
HP/UX
HTTP
IBM
Infoprint Manager
IRIX
Java
Kerberos
Kernel
KSH
Linux
LPAR
Mail
Memory
MySQL
nawk
Network
NFS
NIM
Open Source Tools
Oracle
Performance Testing
Perl
PHP
postfix
Print
Process
Python
RDAC
Relational Databases
robot
RS/6000
Samba
Security
sed
Sendmail
Service Update Management Assistant
Shell
Software Packaging
Solaris
Solaris Volume Manager (SVM)
Solstice Disksuite
SPARC Storage Array (SSA)
SSH
Storage SAN
Sun Cluster
Sybase
TSM
TWS
Veritas Volume Manager (VXVM)
VI
VIO Server
VMware
WebMethods
WebSM
Websphere Application Server (WAS)
Websphere MQ
XWindows
Submitted by: lvo  
coolcommand
how to make a global search and replace in a text file using sed
Description
Here is a quick one-liner to do a global search and replace of some text in a text file using sed:
# sed -e 's/oldstring/newstring/g' filename
Note: Output will go to your screen, so redirect output to a file like so:
# sed -e 's/oldstring/newstring/g' filename > newfile
If you want to do a search and replace of the first occurance of oldstring on each line, remove the /g:
# sed -e 's/oldstring/newstring/' filename
Example
sed -e 's/oldstring/newstring/g' filename
Return to search results
Random coolcommands
coolcommand: pconsole - the parallel console tool, is an interactive administrative shell tool for clusters
Example: pconsole.sh
[show me the details]
coolcommand: How to correct a lppchk error for a base fileset in IBM AIX
Example: installp -F -ac -d. bos.net.nfs.client
[show me the details]
coolcommand: how to find the file where all the filesystem descriptions are in HP/UX
Example: /etc/checklist; /etc/fstab
[show me the details]
coolcommand: restore from backup mkcd of an IBM RS/6000 of type chrp
Example: boot cdrom:\PPC\CHRP\BOOTFILE.EXE
[show me the details]
coolcommands.com - the search engine for UNIX sysadmins :: unix commands and scripts
myPMS
Password
Management
System
by
Top 5 Submitters
lvo
1152
audet
37
kah00na
32
Mariom
24
lebjf000
14
Top 5 Searches
Category Solaris
49379
Category AIX
46267
Category General UNIX
43933
solaris
22927
aix
22116
Terms of Use
Privacy
Contact
coolcommands.com © 2012. All Right Reserved.
Programming by
PRATTICO Consulting
.
Hosting by
Apricusum