linux服务器相关命令

linux相关命令20210812

1、创建新的普通用户(ubuntu系统使用adduser)

useradd -m usernamen
passwd TestDJ 
需输入密码*2次

2、给普通用户bash权限

usermod -s /bin/bash usernamen

3、修改设置线程

ulimit -u 4000 
此命令不要大于4096。

4、设置Java虚拟内存的方式启动隔离程序。

java  -jar -Xms4062 -Xmx4062 Z_JieShou.jar

5、10分钟无故传输软件闪退问题。

nohup jdk1.8/bin/java -jar  Z_JieShou.jar

6、重启服务器

reboot

7、安全关机

shutdown -h now

8、解压文件

tar -zxvf   【目标文件名】

.deb格式安装

dpkg  -i 【包名】

.rpm格式安装

rpm  -ivh  【包名】

9查进程

ps -ef|grep java

10、ftp服务的开、关、重启

service vsftpd start	//开启
service vsftpd stop		//停止
service vsftpd restart	//重启

11、查看端口使用情况

netstat -nltp			//查所有在使用的端口
lsof -i :【端口号】		//查此端口使用情况

12、关闭xdmcp远程服务

systemctl stop lightdm
systemctl disable lightdm

13、关闭telnet服务23端口

servic inetd stop或service xinetd stop

14、赋权限(逐级赋权)

chmod +R 777 【文件夹名】

15、更改组

chown -R 用户名:用户组 【文件夹/文件名】

16、查看存储和挂载占用情况


17、防火墙

查
systemctl status firewalld
service iptables status
关
service iptables stop
systemctl stop firewalld

18、关闭防火墙开机自启

systemctl disable firewalld
chkconfig iptables off

19、关闭指定端口

iptables -A INPUT -p $端口号  -j ACCEPT

20、开启指定端口

iptables -A INPUT -p $端口号  -j ACCEPT

21、查看挂载情况

df -h
ls /dev/sd** (插上u盘会多一个,记住名字)

22、手动挂载u盘

mount空格 -t vfat /dev/名称 /home/syjy/GuaZai(空目录否则覆盖)

23、手动卸载U盘

umount -v /dev/sdd(目标名称)
  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值