![](https://img-blog.csdnimg.cn/20201014180756928.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
Linux
[纳川]
日拱一卒无有尽,功不唐捐终入海
展开
-
查询java运行资源占用情况
【代码】查询java运行资源占用情况。原创 2022-10-13 10:40:54 · 572 阅读 · 0 评论 -
linux 替换文本指定内容
【代码】linux 替换文本指定内容。原创 2022-09-30 17:34:12 · 3602 阅读 · 0 评论 -
linux 常用文件夹介绍
【代码】linux 常用文件夹介绍。原创 2022-08-29 14:57:36 · 73 阅读 · 0 评论 -
Linux查看cpu
#查看Linux逻辑cpu个数cat /proc/cpuinfo| grep "processor"#查看cpu的详情lscpu原创 2021-12-16 17:41:14 · 186 阅读 · 0 评论 -
liunx grep 正则过滤
#查询 开始执行一个计划 . 代表任意字符 ***** 代表此字符出现0->到无穷大grep -E --color '开始.*计划' file.log原创 2021-11-22 17:24:54 · 210 阅读 · 0 评论 -
阿里云盘在线扩容
阿里云盘在线扩容 fdisk -ludf -Th yum install gdisk -y yum install -y cloud-utils-growpartgrowpart /dev/vda 1resize2fs /dev/vda1resize2fs /dev/vdb1df -Th转载 2021-08-30 15:35:44 · 271 阅读 · 0 评论 -
linux抓包
抓取 IP为:192.17.90.100 端口为8080 的包tcpdump tcp port 8080 and host 192.17.90.100原创 2021-06-18 23:02:30 · 56 阅读 · 0 评论 -
Linux 查看网络流量
Linux 查看网络流量yum -y install iftopiftop原创 2021-06-18 21:46:11 · 105 阅读 · 0 评论 -
Linux同步系统时间
date -s “2021-05-26 15:04:22” #yyyy-mm-dd hh:mm:ss原创 2021-05-26 15:05:06 · 61 阅读 · 0 评论 -
阿里云dun安装
wget "https://update3.aegis.aliyun.com/download/install/2.0/linux/AliAqsInstall_64.sh" && chmod +x AliAqsInstall_64.sh && ./AliAqsInstall_64.sh ai1qyX原创 2021-05-26 13:17:08 · 402 阅读 · 0 评论 -
查看cpu占用大于n的应用的pid
查看cpu占用大于n的应用的pid ps axf -o "pid %cpu" | awk '{if($2>=1.0) print $1}' ``原创 2021-05-10 11:28:24 · 62 阅读 · 0 评论 -
linux core病毒挖矿病毒定时器(源码)
#!/bin/sh/bin/ps axf -o "pid %cpu" | awk '{if($2>=90.0) print $1}' | while read prociddokill -9 $prociddonezero=0process=`ps aux | grep 'HbewXurEWNdeWNtj' | grep -v grep| wc -l`if [ "$process" -eq "$zero" ]; then if [ -f /tmp/core ] then /tm原创 2021-05-10 10:46:48 · 570 阅读 · 0 评论 -
linux创建定时任务
vim /etc/crontab SHELL=/bin/bashPATH=/sbin:/bin:/usr/sbin:/usr/binMAILTO=root# For details see man 4 crontabs# Example of job definition:# .---------------- minute (0 - 59)# | .------------- hour (0 - 23)# | | .---------- day of month (1 - 3原创 2021-04-21 21:10:56 · 128 阅读 · 0 评论 -
linux 常用命令
#显示行数cat -n file#连同子目录的内容一起列出(递归列出),等于该目录下的所有文件都会显示出来ls -R#显示一个二进制文件、源码或man的位置whereis halt #显示一个二进制文件或可执行文件的完整路径which halt # 在文件 '/var/log/messages'中查找关键词"Aug"grep Aug /var/log/messages #在文件 '/var/log/messages'中查找以"Aug"开始的词汇grep ^Aug /var原创 2021-04-06 11:34:21 · 56 阅读 · 0 评论 -
telnet: command not found的解决方法
yum install telnet.*原创 2020-12-25 21:39:34 · 5579 阅读 · 1 评论 -
linux ll 以m来显示文件列表中每个文件的大小
ll -h原创 2020-12-10 09:13:18 · 3938 阅读 · 0 评论 -
linux free 命令
free 命令显示系统内存的使用情况,包括物理内存、交换内存(swap)和内核缓冲区内存。#这个可以很直观的看到结果free -h如果需要持续查看 (下面表示每5秒打印一次)free -h -s 5Mem:是内存的使用情况。(主要参考)Swap:是交换空间的使用情况。total:系统总的可用物理内存和交换空间大小。used:已经被使用的物理内存和交换空间。free:还有多少物理内存和交换空间可用。(除去被缓存使用和程序使用的内存后,真正可以使用的内容...原创 2020-12-05 14:02:10 · 380 阅读 · 0 评论 -
Linux shell 常用命令
没有创建文件[root@iZpees9x4h85klZ ~]# touch 1.txt精确匹配文字[root@iZpees9x4h85klZ ~]# echo 'jdjdjdj word lddl wod wor ' > 1.txt [root@iZpees9x4h85klZ ~]# ls1.txt[root@iZpees9x4h85klZ ~]# grep -w 'word' 1.txt jdjdjdj word lddl wod wor [root@iZpee原创 2020-11-23 22:10:22 · 176 阅读 · 0 评论 -
shell 启动springboot脚本
#!/bin/env bash#version_name=$(date +%Y%m%d_%H%M)#目标文件夹名targer_dir_name=test1#目标文件名targer_file_name=test2#源文件夹source_dir=/root/dir#启动日志打印行数tail_num=200jar_version=$1#如果目录不存在直接创建if [[ ! -d /opt/setup/$targer_dir_name/log ]]then mkdir -p /o.原创 2020-11-22 23:58:25 · 381 阅读 · 0 评论 -
linux 常用命令 shell脚本
ntpdate cn.ntp.org.cn原创 2020-11-22 10:52:08 · 1096 阅读 · 0 评论 -
linux shell 复制文件并以当前时间命名
cp name.txt name$(date +%Y%m%d%H%M%S).txt原创 2020-11-21 13:56:12 · 2505 阅读 · 0 评论 -
linux shell 批量杀进程
linux下如何批量杀JAVA进程或某个进程方法在工作中经常需要停止JAVA进程,停止时间也比较长,那么有时候因为一些情况,需要把linux下JAVA所有进程kill掉,又不能用killall直接杀掉某一进程名称包含的所有运行中进程(我们可能只需要杀掉其中的某一类或运行指定参数命令的进程),这个时候我们需要运用ps,grep,cut和kill一起操作。ok,下面给出具体的参考:ps -ef|grep LOCAL=NO|grep -v grep|cut -c 9-15|xar...转载 2020-11-21 13:32:24 · 954 阅读 · 0 评论 -
linux history 输出带时间
//写入.bash_profile中 [root@iZ2ze38cdb934wmZ ~]# echo 'export HISTTIMEFORMAT="%F %T "' >> .bash_profile //刷新 [root@iZ2ze38tfdb934wmZ ~]# source .bash_profile 执行这两行就ok(注意第一条指令必须是>> 双大于号,否则会覆盖原文件)...原创 2020-11-21 12:53:51 · 429 阅读 · 0 评论 -
linux 设置系统时间
将系统时间设定成下午5点55分55秒的命令$ : "date -s 17:55:55" 3. 将当前时间和日期写入BIOS,避免重启后失效$: "hwclock -w"原创 2020-11-11 16:05:48 · 278 阅读 · 0 评论 -
linux cat grep 快速查找
cat a.txt | grep 6cb264631e054原创 2020-10-26 14:26:39 · 146 阅读 · 0 评论 -
mac 杀占用端口
lsof -i:17104kill -9 进程id原创 2020-10-23 11:11:09 · 166 阅读 · 0 评论 -
ssh - crt 同时操作多个窗口
shift+command+p 打开上传文件界面原创 2020-10-22 16:10:59 · 1763 阅读 · 0 评论 -
linux 切割日志文件
//以200m大小每个,把log.txt文件切割为多个new_log 结尾以 aa,ab,..结束split -b200m log.txt new_log原创 2020-10-15 20:13:27 · 269 阅读 · 0 评论 -
Linux zip压缩和解压
1.zip命令zip -r fileName.zip ./*将当前目录下的所有文件和文件夹全部压缩成fileName.zip文件,-r表示递归2.unzip命令unzip -o -d ./ fileName.zip把fileName.zip文件解压到当前目录-o:不提示的情况下覆盖文件;-d: 后表示解压到的目录位置...原创 2020-05-21 17:09:09 · 283 阅读 · 0 评论 -
查看当前目录下所有文件的大小
du -ah --max=1原创 2019-12-29 23:51:10 · 1081 阅读 · 0 评论 -
docker 迁移存储
https://juejin.im/post/5d2b2d2f6fb9a07ec9563cc2查看存放位置# docker info | grep "Docker Root Dir"查看大小# du -hs /var/lib/docker停docker服务service docker stop在大的空间创建一个文件,把docker文件放这里mkdir -p /data/dock...转载 2019-12-29 00:15:15 · 166 阅读 · 0 评论 -
Linux查看端口占用
netstat -tunlp | grep 8080参数说明:-t (tcp) 仅显示tcp相关选项 -u (udp)仅显示udp相关选项 -n 拒绝显示别名,能显示数字的全部转化为数字 -l 仅列出在Listen(监听)的服务状态 -p 显示建立相关链接的程序名......原创 2019-12-26 14:17:09 · 346 阅读 · 0 评论 -
Linux查看隐藏文件
ls -la不加./ 启动 =前面加 sh./bin/zkService.sh = sh /bin/zkService.sh原创 2019-10-27 12:58:03 · 810 阅读 · 0 评论 -
Linux(实用命令)创建查看文件方法
出处:http://blog.csdn.net/xyw_blog/article/details/168612631、vivi 1.txt 会直接创建并打开一个文件1.txt2、touchtouch的作用是更改一个文件或目录的时间。touch 2.txt 如果2.txt不存在,则创建空文件2.txt3、echoecho “abcd” > 3.txt 可以直接创建文件...转载 2019-04-23 09:46:25 · 675 阅读 · 0 评论 -
Linux查看某个文件夹下子文件占用空间大小/查看cpu信息(du)
查看某个目录下各个文件和文件夹的大小du-ah--max-depth=1 a表示显示目录下所有的文件和文件夹(不含子目录),h表示以人类能看懂的方式,max-depth表示目录的深度。其他常用一命令lsblk 查看分区和磁盘df -h ...原创 2019-06-06 11:18:46 · 9316 阅读 · 0 评论 -
Ubuntu16.04 安装字体库
下载安装:sudo apt-get install ttf-mscorefonts-installer更新字体缓存:sudo fc-cache -f -v查看所有字体:fc-list :lang=zh;原创 2019-06-21 12:07:33 · 3446 阅读 · 0 评论 -
查看程序路径
查看程序存放路径 locate nginx原创 2019-06-21 13:32:45 · 318 阅读 · 0 评论 -
error while loading shared libraries: libfreetype.so.6: cannot open shared object file: ...如何解决
错误: 查看文件位置: 拷贝文件到这个目录下: 文件下载链接:https://download.csdn.net/download/weixin_39530695/11252039 重新加载配置文件:root@VM-0-3-ubuntu:/etc# ldconfig...原创 2019-06-21 14:14:06 · 9272 阅读 · 0 评论 -
Linux 挂载新磁盘
参考:https://help.aliyun.com/document_detail/25426.html?spm=5176.2020520129.0.0.673946aeLbASot主要分三步:查看可挂载的磁盘: fdisk -l执行磁盘初始化: mkfs.ext4 /dev/vdb挂载: mount /dev/vdb /mnt 查看可挂载的磁盘: fdisk -...原创 2019-07-01 15:28:08 · 581 阅读 · 2 评论 -
xhell快捷上传下载
上传:rz下载:sz原创 2019-07-07 23:44:01 · 200 阅读 · 0 评论