Common Use Shell Commands

 1、ps aux:查看当前所有进程 ,以用户名为主键。可以查看到 USER、PID、COMMAND(binary所有位置)

 2、netstat -an:查看当前所有socket连接。可以查看到 Proto(tcp4/udp4)、LocalAddress&Port、ForeignAddress&Port。

 3、grep -E:使用egrep来解析pattern。支持或运算("|")。

        -v:取反。

      -c:只输出匹配行数。

       -i:不区分大小写。

      -n:显示匹配行号。

      -A n:显示匹配行AfterN行。

      -C n:显示file文件中匹配foo字串那行以及上下N行。

      -B n:显示匹配行BeforeN行

      -R:递归搜索所有子目录。

用法举例:

  $ grep ‘test’ d*
    显示所有以d开头的文件中包含 test的行。
  $ grep ‘test’ aa bb cc
    显示在aa,bb,cc文件中匹配test的行。

  $ grep ‘[a-z]\{5\}’ aa
    显示所有包含每个字符串至少有5个连续小写字符的字符串的行。

 4、ls -d:查看目录属性,而非展示目中文件的属性。

      -h:显示占用硬盘空间大小。

 5、df -h:显示磁盘空间。

 6、cd -:返回上次所在的目录。

 7、tee:把输入copy到stdout和文件。

 8、head、tail -n:输出头/尾n行。

Frequently Used Shell Commands的更多相关文章

  1. Testing shell commands from Python

    如何测试shell命令?最近,我遇到了一些情况,我想运行shell命令进行测试,Python称为万能胶水语言,一些自动化测试都可以完成,目前手头的工作都是用python完成的.但是无法从Python中 ...

  2. Run Shell Commands in Python

    subprocess.call This is the recommended way to run shell commands in Python compared with old-fashio ...

  3. 在R中运行Shell命令脚本(Call shell commands from R)

    aaa.R Args <- commandArgs()cat("Args[1]=",Args[1],"\n")cat("Args[2]=&quo ...

  4. mysql 使用 informatin_schema tables 创建 shell commands

    SELECT CONCAT("mysqldump -uroot -p ", TABLE_SCHEMA, " ", TABLE_NAME, " > ...

  5. Hadoop FS shell commands

    命令格式:hadoop fs -command -option args appendToFileUsage: hadoop fs -appendToFile <localsrc> ... ...

  6. echo shell commands as they are executed

    http://stackoverflow.com/questions/2853803/in-a-shell-script-echo-shell-commands-as-they-are-execute ...

  7. Running shell commands by C++

    #include <iostream> #include <stdio.h> #include <stdlib.h> using namespace std; st ...

  8. run commands in linux shell using batch file

    adb shell as root after device rooted once device rooted, we must perform "su" before we g ...

  9. python与shell的3种交互方式介绍

    [目录] 1.os.system(cmd) 2.os.popen(cmd) 3.利用subprocess模块 4.subprocessor模块进阶 [概述] 考虑这样一个问题,有hello.py脚本, ...

随机推荐

  1. epoll 模型

    body, table{font-family: 微软雅黑; font-size: 10pt} table{border-collapse: collapse; border: solid gray; ...

  2. 苹果iPhone 5C和5S发布后,消费者如何选择?

    9月11日凌晨苹果新品发布会,笔者的朋友圈居然没有看直播的,真果粉太少了.笔者来阐述一些容易忽略的东西. iPhone5C和5S与5有什么不一样? 新品iPhone 5S 外观与iPhone5 相似度 ...

  3. python安装openSSL

    首先确定您是否下载python (3).pip (3).python-wheel 官网下载源码包openSSL 参考:用pip安装python 模块OpenSSL

  4. 【LGR-051】洛谷9月月赛

    [LGR-051]洛谷9月月赛 luogu 签到题 description 给出\(K\)和质数\(m\),求最小的\(N\)使得\(111....1\)(\(N\)个\(1\))\(\equiv k ...

  5. python基于协程的网络库gevent、eventlet

    python网络库也有了基于协程的实现,比较著名的是 gevent.eventlet 它两之间的关系可以参照 Comparing gevent to eventlet, 本文主要简单介绍一下event ...

  6. VMware 11 安装 Mac OS X10.10

    一.下载好以下软件--->http://pan.baidu.com/s/1qWDkTbe 1,VMware 11 2,unlocker203(装好VMware11后需要安装补丁unlocker才 ...

  7. 用ASP.Net(C#)连接Oracle数据库的方法及实例

    今天看了一下asp.net连接oracle数据库的方法,得到了如下代码.这段代码打开了MyTable表,并把操作员的名字列出.字段类型是OracleString.读取的时候用的是字段编号,我不知道怎么 ...

  8. 不以main为入口的函数

    先看一段程序 #include <stdio.h> void test() { printf("Hello Word!\n"); return 0; } 没有main函 ...

  9. Mysql root 用户密码忘记后重置root密码

    [windows] 1.停止mysql服务:打开命令行窗口CMD,Net stop mysql 2.用另外一种方式启动Mysql:在命令行进入到mysql的安装路径下的bin目录下使用 mysqld- ...

  10. 【开源推荐】PredictionIO:构建预测功能的机器学习服务器

    PredictionIO是一款开源的机器学习服务器,开发工程师和数据分析师可以使用它构建智能应用程序,并且还可以做一些预测功能,比如个性化推荐.发现内容等.好比开发者可以使用数据库服务器过滤信息. P ...