Tag: sed

  • Recursively copy and rename files with find and sed

    Script to recursively copy and rename files with find and sed
     

    find aber/cs25010/ -iname "*.txt" -printf 'cp %p %p\n' \
    | sed 's/\.txt$/\.php/' \
    | while read l; do eval $l; done

  • Get ip the geek way

    If typing ifconfig is too simple for you here it is the geeky way to get the ip of your interfaces.

    ifconfig | sed -n "/en0//netmask/ p" | grep "inet " | awk '{print$2}' copy to .bash_profile:
    alias getip='ifconfig | sed -n "/en0//netmask/ p" | grep "inet " | awk ''{print\$2}'''