User Tools

Site Tools


linux常见问题与解决

This is an old revision of the document!


# Ubuntu设置强密码

https://help.ubuntu.com/community/StrongPasswords # Linux端口占用情况查询 参考:[How to check if port is in use on Linux or Unix - nixCraft](https://www.cyberciti.biz/faq/unix-linux-check-if-port-is-in-use-command/) ```bash sudo lsof -i -P -n | grep LISTEN sudo netstat -tulpn | grep LISTEN sudo lsof -i:22 ## see a specific port such as 22 ## sudo nmap -sTU -O IP-address-Here ```

# Linux端口被占用

参考[StackOverflow](https://stackoverflow.com/questions/20239232/error-that-port-is-already-in-use)

执行命令`sudo lsof -t -i tcp:<port_number>`查看被占用的端口号对应的进程id,然后kill相应进程,或者直接执行`sudo lsof -t -i tcp:<port_number> | xargs kill -9`或`sudo fuser -k <port_number>/tcp`kill占用端口的进程。

# 停用系统服务

```bash # 例如:sudo systemctl disable tomcat8 sudo systemctl disable <service_name> ```

# 触摸板双指操作在休眠后失效

编辑`/etc/default/grub`文件,添加`psmouse.synaptics_intertouch=0`到`GRUB_CMDLINE_LINUX_DEFAULT`的最后,例如:`GRUB_CMDLINE_LINUX_DEFAULT="quiet splash psmouse.synaptics_intertouch=0"`

# 问题:当linux非root权限用户对不属于当前用户目录下的文件,进行操作或移动时需要使用哪类命令才能使用root命令? 答:“sudo” 例如:sudo mv <文件名> <目标文件> (sudo是linux系统管理指令,允许系统管理员让普通用户执行一些或者全部的root命令的一个工具)

# 如何查看Linux系统版本 ```bash # 例如rhel查看版本,可以使用cat /etc/redhat-release cat /etc/**-release ``` 详见 [How do I determine RHEL (Red Hat Enterprise Linux) version? - nixCraft](https://www.cyberciti.biz/faq/how-do-i-determine-rhel-version/)

linux常见问题与解决.1575513085.txt.gz · Last modified: 2021/02/10 21:29 (external edit)