Frequently Used Shell Commands
【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的更多相关文章
- Testing shell commands from Python
如何测试shell命令?最近,我遇到了一些情况,我想运行shell命令进行测试,Python称为万能胶水语言,一些自动化测试都可以完成,目前手头的工作都是用python完成的.但是无法从Python中 ...
- Run Shell Commands in Python
subprocess.call This is the recommended way to run shell commands in Python compared with old-fashio ...
- 在R中运行Shell命令脚本(Call shell commands from R)
aaa.R Args <- commandArgs()cat("Args[1]=",Args[1],"\n")cat("Args[2]=&quo ...
- mysql 使用 informatin_schema tables 创建 shell commands
SELECT CONCAT("mysqldump -uroot -p ", TABLE_SCHEMA, " ", TABLE_NAME, " > ...
- Hadoop FS shell commands
命令格式:hadoop fs -command -option args appendToFileUsage: hadoop fs -appendToFile <localsrc> ... ...
- echo shell commands as they are executed
http://stackoverflow.com/questions/2853803/in-a-shell-script-echo-shell-commands-as-they-are-execute ...
- Running shell commands by C++
#include <iostream> #include <stdio.h> #include <stdlib.h> using namespace std; st ...
- 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 ...
- python与shell的3种交互方式介绍
[目录] 1.os.system(cmd) 2.os.popen(cmd) 3.利用subprocess模块 4.subprocessor模块进阶 [概述] 考虑这样一个问题,有hello.py脚本, ...
随机推荐
- SQL 字符串拆分
字符串拆分: ALTER FUNCTION [dbo].[f_Split](@sText nvarchar(max),@split NVARCHAR(20)) RETURNS @t TABLE (id ...
- Jacoco的原理
覆盖率计数器 Jacoco使用一系列的不同的计数器来做覆盖率的度量计算.所有这些计数器都是从java的class文件中获取信息,这些class文件可以(可选)包含调试的信息在里面.即使在没有源码的情况 ...
- block 回调个人理解
在网上见过这么个面试题 使用block和GCD时要注意些什么?他们是一回事吗?block在ARC和MRC的用法有什么不同?使用时要注意些什么? 首先block 和 GCD 在我看来他们是完全不同的概念 ...
- Yii Model
REFs 自动生成代码 创建第一个Yii应用 创建模型 Yii 用户登陆机制
- 一个Self Taught Learning的简单例子
idea: Concretely, for each example in the the labeled training dataset xl, we forward propagate the ...
- BZOJ2124: 等差子序列(树状数组&hash -> bitset 求是否存在长度为3的等差数列)
2124: 等差子序列 Time Limit: 3 Sec Memory Limit: 259 MBSubmit: 2354 Solved: 826[Submit][Status][Discuss ...
- 1028:Ignatius and the Princess III
本题应该有两种方法: 1.母函数法 2.递推法 母函数不了解,待充分了解之后,再进行补充! 这里为递推实现的方法: 思路: 定义:n为要拆分的整数: k为拆分的项数: f[n][k]代表 n的整数拆分 ...
- 《FDTD electromagnetic field using MATLAB》读书笔记 Figure 1.2
函数f(x)用采样间隔Δx=π/5进行采样,使用向前差商.向后差商和中心差商三种公式来近似一阶导数. 书中代码: %% ---------------------------------------- ...
- windows常用DLL及作用
Kernel.dll:内存,硬盘灯硬件管理的相关函数. gdi32.dll:图形显示相关函数(LoadImage,GetPixel,StretchBlt,Ellipse). user32.dll:wi ...
- python 用 __all__ 暴露接口
非常典型的python的用法 refer to : http://python-china.org/t/725