Tag Archives: nixCraft

Shell – String replace

Previously we talked about how to submit a Google Form by the curl command.

 

In the url, we have to encode the special characters such as whitespace. In shell script, we could do string replace as follow.

${VariableName//Pattern/Replacement}

Continue reading Shell – String replace

Linux – Limit the bandwidth for rsync

We can use the --bwlimit to limit the bandwidth being used by the rsync command. Here is an example which transfer the local files to a remote server using ssh+rysnc.

rsync --bwlimit=100 -v -e ssh /home/ykyuen/* ykyuen@remote-server:/home/ykyuen/

 

The bandwidth is limited to 100kb/s.

Done =)

Reference: