User Tools

Site Tools


linux常见问题与解决

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
linux常见问题与解决 [2022/08/08 15:50]
xujianglong [如何查看Linux系统版本]
linux常见问题与解决 [2023/03/08 16:09] (current)
xujianglong ↷ Page moved from 内部资料:linux常见问题与解决 to linux常见问题与解决
Line 1: Line 1:
 ====== Ubuntu设置强密码 ====== ====== Ubuntu设置强密码 ======
  
-https://help.ubuntu.com/community/StrongPasswords+[[https://help.ubuntu.com/community/StrongPasswords|https://help.ubuntu.com/community/StrongPasswords]]
  
 ====== Linux端口占用情况查询 ====== ====== Linux端口占用情况查询 ======
Line 12: Line 12:
 sudo lsof -i:22 ## see a specific port such as 22 ## sudo lsof -i:22 ## see a specific port such as 22 ##
 sudo nmap -sTU -O IP-address-Here sudo nmap -sTU -O IP-address-Here
 +
 +
 </code> </code>
 +
 ====== Linux端口被占用 ====== ====== Linux端口被占用 ======
  
 参考[[https://stackoverflow.com/questions/20239232/error-that-port-is-already-in-use|StackOverflow]] 参考[[https://stackoverflow.com/questions/20239232/error-that-port-is-already-in-use|StackOverflow]]
  
-执行命令''%%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占用端口的进程。 +执行命令''<nowiki>sudo lsof -t -i tcp:<port_number></nowiki>'' 查看被占用的端口号对应的进程id,然后kill相应进程,或者直接执行''<nowiki>sudo lsof -t -i tcp:<port_number> | xargs kill -9</nowiki>'' 或''<nowiki>sudo fuser -k <port_number>/tcp</nowiki>''kill占用端口的进程。
 ====== 停用系统服务 ====== ====== 停用系统服务 ======
  
Line 24: Line 26:
 # 例如:sudo systemctl disable tomcat8 # 例如:sudo systemctl disable tomcat8
 sudo systemctl disable <service_name> sudo systemctl disable <service_name>
 +
 +
 </code> </code>
 +
 ====== 触摸板双指操作在休眠后失效 ====== ====== 触摸板双指操作在休眠后失效 ======
  
-编辑''%%/etc/default/grub%%''文件,添加''%%psmouse.synaptics_intertouch=0%%''到''%%GRUB_CMDLINE_LINUX_DEFAULT%%''的最后,例如:''%%GRUB_CMDLINE_LINUX_DEFAULT="quiet splash psmouse.synaptics_intertouch=0"%%'' +编辑''<nowiki>/etc/default/grub</nowiki>'' 文件,添加''<nowiki>psmouse.synaptics_intertouch=0</nowiki>'' 到''<nowiki>GRUB_CMDLINE_LINUX_DEFAULT</nowiki>'' 的最后,例如:''<nowiki>GRUB_CMDLINE_LINUX_DEFAULT="quiet splash psmouse.synaptics_intertouch=0"</nowiki>''
 ====== 问题:当linux非root权限用户对不属于当前用户目录下的文件,进行操作或移动时需要使用哪类命令才能使用root命令? ====== ====== 问题:当linux非root权限用户对不属于当前用户目录下的文件,进行操作或移动时需要使用哪类命令才能使用root命令? ======
  
 答:“sudo” 例如:sudo mv <html><文件名></html> <html><目标文件></html> (sudo是linux系统管理指令,允许系统管理员让普通用户执行一些或者全部的root命令的一个工具) 答:“sudo” 例如:sudo mv <html><文件名></html> <html><目标文件></html> (sudo是linux系统管理指令,允许系统管理员让普通用户执行一些或者全部的root命令的一个工具)
  
-====== 如何查看Linux系统版本 ======+====== 如何在退出命令行后保持程序运行(Screen命令) ======
  
-<code bash> +===== Basic Linux Screen Usage(更多内容参照 How To Use Linux Screen ) =====
-# 例如rhel查看版本可以使用cat /etc/redhat-release +
-cat /etc/**-release+
  
-</code>+Below are the most basic steps for getting started with screen:
  
-详见 [[https://www.cyberciti.biz/faq/how-do-i-determine-rhel-version/|How do I determine RHEL (Red Hat Enterprise Linux) version? - nixCraft]]+  - On the command prompt, type ''screen''. 
 +  - Run the desired program. 
 +  Use the key sequence ''Ctrl-a''  + ''Ctrl-d''  to detach from the screen session. 
 +  Reattach to the screen session by typing ''screen -r''.
  
-====== Linux磁盘空间未满df -h但提示磁盘空间不足(实际为inode占用100%) ======+====== Mac或Linux中grep命令搜索中文 ======
  
-排查方法:使用''df -h'' 查看磁盘空间使用情况再使用''df -i'' 查看inode占用情况,如果有一个达到100%,则会提示磁盘空间不足,部分服务无法使用,特别是后者达到100%,不太容易被发现。+搜索受到当前语言环境的影响需要配置语言环境命令下: 
 +<code>
  
-解决办法:详见[[https://help.aliyun.com/document_detail/42531.html#trBFk|Linux实例磁盘空间满和inode满的问题排查方法]]+env LANG=LC_ALL grep ..
 + 
 +</code>
  
  
linux常见问题与解决.1659945056.txt.gz · Last modified: 2022/08/08 15:50 by xujianglong