====== Ubuntu设置强密码 ====== [[https://help.ubuntu.com/community/StrongPasswords|https://help.ubuntu.com/community/StrongPasswords]] ====== Linux端口占用情况查询 ====== 参考:[[https://www.cyberciti.biz/faq/unix-linux-check-if-port-is-in-use-command/|How to check if port is in use on Linux or Unix - nixCraft]] 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端口被占用 ====== 参考[[https://stackoverflow.com/questions/20239232/error-that-port-is-already-in-use|StackOverflow]] 执行命令''sudo lsof -t -i tcp:'' 查看被占用的端口号对应的进程id,然后kill相应进程,或者直接执行''sudo lsof -t -i tcp: | xargs kill -9'' 或''sudo fuser -k /tcp''kill占用端口的进程。 ====== 停用系统服务 ====== # 例如:sudo systemctl disable tomcat8 sudo systemctl disable ====== 触摸板双指操作在休眠后失效 ====== 编辑''/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命令的一个工具) ====== 如何在退出命令行后保持程序运行(Screen命令) ====== ===== Basic Linux Screen Usage(更多内容,参照 How To Use Linux Screen ) ===== Below are the most basic steps for getting started with screen: - 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''. ====== Mac或Linux中grep命令搜索中文 ====== 搜索受到当前语言环境的影响,需要配置语言环境,命令如下: env LANG=LC_ALL grep ...