Jason Koo

      Stay hungry, Stay foolish!

导航

文章分类 -  Linux

on how to survive in Linux system
摘要:Tar can redirect extracted files to a different folder. This can be handy if you want to unpack a tar archive stored on a cd or other read-only media and want to eliminate the step of first copying the archive, extracting it, then deleting the extra tar. All you have to do is add a ‘-C’ to the tar c 阅读全文

posted @ 2014-04-04 10:00 Jason Koo 阅读(786) 评论(0) 推荐(0)

摘要:Bash dot operator is also known as ‘source’.. filename [arguments]Read and execute commands from thefilenameargument in the current shell context. Iffilenamedoes not contain a slash, thePATHvariable is used to findfilename. When Bash is not inPOSIXmode, the current directory is searched iffilenameis 阅读全文

posted @ 2014-04-03 10:09 Jason Koo 阅读(436) 评论(0) 推荐(0)

摘要:plot 命令的格式:Syntax: plot {[ranges]} {[function] | {"[datafile]" {datafile-modifiers}}} {axes [axes] } { [title-spec] } {with [style] } {, {definitions,} [function] ...}plot 一个数据文件。 例子文件 a.txt 的内容的一部分。1 611738 581056 593414 583590 502984 5538132 661569 5485... 阅读全文

posted @ 2013-12-07 17:11 Jason Koo 阅读(661) 评论(0) 推荐(0)

摘要:This article is copied fromhttp://www.pixelbeat.org/programming/stdio_buffering/I found it difficult to figure out what buffering was applied to the standard streams.Consider for example the following unix shell pipeline:$ command1 | command2Here the shell forks off 2 processes and connects them usi 阅读全文

posted @ 2013-10-30 15:57 Jason Koo 阅读(381) 评论(0) 推荐(0)

摘要:It’s a common problem. You write some shell command like:$ tail -f /var/log/foo | egrep -v 'some|stuff' | sed | awkand wonder why nothing is printed, even though you know some text has matched. The problem is that stdio is being buffered, and there’s a very good write-up of the problemhereso 阅读全文

posted @ 2013-10-30 15:23 Jason Koo 阅读(258) 评论(0) 推荐(0)

摘要:Bash functions, unlike functions in most programming languages do not allow you to return a value to the caller. When a bash function ends its return value is its status: zero for success, non-zero for failure. To return values, you can set a global variable with the result, or use command substitut 阅读全文

posted @ 2013-10-28 23:18 Jason Koo 阅读(233) 评论(0) 推荐(0)

摘要:Here’s an example command:wibble > /dev/null 2>&1Output redirectionThe greater-thans (>) in commands like these redirect the program’s output somewhere. In this case, something is being redirected into/dev/null, and something is being redirected into&1.Standard in, out, and errorThe 阅读全文

posted @ 2013-10-22 17:45 Jason Koo 阅读(167) 评论(0) 推荐(0)

摘要:1.Linux下的CPU利用率计算原理详解http://server.51cto.com/sCollege-188250.htm2. Understanding file systemshttp://www.ufsexplorer.com/und_fs.php 阅读全文

posted @ 2013-10-22 16:16 Jason Koo 阅读(162) 评论(0) 推荐(0)

摘要:最近在搭建一个集群,希望从一台机器上以root身份无密码登录到另一台机器上。比如有两台机器A和B, 希望从A机器上登录到B机器上,登录后是root身份。在A上登录命令形式为:ssh root@B。 所有机器都是Ubuntu 12.04系统,且都安装了openssh-server。而且在每台机器的/etc/ssh/sshd_config文件中PermitRootLogin项均设置为了Yes。当从机器A上输入命令:ssh root@B后,提示输入root@B's password:, 输入相应密码后,提示错误Permission denied, please try again. 从网上搜 阅读全文

posted @ 2013-09-22 10:49 Jason Koo 阅读(2940) 评论(0) 推荐(1)

摘要:最近,在实验中需要一个工具来记录当前系统中每一个进程网络I/O的情况。通过网上搜索,只找到了NetHogs这个工具。在Ubuntu系统下用下面的命令就可以安装NetHogs:sudo apt-get install nethogs运行nethogs需要根用户权限,可以使用下面的命令来运行nethogs:sudo nethogs我们希望使用这个工具来记录某一程序运行期间该程序的网络I/O量。具体来说,我们希望在程序运行期间,每隔一秒中记录一次当前时刻下该程序发送和接收的数据累积量,将记录存放在文件中,留待以后分析。但是NetHogs是一个交互式工具,它使用了ncurses工具包在屏幕上刷新输出结 阅读全文

posted @ 2013-09-21 16:40 Jason Koo 阅读(3349) 评论(0) 推荐(0)

摘要:当使用命令sudo iptables -L -n 查看防火墙配置时,如果出现如下的三个空表:Chain INPUT (policy ACCEPT)target prot opt source destination Chain FORWARD (policy ACCEPT)target prot opt source destination Chain OUTPUT (policy ACCEPT)target prot opt source destina... 阅读全文

posted @ 2013-08-05 20:45 Jason Koo 阅读(317) 评论(0) 推荐(0)

摘要:1. 截图可以在Dash主页中搜索screenshot,然后点击即可截图。2. 使用命令行打开常见的文件,可以使用下面的命令:gnome-open file2open.xxxxdg-open file2open.xxx上面两个命令都可以,其中xxx为相应文件的扩展名。3. 查看当前主机中的IP地址、子网掩码、网关以及DNS服务器可以使用如下命令:nm-tool # network manager tool如果权限不够,加sudo.4. 查看当前防火墙的规则,可以使用如下命令:sudo iptables -L -n5. 查看当前系统中的不同进程及相应进程监听的端口号,使用... 阅读全文

posted @ 2013-06-21 13:39 Jason Koo 阅读(151) 评论(0) 推荐(0)