Activity Stream
48,167 MEMBERS
6716 ONLINE
besthostingforums On YouTube Subscribe to our Newsletter besthostingforums On Twitter besthostingforums On Facebook besthostingforums On facebook groups

Results 1 to 3 of 3
  1.     
    #1
    Member

    Default Debian - command line. Replace () in filenames with _

    Hi,

    I've got a set of directories like this:
    files\
    files\a
    files\b
    etc...
    files\z
    files\0

    In these directories there might be files with the following characters: ()
    I need those characters replaced by underscores: _

    Someone gave me the following command:
    Code: 
    find ./ -type f -exec sed -i 's/\(\)/_/' {} \;
    But this only seems to do a search and not actually replace the filenames.
    Would anyone be able to give me the proper command?
    I suck at regex..
    AndroidApps Reviewed by AndroidApps on . Debian - command line. Replace () in filenames with _ Hi, I've got a set of directories like this: files\ files\a files\b etc... files\z files\0 Rating: 5

  2.   Sponsored Links

  3.     
    #2
    Respected Member
    Try this:

    find ./ -type f -exec sed -i 's/\(\)/_/g' {} \;

  4.     
    #3
    Member
    Quote Originally Posted by Lock Down View Post
    Try this:
    Thanks.
    Unfortunately this did not rename any files.

    Code: 
    $ find ./ -type f -exec sed -i 's/\(\)/_/g' {} \; 
    $ 
    $ ls
    $ file (1.2.9).zip
    Any more ideas?

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Firefox 16, new Command Line toolbar
    By Djlatino in forum General Discussion
    Replies: 0
    Last Post: 11th Oct 2012, 08:04 AM
  2. rapidgator download from command line
    By Mutikasa in forum Web Development Area
    Replies: 0
    Last Post: 8th Apr 2012, 11:01 AM
  3. How to add multiple IPs with a Command line to windows server
    By Novaroot in forum Tutorials and Guides
    Replies: 0
    Last Post: 3rd Mar 2012, 04:05 AM
  4. how to download from filesonic on command line
    By masnadiero in forum Technical Help Desk Support
    Replies: 3
    Last Post: 28th Aug 2011, 11:56 PM
  5. replace a specific line in a php file
    By techdaemon in forum Web Development Area
    Replies: 10
    Last Post: 27th Sep 2010, 04:49 PM

Tags for this Thread

BE SOCIAL