![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
脚本
password-u
向上向善!勇往直前!
展开
-
Linux、Windows获取主板序列号和UUID
Linux:# 获取主板序列号sudo dmidecode -s system-serial-number# 获取UUIDsudo dmidecode -s system-uuidWindows:# 主板序列号wmic baseboard get serialnumber# 获取UUIDwmic csproduct list full | findstr UUID原创 2022-02-18 11:15:37 · 6396 阅读 · 0 评论 -
Linux 同步系统时间,并修改时区
1. 同步时间sudo ntpdate ntp.api.bz2. 选择时区3. 替换时区文件sudo mv /etc/localtime /etc/localtime.oldsudo ln -s /usr/share/zoneinfo/Asia/Shanghai /etc/localtime原创 2022-01-29 09:43:53 · 1725 阅读 · 0 评论 -
Linux 查看 CPU 核心数
cat /proc/cpuinfo| grep "processor"| wc -l原创 2021-09-28 12:01:22 · 148 阅读 · 0 评论 -
使用expect工具 用ssh命令自动登录远程主机
#!/usr/expect/bin/expect## 登录远程机器# 参数:# ip: 远程主机IP# user: 远程主机用户# password: 远程主机用户密码## check parameter numbersif {$argc puts " Error : Parameter is error."puts " Usage原创 2017-09-20 09:23:31 · 472 阅读 · 0 评论 -
Linux 使用expect工具和scp命令实现自动复制传输文件
#!/usr/expect/bin/expect############################################################## # # 1.Copy install-package to destination hos原创 2017-09-18 20:16:39 · 1156 阅读 · 0 评论 -
解决Linux中普通用户无权限访问串口设备问题
有两种方法:第一种:添加串口设备访问规则以root身份执行:vim /etc/udev/rules.d/70-ttyusb.rules内容为:KERNEL=="ttyUSB[0-9]*",MODE="0666"注意:内容里边的双引号不能丢,否则不会生效此方法有两个弊端:1.该方法会让所有的普通用户都具有访问这些串口设备的权限,存在一定的安全隐患2.加入此规则后,必须拔掉设备重新插入,此规则才可生效原创 2018-01-19 10:07:15 · 15533 阅读 · 0 评论 -
Linux循环遍历所有文件,删除指定后缀名文件
#!/bin/bash# 循环遍历当前目录下的所有文件,并删除.pyc文件function getfile(){ for e in `ls $1` do fullpath=$1/$e if [ -f $fullpath ]; then prefix=${fullpath:0-4} if [ $...原创 2019-01-04 11:20:40 · 3765 阅读 · 0 评论