Find the answer to your Linux question:
Results 1 to 3 of 3
Hi guys, I need to substitute some words in a file i.e 'Gnome' to 'KDE'.I know this can be done from the shell but unfortunately do not know what commands ...
  1. #1
    Just Joined!
    Join Date
    Jun 2007
    Posts
    2

    Text processing from shell

    Hi guys,

    I need to substitute some words in a file i.e 'Gnome' to 'KDE'.I know this can be done from the shell but unfortunately do not know what commands to use.Could someone please point me in the right direction.

    Any additional information and links would be much appreciated.

    Thanks

  2. #2
    Linux Guru anomie's Avatar
    Join Date
    Mar 2005
    Location
    Texas
    Posts
    1,692
    Google for sed tutorials.

    Code:
    [helen@troy ~]$ cat test-file 
    Something something Gnome
    This Gnome is something Gnome
    Gnome Gnome
    
    [helen@troy ~]$ sed 's/Gnome/KDE/g' test-file 
    Something something KDE
    This KDE is something KDE
    KDE KDE

  3. #3
    Just Joined!
    Join Date
    Jun 2007
    Posts
    2
    Thanks.That's exactly what I needed!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...