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. Centos7 防火墙常用命令 开启 关闭防火墙

    如果你的系统上没有安装使用命令安装 #yum install firewalld  //安装firewalld 防火墙 开启服务 # systemctl start firewalld.service ...

  2. 关键词提取算法-TextRank

    今天要介绍的TextRank是一种用来做关键词提取的算法,也可以用于提取短语和自动摘要.因为TextRank是基于PageRank的,所以首先简要介绍下PageRank算法. 1.PageRank算法 ...

  3. CF1143C Queen

    CF1143C Queen 开始想大力维护 \(bfs\) 序+数据结构解决,但 \(bfs\) 序的变化不太好推. 换了一个思路,注意到删除一个点后,原来可以被删除的点仍然可以被删除,原来不能被删除 ...

  4. SqlServer一些常用函数(持续更新。。。)

    1. 字符串拼接: + 拼接 SELECT 'AA' + 'BB' A //AABB在2012版本sqlserver之后,可以使用cancat进行字符串拼接了. 2. 判断是否为空,并取另外的值 :I ...

  5. Nginx配置IPv6端口监听及务器设置IPV6及Https支持并通过AppStore审核

    一.监听端口 从Nginx 1.3的某个版本起,默认ipv6only是打开的,所以,我们只需要在监听中加入ipv6监听即可,不过推荐都手动加上比较好,代码如下: listen [::]: ipv6on ...

  6. Chrome 解决flash问题

    Chrome 无法显示使用插件的内容 Chrome 不再支持很多插件.不过网站创建者已经通过更安全的方式,将多数这类功能添加到 Chrome 中. 为什么 NPAPI 插件现在无法正常运行过去,许多插 ...

  7. eclipse启动报错:An error has occurred.See the log file D:\eclipse\configuration\1552616709202.log

    如题,Eclipse崩了,只能按它留下的线索去看了1552616709202.log: !SESSION -- ::08.739 ----------------------------------- ...

  8. 详解Centos7 修改mysql指定用户的密码

    本文介绍了Centos7 修改mysql指定用户的密码,具体如下: 1.登陆mysql或者mariadb(两种任选其一) [root@localhost ~]# mysql -u root [root ...

  9. MySQL建表规范与常见问题 (go)

    一. 表设计 库名.表名.字段名必须使用小写字母,“_”分割. 库名.表名.字段名必须不超过12个字符. 库名.表名.字段名见名知意,建议使用名词而不是动词. 建议使用InnoDB存储引擎. 存储精确 ...

  10. Spring Mvc:用MultiPartFile上传单个文件,多个文件

    1.单个文件上传步骤: 添加Apache文件上传jar包 首先需要下载两个apache上传文件的jar包,commons-fileupload-1.3.1jar,commons-io-2.4.jar ...