Linux Windows常用命令整理(持续更新)

Linux

& : 表示任务在后台执行,eg: redis-server &
&& : 表示前一条命令执行成功时,才执行后一条命令, eg: echo '1' && echo '2'
| : 表示管道,上一条命令的输出,作为下一条命令参数,eg: echo 'yes'|wc -l
|| : 表示上一条命令执行失败后,才执行下一条命令, eg: cat nofile || echo "fail"

 

ssh远程执行nohup命令不退出

在机器上执行 ssh target "nohup ./test.sh &", 结果ssh不立即退出,等./test.sh执行完毕之后才退出,如果是./redis-server &类型的服务启动,则ssh不退出除非中断
    ->解决: ssh target "./test.sh "./test.sh >/dev/null 2>&1 & "

 

•  file /sbin/init或者file /bin/ls查看系统位数
•  date直接查看时间
• service命令可以查看系统里的命令,如
service iptables stop清除防火墙规则,
service sshd start启动远程连接服务
• ps -ef|grep loong
• pgrep -fl loong
• tail -f 文件名  动态监测文件内容
• pwd查看当前路径
• 查看文件内容cat,less(可使用翻页功能),more
• ls,ll,dir,ls -l,列出目录内容
• ls | wc -w查看有多少个文件及文件夹
• ls | wc -c查看这个目录下有多少个文件
• vim/vi打开文本文件
• cd 文件全名(包括扩展名):打开文件
• cd 文件夹名 :打开文件夹
• ls -l
• ls -lh
• ll -h
• du -sh *|sort -n统计当前目录大小并按大小排序
• du -sk *|grep guojf看一个人的大小
• du -sm *|sort -n
• history查看历史命令
• top查看CPU使用率情况
• df检查文件系统的磁盘空间占用情况
• getenforce
• route -n
• lsof 找到线程对应的端口

配置系统环境变量:
桌面在终端中打开,cd回车进入"~"状态下,vi .bash_profile回车,按下"i"进入编辑状态,改好后按下Esc键退出编辑状态,按下"shift+:"加wq退出设置界面。

 

Windows

• 画图:mspaint

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
Paragraph grep tool. 进行段搜索的grep工具。默认以空行为段分隔符,并可以自己通过-p参数指定。使用方法与经典grep相同,只是从grep的行搜索变为段搜索。 此版本为Windows下的安装版本,安装后即可从命令行窗口中通过pgrep命令调用。附带源代码。 使用帮助 ------------------------------------ pgrep v1.00.x071127 by Programus (programus@gmail.com) ------------------------------------ An open source and free command line grep like tool. It prints out the paragraphs which contains the pattern instead of lines. Usage: pgrep [OPTION]... PATTERN [FILE] ... python pgrep [OPTION]... PATTERN [FILE] ... Search for PATTERN in each FILE or standard input and output a paragraph separated by separator. Example: python pgrep.py -i 'hello world' menu.h main.c OPTIONS: -c, --count Suppress normal output; instead print a count of matching lines for each input file. With the -v, --invert-match option, count non-matching lines. -e, --regexp=PATTERN Use pattern as the pattern; useful to protect patterns beginning with a -. -f, --file=FILE Obtain patterns from file, one per line. The empty file contains zero patterns, and therefore matches nothing. -h, --help Print this help -i, --ignore-case Ignore case distinctions in both the pattern and the input files. -l, --files-with-matches Suppress normal output; instead print the name of each input file from which output would normally have been printed. The scanning of every file will stop on the first match. -p, --separator=SEPARATOR Specify a separator. The default separator is '\n\s*\n'. -v, --invert-match Invert the sense of matching, to select non-matching parts.
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

LuckyJiang.2021

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值