文章分类 -  Shell

bash&tcsh
时间与时间戳
摘要:日期转换时间戳: 打印当前时间戳: date +%s时间戳转换:date -d '06/29/2020 09:54:22' +"%s" 时间戳转换日期: date -d @1593395662 阅读全文

posted @ 2020-06-29 09:58 Copernicus 阅读(49) 评论(0) 推荐(0)

随机数生成
摘要:shell: cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 27 | head -n 1 python: python -c "import random,string; print(''.join(random.sample(string.asci 阅读全文

posted @ 2020-05-06 12:09 Copernicus 阅读(52) 评论(0) 推荐(0)

wget & curl
摘要:下载并解压文件: 阅读全文

posted @ 2019-12-18 15:23 Copernicus 阅读(45) 评论(0) 推荐(0)

elasticsearch进入red状态,修复方法
摘要:#!/bin/bash for index in $(curl -s 'http://192.168.0.234:9200/_cat/shards' | grep UNASSIGNED | awk '{print $1}' | sort | uniq); do for shard in $(curl -s 'http://192.168.0.234:9200/_cat/shards... 阅读全文

posted @ 2018-12-18 18:04 Copernicus 阅读(2610) 评论(0) 推荐(0)

shell_mark
摘要:#shell history hide export HISTCONTROL = ignorespaceexport HISTSIZE=0history -cw set +o historyset -o historyhistory -d [num] 阅读全文

posted @ 2016-07-25 15:15 Copernicus 阅读(77) 评论(0) 推荐(0)

导航