Linux 运维必备的 40 个命令总结

STM32F103开发实战:如何用CubeMX+CLion调整Flash起始地址(附完整CMake配置) 本文详细介绍了在STM32F103开发中如何使用CubeMX和CLion工具链调整Flash起始地址,包括链接脚本修改、系统文件配置和CMake工程适配。通过实战步骤和完整配置示例,帮助开发者实现固件双备份、OTA升级等高级功能,提升嵌入式开发效率。 阅读详情

1、删除0字节文件 Linux命令

  • find -type f -size 0 -exec rm -rf {} \;

2、查看进程

按内存从大到小排列

  • PS -e -o "%C : %p : %z : %a"|sort -k5 -nr

3、按 CPU 利用率从大到小排列

  • ps -e -o "%C : %p : %z : %a"|sort -nr

4、打印 cache 里的URL

  • grep -r -a jpg /data/cache/* | strings | grep "http:" | awk -F'http:' '{print "http:"$2;}'

5、查看 http 的并发请求数及其 TCP 连接状态:

  • netstat -n | awk '/^tcp/ {++S[$NF]} END {for(a in S) print a, S[a]}'

6、 sed -i '/Root/s/no/yes/' /etc/ssh/sshd_config sed 在这个文里 Root 的一行,匹配 Root 一行,将 no 替换成 yes。

7、如何杀掉 MySQL 进程

ps aux |grep mysql |grep -v grep  |awk '{print $2}' |xargs kill -9 (从中了解到awk的用途)killall -TERM mysqldkill -9 `cat /usr/local/apache2/logs/httpd.pid`   试试查杀进程PID

8、显示运行 3 级别开启的服务:

  • ls /etc/rc3.d/S* |cut -c 15-   (从中了解到cut的用途,截取数据)

9、如何在编写 SHELL 显示多个信息,用 EOF

cat << EOF+--------------------------------------------------------------+|       === Welcome to Tunoff services ===                |+--------------------------------------------------------------+EOF

10、for 的巧用(如给 MySQL 建软链接)

cd /usr/local/mysql/binfor i in *do ln /usr/local/mysql/bin/$i /usr/bin/$idone

11、取 IP 地址

ifconfig eth0 |grep "inet addr:" |awk '{print $2}'| cut -c 6-  或者ifconfig | grep 'inet addr:'| grep -v '127.0.0.1' | cut -d: -f2 | awk '{ print $1}'

12、内存的大小:

  • free -m |grep "Mem" | awk '{print $2}'
    

**13**

- 

netstat -an -t | grep ":80" | grep ESTABLISHED | awk '{printf "%s %s\n",$5,$6}' | sort


**14、**查看 Apache 的并发请求数及其 TCP 连接状态:

- 

netstat -n | awk '/^tcp/ {++S[$NF]} END {for(a in S) print a, S[a]}'


**15、**因为同事要统计一下服务器下面所有的 jpg 的文件的大小,写了个 SHELL 给他来统计。原来用 xargs 实现,但他一次处理一部分。搞的有多个总和……,下面的命令就能解决。

- 

find / -name *.jpg -exec wc -c {} ;|awk '{print $1}'|awk '{a+=$1}END{print a}'


CPU 的数量(多核算多个CPU,`cat /proc/cpuinfo |grep -c processor`)越多,系统负载越低,每秒能处理的请求数也越多。

16、CPU负载

- 

cat /proc/loadavg


检查前三个输出值是否超过了系统逻辑 CPU 的4倍。

17、 CPU负载

- 

mpstat 1 1


检查 %idle 是否过低(比如小于5%)。

18、内存空间

- 

free


检查 free 值是否过低,也可以用 `# cat /proc/meminfo`

19、SWAP 空间  

- 

free


检查 swap used 值是否过高,如果 swap used 值过高,进一步检查 swap 动作是否频繁:

- 

vmstat 1 5


观察 si 和 so 值是否较大

20、磁盘空间  

- 

df -h


检查是否有分区使用率(Use%)过高(比如超过90%)如发现某个分区空间接近用尽,可以进入该分区的挂载点,用以下命令找出占用空间最多的文件或目录:

- 

du -cks * | sort -rn | head -n 10


21、磁盘 I/O 负载

- 

iostat -x 1 2


检查I/O使用率(%util)是否超过 100%

22、网络负载

- 

sar -n DEV


检查网络流量(rxbyt/s, txbyt/s)是否过高

23、网络错误

- 

netstat -i


检查是否有网络错误(drop fifo colls carrier),也可以用命令:# cat /proc/net/dev

24、网络连接数目

- 

netstat -an | grep -E “^(tcp)” | cut -c 68- | sort | uniq -c | sort -n


25、进程总数  

- 

ps aux | wc -l


检查进程个数是否正常 (比如超过250)

26、可运行进程数目  

- 

vmwtat 1 5


列给出的是可运行进程的数目,检查其是否超过系统逻辑 CPU 的 4 倍

27、进程  

- 

top -id 1


观察是否有异常进程出现。

28、网络状态,检查DNS,网关等是否可以正常连通

29、用户

- 

who | wc -l


检查登录用户是否过多 (比如超过50个)  也可以用命令:# uptime。

30、系统日志

- 

cat /var/log/rflogview/*errors


检查是否有异常错误记录  也可以搜寻一些异常关键字,例如:

- 
- 

grep -i error /var/log/messagesgrep -i fail /var/log/messages


31、核心日志  

- 

dmesg


检查是否有异常错误记录。

32、系统时间  

- 

date


检查系统时间是否正确。

33、打开文件数目  

- 

lsof | wc -l


检查打开文件总数是否过多。

34、日志 

- 

logwatch –print


配置 /etc/log.d/logwatch.conf,将 Mailto 设置为自己的 email 地址,启动 mail 服务(sendmail或者postfix),这样就可以每天收到日志报告了。

缺省 logwatch 只报告昨天的日志,可以用 # logwatch –print –range all 获得所有的日志分析结果。

可以用 # logwatch –print –detail high 获得更具体的日志分析结果(而不仅仅是出错日志)。

35、杀掉80端口相关的进程

- 

lsof -i :80|grep -v “ID”|awk ‘{print “kill -9”,$2}’|sh


36、清除僵死进程

- 

ps -eal | awk '{ if ($2 == "Z") {print $4}}' | kill -9


37、tcpdump 抓包,用来防止80端口被人攻击时可以分析数据

- 

tcpdump -c 10000 -i eth0 -n dst port 80 > /root/pkts


38、然后检查IP的重复数并从小到大排序 注意 “-t\ +0”  中间是两个空格

- 

less pkts | awk {'printf $3"\n"'} | cut -d. -f 1-4 | sort | uniq -c | awk {'printf $1" "$2"\n"'} | sort -n -t\ +0


39、查看有多少个活动的 php-cgi 进程

- 

netstat -anp | grep php-cgi | grep ^tcp | wc -l


40、查看系统自启动的服务

- 

chkconfig --list | awk '{if ($5=="3:on") print $1}'


41、kudzu 查看网卡型号

- 

kudzu --probe --class=network


### 常用正则表达式

1.匹配中文字符的正则表达式: `[\u4e00-\u9fa5]`

> 评注:匹配中文还真是个头疼的事,有了这个表达式就好办了

2.匹配双字节字符(包括汉字在内):`[^\x00-\xff]`

> 评注:可以用来计算字符串的长度(一个双字节字符长度计2,ASCII字符计1)

3.匹配空白行的正则表达式:`\n\s*\r`

> 评注:可以用来删除空白行

4.匹配 HTML 标记的正则表达式:`<(\S*?)[^>]*>.*?|<.*? />`

> 评注:网上流传的版本太糟糕,上面这个也仅仅能匹配部分,对于复杂的嵌套标记依旧无能为力

5.匹配首尾空白字符的正则表达式:`^\s*|\s*$`

> 评注:可以用来删除行首行尾的空白字符(包括空格、制表符、换页符等等),非常有用的表达式

6.匹配Email地址的正则表达式:

- 

\w+([-+.]\w+)@\w+([-.]\w+)*.\w+([-.]\w+)


> 评注:表单验证时很实用

7.匹配网址URL的正则表达式:`[a-zA-z]+://[^\s]*`

> 评注:网上流传的版本功能很有限,上面这个基本可以满足需求

8.匹配帐号是否合法(字母开头,允许5-16字节,允许字母数字下划线):`^[a-zA-Z][a-zA-Z0-9_]{4,15}$`

> 评注:表单验证时很实用

9.匹配国内电话号码:`\d{3}-\d{8}|\d{4}-\d{7}`

> 评注:匹配形式如 0511-4405222 或 021-87888822

10.匹配腾讯QQ号:`[1-9][0-9]{4,}`

> 评注:腾讯QQ号从10000开始

11.匹配中国邮政编码:`[1-9]\d{5}(?!\d)`

> 评注:中国邮政编码为6位数字

12.匹配×××:`\d{15}|\d{18}`

> 评注:中国的×××为15位或18位

13.匹配ip地址:`\d+\.\d+\.\d+\.\d+`

> 评注:提取 IP 地址时有用

14.匹配特定数字:

- 
- 
- 
- 
- 
- 
- 
- 
- 
- 

^[1-9]\d$   //匹配正整数^-[1-9]\d$  //匹配负整数^-?[1-9]\d$  //匹配整数^[1-9]\d|0$ //匹配非负整数(正整数 + 0)^-[1-9]\d|0$  //匹配非正整数(负整数 + 0)^[1-9]\d*.\d|0.\d[1-9]\d$  //匹配正浮点数^-([1-9]\d.\d|0.\d[1-9]\d)$ //匹配负浮点数^-?([1-9]\d.\d|0.\d[1-9]\d|0?.0+|0)$ //匹配浮点数^[1-9]\d.\d|0.\d[1-9]\d|0?.0+|0$  //匹配非负浮点数(正浮点数 + 0)^(-([1-9]\d.\d|0.\d[1-9]\d))|0?.0+|0$ //匹配非正浮点数(负浮点数 + 0) 评注:处理大量数据时有用,具体应用时注意修正


15.匹配特定字符串:

- 
- 
- 
- 
- 

^[A-Za-z]+$ //匹配由26个英文字母组成的字符串^[A-Z]+$ //匹配由26个英文字母的大写组成的字符串^[a-z]+$ //匹配由26个英文字母的小写组成的字符串^[A-Za-z0-9]+$ //匹配由数字和26个英文字母组成的字符串^\w+$ //匹配由数字、26个英文字母或者下划线组成的字符串

```

以上就是良许教程网为各位朋友分享的Linux 运维必备的 40 个命令总结。 以上就是良许教程网为各位朋友分享的Linux相关知识。

从零到一:手把手教你用Verilog在FPGA上构建自己的FFT处理器(不依赖IP核) 本文详细介绍了如何从零开始使用Verilog在FPGA上构建256点FFT处理器,不依赖商业IP核。内容涵盖FFT算法基础、蝶形运算单元设计、整体架构实现、时序收敛优化策略以及测试验证方法,重点提升FPGA上算法部署的运行效率与资源利用率。 阅读详情

相关推荐

大疆Livox Mid-70雷达的使用

一、前期准备 (一)、使用Livox Viewer测试雷达 1、设置静态IP sudo ifconfig enx081f7152092a 192.168.1.50 查看IP是否设置成功 lacyexsale@lacyexsale-KLV-WX9:~$ ifconfig enx081f7152092a Link encap:以太网 硬件地址 08:1f:71:52:09:2a inet 地址:192.168.1.50 广播:192.168.1.255 掩码:255.255.25

LacyExsale的博客 1万+

JavaScript高级-正则表达式-建议收藏

JavaScript高级 1.正则表达式概述 1.1什么是正则表达式 正则表达式( Regular Expression )是用于匹配字符串中字符组合的模式。在JavaScript中,正则表达式也是对象。 正则表通常被用来检索、替换那些符合某个模式(规则)的文本,例如验证表单:用户名表单只能输入英文字母、数字或者下划线, 昵称输入框中可以输入中文(匹配)。此外,正则表达式还常用于过滤掉页面内容中的...

解启超 956

昇腾Ascend310b部署deepseek-r1-7b的学习记录

9.鲲鹏服务器+昇腾卡(Atlas 300I pro)搭建DeepSeek-R1-Distill-Qwen-7B(自己存档详细版)5.如何使用昇腾Ascend 300I Pro 310P芯片 单卡运行DeepSeek-R1-Distilled-Qwen-7B。6.鲲鹏服务器+昇腾卡(Atlas 300I pro)搭建DeepSeek-R1-Distill-Qwen-7B。7.鲲鹏+昇腾部署DeepSeek-R1-Distill-Qwen-32B+Open-webui。

maken 2367

请收藏,Linux 运维必备的 40 个命令总结,收好了~

点击上方 "程序员小乐"关注,星标或置顶一起成长后台回复“大礼包”有惊喜礼包!关注订阅号「程序员小乐」,收看更多精彩内容每日英文In prosperity, our f...

程序员小乐 737

手把手教你用ADuC845 DAC调试恒流电路(附实测数据与避坑指南)

本文详细介绍了如何利用ADuC845 DAC调试恒流电路,包括硬件搭建、DAC输出校准、低端死区问题解决方案及系统级调试技巧。通过实测数据和避坑指南,帮助工程师快速解决非线性输出和稳定性问题,提升电路性能。

life6的博客 335

Spring Boot Swagger未授权访问漏洞:原理、风险与修复方案详解

在微服务架构中,API文档管理是开发与运维的重要环节。Swagger作为RESTful API文档生成与调试的标准化工具,通过OpenAPI规范自动生成交互式接口文档,极大提升了开发效率。然而,其默认配置往往缺乏访问控制,导致文档端点直接暴露,形成未授权访问漏洞。从技术原理看,该漏洞源于Spring Boot等框架集成Swagger时,相关端点未纳入安全框架的拦截范围,攻击者可通过扫描常见路径获取完整的接口定义与数据结构。这不仅会造成敏感信息泄露,更可能成为越权操作、数据篡改等深度攻击的入口点。在工程实践中

weixin_42524171的博客 493

JavaScript正则表达式之座机号/手机号验证校验规则

JavaScript正则表达式之座机号/手机号验证校验规则

看一点点书,懂一点点道理,过好这一生 2498

SEED-VIG数据集实战:5步搞定驾驶员疲劳检测模型(附Python代码)

本文提供了一份基于SEED-VIG数据集的驾驶员疲劳检测模型实战指南。通过五个核心步骤——数据准备、特征提取、模型训练、优化评估及部署思路,详细讲解了如何利用脑电信号构建分类器,并附有完整的Python代码,帮助开发者快速上手这一智能座舱关键技术。

w1x2y3的博客 262

js 正则 验证手机号 座机号码

var isTelephoneNew = (rule, value, callback) => { var patrn1=/^(1[34578]\d{9}$)/; var patrn = /^(([0-9]{3,4}[-])?[0-9]{7,8}$)/; if (value && value.indexOf("-")==-1 && !p...

流水随清风的博客 1746

opencv的cmake报错

1、下载 ippicv_2021.8_win_intel64_20230330_general.zip、v0.1.2a.zip、opencv_videoio_ffmpeg.dll、opencv_videoio_ffmpeg_64.dll、ffmpeg_version.cmake。由于下载源在https://raw.githubusercontent.com,由于网络原因下载不顺畅,可以先找到文件下载到对应文件夹下,或者更改网络环境。ffmpeg_version.cmake文件,打开后显示如下, 另存即可。

nownow_的博客 1297

【Bug已解决】This model‘s maximum context length is X tokens. However, you requested Y tokens 解决方案

summary_prompt = "请将以下对话历史压缩成一段简洁摘要,保留关键决策和结论:\n" + format_messages(old_part)return [{"role": "system", "content": f"此前对话摘要:{summary}"}] + recent_part这种方式能在大幅降低 token 消耗的同时,尽量保留任务推进所需的关键上下文,是目前业内做长会话 Agent 最常见的处理方式之一。方案适用场景推荐指数滑动窗口裁剪短任务,对早期历史依赖不强⭐⭐⭐。

一键难忘的博客 1万+

js正则手机或者固话验证

日常开发表单手机号码检验

rzrfreedom的博客 6559

【WRFDA实操第一期】服务器中安装 WRFPLUS 和 WRFDA

【WRFDA实操第一期】安装 WRFPLUS 和 WRFDA

WW、forever的博客 2035

Linux 运维必备的 40个命令

** Linux 运维必备的 40个命令 ** 1、删除0字节文件 find -type f -size 0 -exec rm -rf {} ; 2、查看进程 按内存从大到小排列 ps -e -o "%C : %p : %z : %a"|sort -k5 -nr 3、按 CPU 利用率从大到小排列 ps -e -o "%C : %p : %z : %a"|sort -nr 4、打印 cache 里的URL grep -r -a jpg /data/cache/* | strings | grep "h

haohan_dandang的博客 399

Statistics and Machine Learning Toolbox

Statistics and Machine Learning Toolbox(带书签),MATLAB统计学习工具

数学建模模型总结

这是本人在两年内准备参加数学建模竞赛搜集到的模型资料,已经经过了本人的筛选和整理,希望能够对准备参加数学建模竞赛的学弟学妹们提供一些帮助!

awk截取字符命令_【收藏】Linux 运维必备的 40 个命令总结

1、删除0字节文件find -type f -size 0 -exec rm -rf {} ; 2、查看进程按内存从大到小排列PS -e -o "%C : %p : %z : %a"|sort -k5 -nr 3、按 CPU 利用率从大到小排列ps -e -o "%C : %p : %z : %a"|sort -nr 4、打印 cache 里的URLgrep -r -a jpg /data/cac...

weixin_42300090的博客 408

深度学习工具包 DeepLearningToolbox

深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain's apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath('DeepLearnToolbox'));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand('state',0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W'); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand('state',0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = 'sigm';%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, 'Too big error');```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand('state',0)sae = saesetup([784 100]);sae.ae{1}.activation_function = 'sigm';sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)')% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = 'sigm';nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, 'Too big error');```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x',28,28,60000))/255;test_x = double(reshape(test_x',28,28,10000))/255;train_y = double(train_y');test_y = double(test_y');%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you'll get around 1.2% errorrand('state',0)cnn.layers = { struct('type', 'i') %input layer struct('type', 'c', 'outputmaps', 6, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %sub sampling layer struct('type', 'c', 'outputmaps', 12, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, 'Too big error');```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand('state',0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, 'Too big error');%% ex2 neural net with L2 weight decayrand('state',0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex3 neural net with dropoutrand('state',0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex4 neural net with sigmoid activation functionrand('state',0)nn = nnsetup([784 100 10]);nn.activation_function = 'sigm'; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex5 plotting functionalityrand('state',0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = 'softmax'; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand('state',0)nn = nnsetup([784 20 10]); nn.output = 'softmax'; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

Linux 运维必备的40个命令总结

1、删除0字节文件 find -type f -size 0 -exec rm -rf {} \; 2、查看进程 按内存从大到小排列 ps -e -o "%C : %p : %z : %a"|sort -k5 -nr ps参数 ps的-o选项就是把让ps格式化输出ps你想要的信息,比如只想输出进程的pid、CPU占用率和进程执行命令这三个信息怎么办,你当然可以ps aux全部输出然后切割输出,但是ps的-o选项可以让你很方便的满足上面的需求。 首先看一下ps的输出有那些选项 使用命令:ps aux U

果子哥丶的博客 1743

Data-Structures-and-Algorithm-Analysis-in-Java.pdf

作者: Weiss, Mark A. 出版社: Addison Wesley Data Structures and Algorithm Analysis in Java is an “advanced algorithms” book that fits between traditional CS2 and Algorithms Analysis courses. In the old ACM Curriculum Guidelines, this course was known as CS7. This text is for readers who want to learn good programming and algorithm analysis skills simultaneously so that they can develop such programs with the maximum amo...

[转载] 请收藏,Linux 运维必备的 40 个命令总结,收好了~

原文链接:请收藏,Linux 运维必备的 40 个命令总结,收好了~ 内容来源:51CTO博客 1、删除0字节文件 find -type f -size 0 -exec rm -rf {} \; 2、查看进程 按内存从大到小排列 PS -e -o "%C : %p : %z : %a"|sort -k5 -nr 3、按 CPU 利用率从大到小排列 ps -e -o "%C : %p : %z : %a"|sort -nr 4、打印 cache 里的URL grep-r..

gclome的博客 642

mysql+e+eof_Linux 运维必备的 40 个命令总结

1、删除0字节文件find -type f -size 0 -exec rm -rf {} \;2、查看进程按内存从大到小排列PS -e -o "%C : %p : %z : %a"|sort -k5 -nr3、按 CPU 利用率从大到小排列ps -e -o "%C : %p : %z : %a"|sort -nr4、打印 cache 里的URLgrep -r -a jpg /data/cache...

weixin_31659095的博客 2216

请收藏!Linux 运维必备的 40 个命令总结

1、删除0字节文件find-typef-size0-execrm-rf{}\;2、查看进程按内存从大到小排列PS-e-o"%C:%p:%z:%a"|so...

weixin_44747933的博客 487

【收藏】Linux 运维必备的 40 个命令总结

1、删除0字节文件 find-typef-size0-execrm-rf{}\; 2、查看进程 按内存从大到小排列 PS-e-o"%C:%p:%z:%a"|sort-k5-nr 3、按 CPU 利用率从大到小排列 ps-e-o"%C:%p:%z:%a"|sort-nr 4、打印 cache 里的URL grep-r-ajpg/data/cache/*|strings|grep"http:"|awk...

XMWS-IT 561

mysql awk_Linux 运维必备的 40 个命令总结,请收藏!

请收藏!Linux 运维必备的 40 个命令总结1、删除0字节文件find -type f -size 0 -exec rm -rf {} \;2、查看进程按内存从大到小排列PS -e -o "%C : %p : %z : %a"|sort -k5 -nr3、按 CPU 利用率从大到小排列ps -e -o "%C : %p : %z : %a"|sort -nr4、打印 cache 里的URLgr...

weixin_39875031的博客 252

Linux 运维必备的 40 个命令总结,收好了~

1 删除0字节文件 find -type f -size 0 -exec rm -rf {} \; 2 查看进程按内存从大到小排列 PS -e -o "%C : %p : %z : %a"|sort -k5 -nr 3 按 CPU 利用率从大到小排列 ps -e -o "%C : %p : %z : %a"|sort-nr 4 打印 cache 里的URL grep-r-ajpg/data/cache/*|strings|grep"http:"|awk-F'ht...

xueshenlaila的博客 307

linux 运维常用指令,Linux 运维必备的 40 个命令总结

1、删除0字节文件find -type f -size 0 -exec rm -rf {} \;2、查看进程按内存从大到小排列PS -e -o "%C : %p : %z : %a"|sort -k5 -nr3、按 CPU 利用率从大到小排列ps -e -o "%C : %p : %z : %a"|sort -nr4、打印 cache 里的URLgrep -r -a jpg /data/cache...

weixin_42546508的博客 425
上一篇: Linux初学者的七个建议
下一篇: Linux 环境变量配置
码农在线QY
博客等级 码龄6年 11粉丝 161原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值