随笔- 310  文章- 1  评论- 0  阅读- 86066 

随笔分类 -  linux

history命令
摘要:history命令介绍 是被保存在内存中的,当退出或者登录shell时,会自动保存或读取。在内存中,历史命令仅能够存储1000条历史命令,该数量是由环境变量HISTSIZE进行控制。默认是不显示命令的执行时间,命令的执行时间,history 已经记录,只是没有显示。 注: 如想查询某个用户在系统上执 阅读全文
posted @ 2022-11-29 10:00 boye169 阅读(42) 评论(0) 推荐(0) 编辑
linux find命令
摘要:语法概念 语法格式:find [option] 查找路径 查找条件 处理动作 基于文件类型查找 -type f:普通文件 d:目录文件 l:链接文件 s:套接字文件 c:字符设备文件 b:块设备文件 p:管道文件 基于文件大小查找 基于时间查找 1.以天为单位 -atime [+|-]#:表示访问时 阅读全文
posted @ 2022-11-25 15:37 boye169 阅读(29) 评论(0) 推荐(0) 编辑
linux 批量添加定时任务
摘要:pssh -h hosts.txt -i 'cd ~ && crontab -l > cron.cron && echo "* * * * * echo hello >>/home/hadoop/time.log" >> cron.cron && crontab cron.cron ' 阅读全文
posted @ 2022-11-25 15:27 boye169 阅读(244) 评论(0) 推荐(0) 编辑
linxu TMOUT
摘要:系统为CentOS 7,一次无意操作在 /etc/profile 末尾增加了TMOUT=90,然后系统就总是一会没操作就自动退出登录,不仅ssh自动退出,在本地使用也自动退出,很麻烦,查了一下, 原来是启动了系统空闲等待时间,TMOUT=90意思是90秒无操作就自动退出登录 export TMOUT 阅读全文
posted @ 2022-11-25 15:24 boye169 阅读(14) 评论(0) 推荐(0) 编辑
linux 下jq命令
摘要:安装 yum install jq -y 新建文件 vim test.json #加入下面内容,保存 [{"name":"菜鸟教程","url":"www.runoob.com"},{"name":"google","url":"www.google.com"},{"name":"微博","url" 阅读全文
posted @ 2022-10-27 14:21 boye169 阅读(38) 评论(0) 推荐(0) 编辑
telnet 超时断开连接
摘要:timeout 5 telnet 127.0.0.1 36554 #5秒后断开连接 阅读全文
posted @ 2022-09-02 09:52 boye169 阅读(179) 评论(0) 推荐(0) 编辑
linux下生成base64编码和md5校验值
摘要:生成base64编码 echo "hello"|base64 生成md5校验 echo "hello"|md5sum 阅读全文
posted @ 2022-03-23 11:03 boye169 阅读(141) 评论(0) 推荐(0) 编辑
Linux下查看某个进程占用的CPU、内存
摘要:查看服务进程 ps -ef|grep node|grep -v grep top -p 22766 查看更详细的内存占比 cat /proc/22766/status 阅读全文
posted @ 2021-12-23 15:13 boye169 阅读(232) 评论(0) 推荐(0) 编辑
linux连接工具MobaXterm下载及使用
摘要:下载 https://mobaxterm.mobatek.net/download-home-edition.html 登录linux机器 阅读全文
posted @ 2021-05-30 09:43 boye169 阅读(559) 评论(0) 推荐(0) 编辑
linux下nginx安装
摘要:安装基本包 yum install gcc-c++ yum install -y pcre pcre-devel yum install -y zlib zlib-devel yum install -y openssl openssl-devel 下载 wget http://nginx.org/ 阅读全文
posted @ 2021-05-26 22:53 boye169 阅读(41) 评论(0) 推荐(0) 编辑
linux下 for循环的几种方式
摘要:带下标for循环 arry=(hello world welcome yes very good) for i in ${!arry[@]};do echo arry[$i]=${arry[i]};done for((i=1 ;i<${#arry[@]};i++));do echo arry[$i] 阅读全文
posted @ 2021-03-23 23:34 boye169 阅读(111) 评论(0) 推荐(0) 编辑
linux 下并行执行shell脚本
摘要:使用xargs并行执行shell ls test*.sh|xargs -P 5 -i sh {} 阅读全文
posted @ 2021-03-22 21:56 boye169 阅读(325) 评论(0) 推荐(0) 编辑
linux下curl命令使用
摘要:curl是一个利用url规则在命令行下工作的文件传输工具,可以说是一款很强大的http命令行工具。它支持文件的上传和下载 Usage: curl [options...] <url> -A/--user-agent <string> 设置用户代理发送给服务器 -b/--cookie <name=st 阅读全文
posted @ 2021-03-17 22:58 boye169 阅读(190) 评论(0) 推荐(0) 编辑
linux账号管理和密码过期设置
摘要:新添加的用户,用户密码过期时间是从/etc/login.defs中PASS_MAX_DAYS提取的,普通系统默认就是99999,而安全操作系统4.0是90。更改此处,只是让新建的用户默认密码过期时间变化,已有用户密码过期时间仍然不变。 chage:密码失效是通过此命令来管理的。 参数意思: -m 密 阅读全文
posted @ 2021-02-24 22:49 boye169 阅读(895) 评论(0) 推荐(0) 编辑
linux下ls、split、readlink、iconv命令
摘要:# 按文件名排序 ls |sort -n # 递归显示子目录 ls -R # 按文件大小排序 ls -lS # 查看文件大小和时间 ls -lh # 按时间逆序排序 ls -ltr # 只显示目录,不会显示子目录文件 ls -d *htmls # 列出文件或目录的节点号 ls -i# 把文件切割每个 阅读全文
posted @ 2021-02-22 22:10 boye169 阅读(141) 评论(0) 推荐(0) 编辑
Linux下查看端口是否启用
摘要:查看9090端口是否启用 netstat -nl | grep 9090 netstat -apn|grep 80 阅读全文
posted @ 2021-02-22 22:04 boye169 阅读(369) 评论(0) 推荐(0) 编辑
linux下获取ip
摘要:ip=$(ifconfig |grep broadcast|awk 'NR<2 {print $2}') echo $ip ifconfig注:在配置crontab定时任务时,ifconfig为生效,可在脚本上加入 . /etc/profile 使环境变量生效 阅读全文
posted @ 2021-02-22 22:00 boye169 阅读(72) 评论(0) 推荐(0) 编辑
磁盘挂载
摘要:查看磁盘 lsblk 查看磁盘是否格式化 blkid /dev/vda1 格式化磁盘 mkfs -t ext4 /dev/vda1 查看UUID blkid # 查看挂载点是否存在 ls -ld /opt/local/data # 创建挂载目录 mkdir -p /opt/local/data # 阅读全文
posted @ 2021-02-22 21:54 boye169 阅读(57) 评论(0) 推荐(0) 编辑
linux普通用户权限设置为超级用户权限
摘要:添加文件可写权限 chmod 644 /etc/sudoers 编辑/etc/sudoers文件 vim /etc/sudoers 添加下面一行: boye ALL=(ALL) NOPASSWD: ALL 阅读全文
posted @ 2020-12-01 23:24 boye169 阅读(1343) 评论(0) 推荐(0) 编辑
linux-免密操作
摘要:生成秘钥 ssh-keygen -t rsa 复制SSH密钥到目标主机 -方式1 ssh-copy-id -i ~/.ssh/id_rsa.pub test@192.168.2.100 复制SSH密钥到目标主机 -方式2 将本地机器的 ~/.ssh/id_rsa.pub文件内容复制到目标机器的~/. 阅读全文
posted @ 2020-12-01 00:39 boye169 阅读(249) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示