Windows/Linux下的常用command资料收藏
2016-04-20 07:06
399 查看
HowtousetheWindowcommandline(DOS)
Basic:
CTRL+Cwillsendabreak(stopexecution)whennotextisselected
Help:
Helpcommand|more(pressenterforpagedown)
Command/?
http://www.computerhope.com/issues/ch000014.htm
Genneraloperation:
http://www.computerhope.com/issues/chusedos.htm
Search
http://www.computerhope.com/findstr.htm
-Findthefilesthatincludethekeywordinthegivenfiletypesincurrentandsubdirectories.
$findstr/S"keyword"*.txt
-Findthepathofagivendirectoryname
-Findallfileswithsomecertainnameinthecurrentandsubdirectories
$dir*.txt/s
Regularexpressionquickreference:
HowtousetheLinuxcommandline
General:
http://www.computerhope.com/issues/chshell.htm
Help:
Command–help|less(I,j,k…available)
Search
http://www.computerhope.com/findstr.htm
-Findthefilesthatincludethekeywordinthegivenfiletypesincurrentandsubdirectories.
grep-rnw
'/path/to/somewhere/'-e"pattern"
·-ror-Risrecursive,
·-nislinenumber,and
·-wstandsmatchthewholeword.
·-l(lower-caseL)canbeaddedtojustgivethefilenameofmatchingfiles.
·Alongwiththese,--excludeor--includeparametercould
beusedforefficientsearching.Somethinglikebelow:
-Findthepathofagivendirectoryname
-Findallfileswithsomecertainnameinthecurrentandsubdirectories
Basic:
CTRL+Cwillsendabreak(stopexecution)whennotextisselected
Help:
Helpcommand|more(pressenterforpagedown)
Command/?
Genneraloperation:
Search
-Findthefilesthatincludethekeywordinthegivenfiletypesincurrentandsubdirectories.
$findstr/S"keyword"*.txt
-Findthepathofagivendirectoryname
$dir<FolderName>/AD/s
-Findallfileswithsomecertainnameinthecurrentandsubdirectories
$dir*.txt/s
/P | Skipfileswithnon-printablecharacters. |
/R | Usessearchstringsasregularexpressions. |
/X | Printslinesthatmatch exactly. |
/M | Printsonlythefilenameifafilecontainsamatch. |
/N | Printsthelinenumberbeforeeachlinethat matches. |
/I | Specifiesthatthesearchisnottobe case-sensitive. |
. | Wildcard:anycharacter |
* | Repeat:zeroormoreoccurrencesofpreviouscharacterorclass |
^ | Lineposition:beginningofline |
$ | Lineposition:endofline |
[class] | Characterclass:anyonecharacterinset |
[^class] | Inverseclass:anyonecharacternotinset |
[x-z] | Range:anycharacterswithinthespecifiedrange |
\x | Escape:literaluseofmetacharacterx |
\<xyz | Wordposition:beginningofword |
xyz\> | Wordposition:endofword |
General:
Help:
Command–help|less(I,j,k…available)
Search
-Findthefilesthatincludethekeywordinthegivenfiletypesincurrentandsubdirectories.
grep-rnw
'/path/to/somewhere/'-e"pattern"
·-ror-Risrecursive,
·-nislinenumber,and
·-wstandsmatchthewholeword.
·-l(lower-caseL)canbeaddedtojustgivethefilenameofmatchingfiles.
·Alongwiththese,--excludeor--includeparametercould
beusedforefficientsearching.Somethinglikebelow:
·[code]grep-r-i--include\*.h--include\*.cppCP_Image~/path[12345]|mailx-sGREPemail@domain.com
-Findthepathofagivendirectoryname
$find.-name<foldername>-typed
-Findallfileswithsomecertainnameinthecurrentandsubdirectories
$find.-name<
file
name>
相关文章推荐
- Linux e1000网卡驱动流程
- CentOS7下php安装mcrypt扩展
- linux下IPTABLES配置
- haproxy 笔记
- linux下显示dd命令的进度
- Linux dd——备份命令
- java环境变量 windows centos 安装jdk
- linux 定时清理文件脚本 shell
- 使用unar解决windows压缩文件在linux解压出现乱码的情况
- CentOS6.x下GitLab安装
- linux命令行常用编辑命令
- 3.1Linux目录及文件管理
- 3.3Linux用户和组管理
- 3.4Linux用户和组管理进阶
- 4.1Linux文件权限
- 4.3Linux文本处理工具
- CentOS7安装各种库
- CentOS7安装protobuf-2.5.0.tar.gz
- CentOS7安装Ant
- CentOS7安装findbugs