随笔分类 -  linux

摘要:useradd es && echo "es123" | passwd --stdin es # useradd -m commonuser # echo 123 | passwd commonuser --stdin useradd nginx -s /sbin/nologin -M groupa 阅读全文
posted @ 2022-01-03 18:40 tonggc1668 阅读(78) 评论(0) 推荐(0)
摘要:test -d '/usr/local/nginx' || mkdir -p '/usr/local/nginx'test -d '/usr/local/nginx/sbin' \ || mkdir -p '/usr/local/nginx/sbin'test ! -f '/usr/local/ng 阅读全文
posted @ 2022-01-03 17:58 tonggc1668 阅读(148) 评论(0) 推荐(0)
摘要:下面的三种方法是等价的: /dev/null 空设备 黑洞 1)1>/dev/null 2>/dev/null 2)1>/dev/null 2>&1 3)&>/dev/null 则程序执行后,没有任何的输出 阅读全文
posted @ 2022-01-03 17:53 tonggc1668 阅读(141) 评论(0) 推荐(0)
摘要:linux非root用户执行开机启动程序 https://www.cnblogs.com/lanyangsh/p/8543433.html [root@nginx rc.d]# cd /etc/rc.d[root@nginx rc.d]# sed -i '13a /usr/local/nginx/s 阅读全文
posted @ 2022-01-02 23:41 tonggc1668 阅读(1151) 评论(0) 推荐(0)
摘要:Linux查看CPU详细信息 https://www.jianshu.com/p/a0ab0ccb8051 查看所有逻辑CPU的个数 cat /proc/cpuinfo | grep "processor" | wc -l Linux下查看CPU型号,内存大小,硬盘空间的命令(详解) https:/ 阅读全文
posted @ 2021-12-30 10:27 tonggc1668 阅读(198) 评论(0) 推荐(0)
摘要:Linux系统 usermod -a -G 不重启 立即生效 https://www.jianshu.com/p/76db34a16129 阅读全文
posted @ 2021-10-10 14:22 tonggc1668 阅读(470) 评论(0) 推荐(0)
摘要:start.sh #!/bin/bash PWDPATH=`dirname $0` PORTAL_HOME=`cd $PWDPATH && cd .. && pwd` echo $PORTAL_HOME cd $PORTAL_HOME JVM_OPTS=" -server -Xms2g -Xmx2g 阅读全文
posted @ 2021-09-29 17:33 tonggc1668 阅读(113) 评论(0) 推荐(0)
摘要:function check_ffmpeg_status() { video_index=$1 status=`ps aux |grep '/usr/local/ffmpeg/bin/ffmpeg' |grep $video_index |grep -v grep |wc -l` if [ $sta 阅读全文
posted @ 2021-09-29 17:25 tonggc1668 阅读(61) 评论(0) 推荐(0)
摘要:grep -w "aaa" inputfile|awk '{for (i=1;i<=NF;i++) {if ($i=="aaa") print $0}}' https://bbs.csdn.net/topics/100140743 阅读全文
posted @ 2021-09-27 19:32 tonggc1668 阅读(434) 评论(0) 推荐(0)
摘要:FROM openjdk:7-jre-slimMAINTAINER xuxueliENV PARAMS=""ENV TZ=PRCRUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezoneADD targ 阅读全文
posted @ 2021-09-05 21:38 tonggc1668 阅读(556) 评论(0) 推荐(1)
摘要:#!/bin/bash ######################################## #### 脚本结束执行source /etc/profile ######################################## baseDir=`dirname $0` loca 阅读全文
posted @ 2021-09-04 22:25 tonggc1668 阅读(24) 评论(0) 推荐(0)
摘要:# Linux命令+参数 #### 系统信息* arch 显示机器的处理器架构(1)* uname -m 显示机器的处理器架构(2)* uname -r 显示正在使用的内核版本* dmidecode -q 显示硬件系统部件 - (SMBIOS / DMI)* hdparm -i /dev/hda 罗 阅读全文
posted @ 2021-09-04 22:05 tonggc1668 阅读(24) 评论(0) 推荐(0)
摘要:export M2_HOME=/opt/apache-maven-3.8.1echo export PATH=${PATH}:${M2_HOME}/bin >> /etc/profilecat /etc/profilesudo echo 'export PATH=${PATH}:/Volumes/d 阅读全文
posted @ 2021-06-30 01:35 tonggc1668 阅读(80) 评论(0) 推荐(0)
摘要:cat > /etc/security/limits.conf<< EOF* soft nproc 16384* hard nproc 16384* soft nofile 1048576* hard nofile 1048576* soft stack 10240* hard stack 3276 阅读全文
posted @ 2021-06-30 00:34 tonggc1668 阅读(60) 评论(0) 推荐(0)
摘要:Homebrew国内如何自动安装(国内地址) https://zhuanlan.zhihu.com/p/111014448 完美解决Error: Running Homebrew as root is extremely dangerous and no longer supported. http 阅读全文
posted @ 2021-06-03 00:59 tonggc1668 阅读(143) 评论(0) 推荐(0)
摘要:安装virtualbox增强功能等需要 要求kernel版本一致 kernel-3.10.0-957.el7.x86_64.rpm 下载地址 https://download.csdn.net/download/tonggc1668/18994251 kernel-devel-3.10.0-957. 阅读全文
posted @ 2021-05-23 12:33 tonggc1668 阅读(3684) 评论(0) 推荐(0)
摘要:基于CentOS的Linux基本网络配置,包括网卡eth0、DNS、Host等 http://www.voidcn.com/article/p-tghbqwno-dz.html Debian-Linux配置网卡网络方法 https://www.cnblogs.com/saryli/p/1180722 阅读全文
posted @ 2020-09-17 00:50 tonggc1668 阅读(285) 评论(0) 推荐(0)
摘要:使用Bash进行数学运算 https://blog.csdn.net/abc_12366/article/details/79238002 阅读全文
posted @ 2020-07-31 19:24 tonggc1668 阅读(59) 评论(0) 推荐(0)
摘要:linux shell if [[ ]]和[ ]区别 || && https://blog.csdn.net/whatday/article/details/85028898/ linux之shell命令——条件判断(&& || test) https://blog.csdn.net/shang_f 阅读全文
posted @ 2020-07-31 19:23 tonggc1668 阅读(162) 评论(0) 推荐(0)
摘要:Linux Shell函数返回值 https://blog.csdn.net/ithomer/article/details/7954577 阅读全文
posted @ 2020-07-30 19:21 tonggc1668 阅读(288) 评论(0) 推荐(0)