Screen scrollback

设置screen支持长scrollback In ~/.screenrc add or set defscrollback 50000 use 50000 or any number you want In your screen, checking by ctrl + a + i, it will show your current scrollback settings To enter scrollback/copy mode, using ctrl + a + [ Use ctrl + u, ctrl + d, ctrl + f and ctrl + b for happy scolling Et voila!!

February 1, 2016 · 1 min · mousepotato

Bash pattern match

1. 起因:Shell 获取文件名和后缀名 [_posts] ==>> file="A-Tale-Of-Two-Cities.pdf" [_posts] ==>> echo "${file%.*}" A-Tale-Of-Two-Cities [_posts] ==>> echo "${file##*.}" pdf 2. 基于 Pattern Matching 的子串替换 ${str/$old/$new} 替换第一个。 ${str//$old/$new} 替换所有。 注意:不能使用正则表达式,只能使用 ?* 的Shell扩展。只能用shell通配符如 *? [list] [!list] [a-z]。 ...

January 1, 2016 · 1 min · mousepotato

Screen 使用之无废话5行命令

Linux screen in 5 command lines 1. 建立一个 screen shell 窗口 screen 2. 退出刚建立的窗口 ctrl+ a d 3. 查看已有 screen 窗口 screen -ls 4. 重新进入已有 screen 窗口 screen -r sessionid sessionid can be found by looking screen -ls 5. 退出已有 screen 窗口 exit 6. 退出全部 detached sessions screen -ls | grep Detached | cut -d. -f1 | awk '{print $1}' | xargs kill That’s it!!!

November 25, 2013 · 1 min · mousepotato

Linux 下的查看系统内存信息

Linux查看系统内存信息可以有如下方法: free free -m cat /proc/meminfo 如果要查询详细到RAM规格,DDR2,DDR3可以使用: sudo lshw

June 14, 2013 · 1 min · mousepotato

Linux 下的几个文件

Linux 下的几个文件 Unix或者类 Unix系统/dev下有几个很特殊的文件.他们就是: 1: /dev/null 这个/dev下放的是系统和用户的设备文件. null是个文件名. 被称为 the null device, /dev/null 这个童鞋脾气有点大,听不见别人任何话,所以呢任何话传到他耳朵里都被当成耳旁风了.当然更可恨的是他竟然还假惺惺的点头说听到了.当然他是很诚实地说的. ...

June 13, 2013 · 2 min · mousepotato

How to use wget to donwload the whole web folder

如何使用wget下载整个网站的文件夹 How to use wget to donwload the whole web folder 使用如下命令: wget -r -p -E -k -nH -np --cut-dirs=1 -P ~/Downloads/ http://99.198.110.38/Chinese/MP3s/13%E6%97%A7%E7%BA%A6%E8%AE%B2%E9%81%93/ That’s it!!

May 20, 2013 · 1 min · mousepotato

How to download a whole website using wget with chinese character support

如何使用wget下载整个网站同时支持中文命名 wget 下载整个网站 使用命令: wget -r -p -E -k -nH -np --cut-dirs=1 -P /path/to/save/ Website URL 支持中文 vi ~/.wgetrc 添加如下内容: --restrict-file-names=nocontrol --trust-server-names=on --content-disposition=on That’s it!!

April 28, 2013 · 1 min · mousepotato