tput cup 23 45在保存了光标位置后,将光标移动到 (23,45)。 echo "Input from tput/echo at 23/45" 将信息显示到 stdout 中。...tput cnorm 操作文本 更改文本的显示方式可以让用户注意到菜单中的一组词或警惕用户注意某些重要的内容。...要将文本更改为粗体,请使用 bold 选项。要开始添加下划线,请使用 smul 选项。在完成显示带下划线的文本后,请使用 rmul 选项。 其他 (1)重置终端设置。...tput usage: tput [-V] [-S] [-T term] capname ---- 参考文献 tput(1) - Linux manual page - man7.org terminfo...(5) - Linux manual page - man7.org Linux tput 命令详解:通过terminfo数据库对终端会话进行初始化和操作
学习Linux命令,我们需要有一台Linux服务器。有了服务器,就想看看它的性能怎样。翻出自己较早前写的一个脚本,一键查看系统大部分参数。...echo echo "Hostname is $(tput setaf 3)`hostname`$(tput sgr0),\ Ip address is $(tput setaf 3)\ `/sbin...== "x86_64"; then bit=64 else bit=32 fi echo "The $(tput bold)${bit}$(tput sgr0) bit operating...\ system is $(tput bold) `head -n 1 /etc/issue`\ $(tput sgr0), Nuclear info is $(tput setaf 1)\ ${nuclear...echo echo "The disk information is :" echo "`df -h`" 拷贝下来存储在一个bash文件中即可运行,或者一行行的拷贝运行也可以。
下面我将介绍一些工具,帮助你创建强大的,互动的,用户友好的 Unix/Linux shell脚本。我在FreeBSD和Linux下测试过这些工具,不过其他UNIX系列的操作系统应该都支持的。...Backup" # Set bold mode tput bold tput cup 12 15 read -p "Enter your choice [1-4] " choice tput clear...你可以用这个命令在脚本中显示信息,并要求用户输入信息。下面这段代码就是域名的whois查询: #!...Dialog 这个命令可以在shell脚本中显示文本组件。它使用了curses和ncurses类库。示例代码: #!...Bash Socket 编程 你可以在bash中开启一个socket链接,并且传输数据。
harbor部署 在第一篇harbor源码系列中,对整个体系做了拆分..../bin/bash bold=$(tput bold) underline=$(tput sgr 0 1) reset=$(tput sgr0) red=$(tput setaf 1) green=$(...tput setaf 76) white=$(tput setaf 7) tan=$(tput setaf 202) blue=$(tput setaf 25) underline() { printf..."${underline}${bold}%s${reset}\n" "$@" } h1() { printf "\n${underline}${bold}${blue}%s${reset}\n" "$...在下一篇中,将对环境配置脚本prepare进行展开学习
* 要将文本更改为粗体 :bold 选项 * 要开始添加下划线 : smul 选项 * 在完成显示带下划线的文本后 :rmul 选项 $ tput bold;echo "bold";tput smul...setbgcolor="" ;; esac if [ "$bold" = "1" ]; then setbold=$(tput bold;)...Backup" tput bold # Set bold mode tput cup 12 15 read -p "Enter your choice [1-4] " choice tput clear...信号,主要用于在脚本中处理信号是一个shell内建命令,不仅仅处理Linux信号还能对脚本退出(EXIT)、调试(DEBUG)、错误(ERR)、返回(RETURN)等情况指定处理方式,等同于现实世界的红绿灯信号.../bin/bash #Linux中shell信号处理 function trapper() { trap '' INT QUIT TSTP TERM HUP } #Linux中菜单设置 function
shell脚本的颜色集成 set +e set -o noglob # # Set Colors # bold=$(tput bold) underline=$(tput sgr 0 1) reset...=$(tput sgr0) red=$(tput setaf 1) green=$(tput setaf 76) white=$(tput setaf 7) tan=$(tput setaf 202)...blue=$(tput setaf 25) # # Headers and Logging # underline() { printf "${underline}${bold}%s${reset...}${bold}${white}%s${reset}\n" "$@" } debug() { printf "${white}%s${reset}\n" "$@" } info() { printf "...() { printf "${bold}%s${reset}\n" "$@" } note() { printf "\n${underline}${bold}${blue}Note:${reset} $
github https://github.com/pedroqin/clock_by_tput 目的 通过简易时钟的实现,熟悉tput各功能参数 实现 主要实现功能(文末视频演示) 时钟功能(字符画显示...WINCH # 终端前景/背景颜色控制 BG_BLUE="$(tput setab 4)" FG_BLACK="$(tput setaf 0)" FG_WHITE="$(tput setaf 7)"...civis Set to cursor to be invisible cnorm Set the cursor to its normal state 文本样式 Capname Description bold...Start bold text smul Start underlined text rmul End underlined text rev Start reverse video blink Start...man 5 terminfo tput(http://linuxcommand.org/lc3_adv_tput.php)
parameters="" # the file is not in $dir not_dir=0 # show message in green function green_message() { tput...bold echo -ne "\033[32m$@\033[0m" tput sgr0 echo } # show message in red function red_message...() { tput bold echo -ne "\033[31m$@\033[0m" tput sgr0 echo } function isdigit() {...bold echo -ne "\033[32m$@\033[0m" tput sgr0 echo } # show message in red function red_message...() { tput bold echo -ne "\033[31m$@\033[0m" tput sgr0 echo } # print description and
白质(WM)占脑容量的一半以上,并显示出与GM相类似的氧摄取模式,但在任务或静息状态功能磁共振成像研究中,其参与很少报道。在实践中,WM中的平均BOLD波动通常被回归为一个讨厌的协变量。...近年来,越来越多的文献认识到,WM中的BOLD信号的变化可能反映神经活动,并通过适当的方法,与外界刺激相关的BOLD改变可以用常规fMRI可靠地检测出来。...这些发现强调了描述BOLD信号的时间剖面的重要性,这样可以更好地理解WM中的神经血管耦合,并将其适当地纳入分析中。...迄今为止,对WM BOLD反应特征的研究主要集中在任务诱发的BOLD信号上,在该信号中,每个时间过程的开始锁定于已知的事件(或刺激)。...这些发现共同表明,在静息状态下,WM BOLD信号可能有不同的时间进程,反映了不同体素群体中解剖、神经血管和功能耦合的潜在变化。 2.
error_num=`egrep '(error|Failed)' ${install_report} |wc -l` if [ $error_num == "0" ] then tput...bold echo "---------------------------------------------------------------------------------..."----------------------------------------------------------------------------------------" tput...sgr0 else tput bold echo "------------------------------------------------------..."----------------------------------------------------------------------------------------" tput
自打进入技术运维领域,相信很多小伙伴每日都是技术身傍(绑),Linux 、docker、k8s、devops,发布、升级、当然可能还有“删库” 日日996,回家单身狗..别人的黑眼圈可能是多人运动(王者五排...虽然身边鲜有妹子,但是咱们撩妹的技能可不能缺少,毕竟机会总是留给“有准备”的人,作为资深Linux攻城狮,今天就教大家几招技术“撩妹术” asciiview 自从有了你,黑与白的世界也可以五彩缤纷 安装指令如下...The first entry I can # find was posted at 2010-03-21 09:50:09 on Arch Linux Forums (doesn't mean the...: # # Post your handy self made command line utilities (Page 37) / Programming & Scripting / Arch Linux...RANDOM*h/32768:h/2)) done tput smcup tput reset tput civis while !
2.1 sl 先看一下呼啸而过的火车;安装指令如下; sduo apt-get install sl 执行结果如下: 2.2 htop 图形化Linux系统性能监测工具,屌不屌: 安装指令如下: sduo...脚本如下所示: p=1 f=75 s=13 r=2000 t=0 w=$(tput cols) h=$(tput lines) # ab -> idx = a*4 + b # 0: up, 1: right...\n" exit 0;; esac done cleanup() { tput rmcup tput cnorm exit 0 } trap cleanup...RANDOM*h/32768:h/2)) done tput smcup tput reset tput civis while !...reset && tput civis && t=0 || ((t++)) done cleanup 2.10 oneko 养只猫,你们看看,可以追着鼠标跑。
在有些情况,终端显示会混乱无比,比如不小心显示了一个二进制文件或使用 tput 进行了一些不符合预期的终端配置。在你不知道 reset 命令前,你可以将终端强行关闭,然后重新登录。...当然,你也可以使用tput reset命令重新初始化终端。 如果只是想清理屏幕内容,那么 clear 也可以。 注意:reset 其实是 tset 命令的软链。...-q 终端类型显示在标准输出中,并且终端没有以任何方式初始化。选项' -'本身是等效的,但过时了。 -r 打印终端类别到标准错误输出。...比如通过 tput 命令将终端的背景颜色改为黄色,将前景颜色改为红色: tput setb 6; tput setf 4 那么现在使用 reset 便可恢复如初。...reset -V ncurses 5.9.20130511 参考文献 reset(1) - Linux manual page - linux.org Ncurses - Wikipedia
镜像完成后可用于PXE环境或U盘randisk等 安装系统 考虑到实际应用中Ramdisk需要保持小而精,故在安装系统时选择最小化安装,然后再安装所需要的包。...temp/create_os" os_folder="$target_folder/os" # show message in green function green_message() { tput...bold echo -ne "\033[32m$@\033[0m" echo } # show message in red function red_message() {...tput bold echo -ne "\033[31m$@\033[0m" echo } # print description and then run it function print_run
使用 Linux 的过程中,在处理很长的并且包含复杂语法的命令时,如果不小心犯了一点小错误,需要重新输入整个命令以及参数,直到命令执行成功为止。...2967 cksum 2968 man cksum 2969 tput sc 2970 tput setb 6 2971 tput setf 4 2972...man tput 2973 reset 2974 man tput 2975 man terminfo 2976 man apropos 2977 hist 2978...fc -lr -3 (5)反序显示所有历史命令 fc -lr -3 2995 fc -lr -10 2994 fc -lr 2993 fc -ln (6)从历史命令中往前找到...linux.org fc(1p) - Linux manual page - man7.org
linux运维及配置工作中,常常会用到双网卡绑定,少数几台服务器的配置还好,如果是需要配置几十甚至上百台,难免会枯燥乏味,易于出错,我编写了这个双网卡绑定的辅助脚本,可傻瓜式地完成linux双网卡绑定工作...,当然,该脚本主要还是用于小批量的系统配置,如需配置大量的服务器,可提取脚本中的bonding函数,稍作修改即可,你值得一试!...Please select the second NIC:_ 正确输入需要绑定的第二块网卡eth3后,如果linux系统中之前不存在绑定网卡,则默认第一个绑定网卡的名称为bond0,如果系统中存在绑定网卡...因为在modprobe.conf文件中时,修改了mode模式后,重启网络服务可能不生效。...trap "tput clear;tput cup 3;echo 'Any Questions: Send a message to QQ 1037509307.'
not on the prompt force_color_prompt=yes if [ -n "$force_color_prompt" ]; then if [ -x /usr/bin/tput...] && tput setaf 1 >&/dev/null; then # We have color support; assume it's compliant with Ecma-48 #...ZSH_HIGHLIGHT_STYLES[bracket-level-1]=fg=blue,bold ZSH_HIGHLIGHT_STYLES[bracket-level-2]=fg=green,...bold ZSH_HIGHLIGHT_STYLES[bracket-level-3]=fg=magenta,bold ZSH_HIGHLIGHT_STYLES[bracket-level-4]=fg...=yellow,bold ZSH_HIGHLIGHT_STYLES[bracket-level-5]=fg=cyan,bold ZSH_HIGHLIGHT_STYLES[cursor-matchingbracket
为了使别名永久生效,可以将它放在~/.bashrc文件中 echo ‘alias cmd=”commadn seq”’ >> ~/.bashrc (3)删除别名,只需要从~/.bashrc中删除就可以了...1.实例 l 获取终端的行数和列数: tput cols tput lines l 打印当前终端名: tput longname l 将光标移动到坐标(100,100)处: tput cup 100 100...l 设置终端背景色: tputsetb n 其中,n可以在0到7之间取值 l 设置文本样式为粗体 tput bold l 设置下划线的起止: tput smu1 tput rmu1 l 删除从当前光标位置到行尾的所有内容...用tput sc存储光标的位置。在每次循环中,通过恢复之前存储的光标的位置,在终端中打印出新的count的值。恢复光标的命令是tput rc。...在函数fname中,包含了各种访问函数参数的方法。
4.Ctrl+x+e:这个组合键会立即启动,终端中的编辑器。 5.nl: 输出行编号的文本文件的内容。 6.shuf: 把输入行按随机顺序输出到标准输出。 7.ss: 输出套接字统计信息。... command: bash 命令前的空格,不记录在历史中。 13.stat: 显示文件和文件系统的状态信息。 14.. And ....27.look:从字典中检查英文单词,以防混淆,直接从shell中查找。 28.yes: 继续打印一个刺,直到给出中断指令。 29.factor: 给出一个十进制数的所有可能因数。...34.getconf LONG_BIT: 看linux是32位还是64位最简单的方法 35.while sleep 1;do tput sc;tput cup 0 (((tput cols)-29));...date;tput rc;done &:脚本在 shell / 终端的右上角输出日期和时间。
领取专属 10元无门槛券
手把手带您无忧上云