有時想看該commit改了什麼檔案,又不想秀出該commit的內容。
使用 git show 會秀出 commit 的內容。
git show [commit_id] --name-only
ex
git show 8637187 --name-only
{ "logs" : { "_timestamp" : { "enabled" : true } } }
create index
PUT http://localhost:9200/indextest
PUT http://localhost:9200/indextest/logs/ { "logs" : { "_timestamp" : { "enabled" : true } } }
POST http://localhost:9200/indextest/logs { "name" : "elasticsearch" }
GET http://localhost:9200/indextest/logs/_search?q=*&fields=_timestamp,_source { "took": 2, "timed_out": false, "_shards": { "total": 5, "successful": 5, "failed": 0 }, "hits": { "total": 1, "max_score": 1, "hits": [ { "_index": "indextest", "_type": "logs", "_id": "0AXft-9gTK-DUdfEvUZFiQ", "_score": 1, "_source": { "name": "elasticsearch" }, "fields": { "_timestamp": 1410870337057 } } ] } }
{ "aggs" : { "genders" : { "terms" : { "field" : "gender" } } } }
{ ... "aggregations" : { "genders" : { "buckets" : [ { "key" : "male", "doc_count" : 10 }, { "key" : "female", "doc_count" : 10 }, ] } } }
{ "aggs" : { "products" : { "terms" : { "field" : "product", "size" : 0 } } } }
{ "aggs" : { "author_count" : { "cardinality" : { "field" : "author" } } } }Cardinality Aggregation
"\^\QJ\E". The whole query will look like the following:curl -H "X-Parse-Application-Id: $app_id" \
-H "X-Parse-REST-API-Key: $api_key" \
-G --data-urlencode 'where={"first_name" : { "$regex" : "^\QJ\E" } }' \
https://api.parse.com/1/users/
for i in $(seq -f "%05g" 10 15)
do
echo $i
done
00010
00011
00012
00013
00014
00015
bash has printf as a built-in so you can pad output with zeroes as follows:$ i=99
$ printf "%05d\n" $i
00099
-v flag to store the output in another variable:$ i=99
$ printf -v j "%05d" $i
$ echo $j
00099