find . -name "*.[ch]pp" -type f | xargs perl –i.bak –p –e 's/old/new/g;'or non recursive:
perl -pi -w -e 's/search/replace/g;' *.php-e means execute the following line of code.
-i means edit in-place
-w write warnings
-p loop
Software, web, and programming tips: C++, Java, C, Linux, Windows, Cygwin, Firefox, Vim, WWW, RSS
find . -name "*.[ch]pp" -type f | xargs perl –i.bak –p –e 's/old/new/g;'perl -pi -w -e 's/search/replace/g;' *.php-e means execute the following line of code.
-i means edit in-place
-w write warnings
-p loop
| Usage | Effect |
|---|---|
| inside a function | remains even after the function call is long gone |
| modify a global variable | private to a certain file |
| modify a function | making those functions visible only to the file itself |
xorg-x11-f100: Cygwin/X 100 dpi fontsIn your C:\cygwin\usr\X11R6\bin\startxwin.bat, near the bottom of the file, append "-dpi 100" to this line:
%RUN% XWin -multiwindow -clipboard -silent-dup-error
xhost +You can add this to your .bashrc
C:\cygwin\usr\X11R6\bin\startxwin.batin your startup folder (e.g. Start->All Programs->Startup)
%RUN% xterm -e /usr/bin/bash -l
rm -rf dir_name
cscope -Rb.vimrc to" Recursively set the path of the project
set path=$PWD/**
sudo apt-get install build-essentialset expandtaborset et
set shiftwidth=4orset sw=4
set tabstop=4orset ts=4
~/.vimrc:autocmd BufNewFile,BufRead *.java,*.pl,*.c,*.h,*.cc,*.cpp,*.hpp set sw=4 ts=4 et
find . -name <file-pattern> -exec <command> {} \;find . -name *.txt -exec grep -Hn hello {} \;#!/bin/bash
find . -name *.[ch]pp -exec grep -Hn "$1" {} \;