2
votes
1answer
317 views

rsync certain files, excluding the rest, ignoring .svn/ directory, recursively

I'm using rsync to copy some files from a share to another. Recursively, I need to: Delete files at destination that were removed from the origin Only sync php and js files Exclude every other file ...
0
votes
2answers
197 views

How to clear contents of all the files using find command

Is there an easy step to clear contents of all ".log" file using find command. Currently i am using "echo -n > filename.log" i have tried echo -n > /var/application-logs/*.log but it is not ...
1
vote
2answers
326 views

Extract repository name from GitHub url in bash

Given ANY GitHub repository url string like: git://github.com/some-user/my-repo.git or git@github.com:some-user/my-repo.git or https://github.com/some-user/my-repo.git What is the best way in ...
2
votes
3answers
700 views

Regular Expression matching in ssh config

I have a bunch of servers with the names srv1.domain.com, srv2.domain.com, ..., srv50.domain.com I want to be able to connect to these servers by ssh srv1 I don't want to put 50 configuration ...
4
votes
2answers
539 views

Shell scripting and regex: Which one is better to match numbers, [[:digit:]] or [0-9]?

As the title suggests, which one is better to match numbers, [[:digit:]] or [0-9]? I'm using the bash shell Thanks :)