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. fatal error: openssl/evp.h: 没有那个文件或目录

    在陆佳华<嵌入式系统软硬件协同设计实战指南 第2版>一书的第13章节 编译U-boot时会遇到2个错误.原因很简单,就从一开始的错误提示着手: fatal error: openssl/e ...

  2. 『转』G Data InternetSecurity 2014 – 免费3个月

    G Data来自德国的顶级杀毒软件,采用BitDefender+CloseGap双引擎,屡获AV-TEST防護率100%.不多介绍,目前2014中文版没有上市.活动地址:点此进入官方网站:点此进入申请 ...

  3. 2018.12.20 L195

    Every Brazilian, including current and former members of the armed forces, will have to compromise u ...

  4. memcache+tomcat7.0.37+nginx实现session共享

    一.session工作原理 由于http是无状态的协议,当我们访问了页面A,然后访问页面B,http无法确定这2个页面的访问是来自同一个人.因此,我们要用cookie或session来跟踪用户,根据授 ...

  5. 通过Ftp put命令上传导致文件损坏的解决办法

    通过Linux命令行向在一台Windows FTP服务器上传文件.然后在另一台Windows客户机登录FTP服务器下载,但是下载后的文件大小变了,exe文件错误了不能正确执行.刻意打包的文件(.rar ...

  6. HDU 1402

    http://acm.hdu.edu.cn/showproblem.php?pid=1402 fft做O(nlog(n))大数乘法,kuangbin的模板 #include <stdio.h&g ...

  7. UT源码+105032014070

    设计三角形问题的程序 输入三个整数a.b.c,分别作为三角形的三条边,现通过程序判断由三条边构成的三角形的类型为等边三角形.等腰三角形.一般三角形(特殊的还有直角三角形),以及不构成三角形.(等腰直角 ...

  8. python3 爬虫相关-requests和BeautifulSoup

    前言 时间的关系,这篇文章只记录了相关库的使用,没有进行深入分析,各位看官请见谅(还是因为懒.....) requests使用 发送无参数的get请求 r = requests.get('http:/ ...

  9. C语言多线程pthread库相关函数说明

    线程相关操作说明 一 pthread_t pthread_t在头文件/usr/include/bits/pthreadtypes.h中定义: typedef unsigned long int pth ...

  10. git push 免密码

    git push 免密码 通用情况 使用ssh协议 git add 使用tab键自动补全的中文文件名乱码 jupyter notebook 创建密码 git push 免密码 通用情况 1.使用文件创 ...