Community Forums
Connect with us on LinkedIn
+ Reply to Thread
Results 1 to 2 of 2
  1. #1
    Member
    Join Date
    Apr 2008
    Posts
    12

    Default Find and replace via SSH

    It is possible to find a spesific file in whole server

    PHP Code:
    find / | grep index.html 
    and also it is possible to delete a spesific file in whole server

    PHP Code:
    find / -name index.html -type f -ls -exec rm -{} \; 
    I wonder if it is possible to find a word in source code of all html files in the server.
    For example i want to change a bg color of a site in all html pages.

  2. #2
    Member
    Join Date
    Nov 2001
    Location
    Athens - Greece
    Posts
    98

    Default

    If your are using a recent linux version you can execute the following to search all files recursively under the current directory.
    Code:
    grep -R bgcolor *
    Alternatively you can execute
    Code:
    find / -name \* -exec grep -R {} \;
    ------
    CPanel Tips and Solutions
    http://www.cphelp.gr
    ------

Similar Threads & Tags
Similar threads

  1. How to find out if SSH is enabled?
    By mberchtold in forum cPanel Developers
    Replies: 4
    Last Post: 04-03-2009, 05:43 AM
  2. command to find and replace a word in files directory wide
    By DWHS.net in forum cPanel and WHM Discussions
    Replies: 3
    Last Post: 02-09-2006, 02:40 PM
  3. How do you do a find and replace for all the files in a directory?
    By DWHS.net in forum cPanel and WHM Discussions
    Replies: 6
    Last Post: 04-14-2005, 08:49 PM
  4. Replace image via SSH
    By princeton69 in forum cPanel and WHM Discussions
    Replies: 3
    Last Post: 05-09-2004, 07:56 PM
  5. Where i can find ssh access log
    By xphost in forum cPanel and WHM Discussions
    Replies: 1
    Last Post: 12-02-2003, 05:32 PM
Linkedin       Facebook       Twitter       RSS       Flickr       YouTube