Skip to content

Linux - FAQ

查看当前端口占用情况

linux

$ netstat -nlp | grep 5000
tcp 0 0 127.0.0.1:5000 0.0.0.0:* LISTEN 6847/python

linux/macOS

$ lsof -P -i :5000
Python 6847 IPv4 TCP localhost:5000 (LISTEN)

windows

> netstat -ano | findstr 5000
TCP 127.0.0.1:5000 0.0.0.0:0 LISTENING 6847

挂载磁盘出现的问题

出现的详细报错现在没有记下来, 大致的意思是, 你为什么还用 ext3 的方式来挂载 ext4 的硬盘唻.

重启之后进入系统中, 想要修改 /ext/fstab 的时候提示文件不能修改, 所以重新挂载磁盘进入读写状态

shell
$ mount -o remount,rw /

修改然后进行挂载

shell
$ vim /etc/fstab
#
# /etc/fstab
# Created by anaconda on Tue May  3 13:48:10 2016
#
# Accessible filesystems, by reference, are maintained under '/dev/disk'
# See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info
#
UUID=80b9b662-0a1d-4e84-b07b-c1bf19e72d97 /    ext4    defaults        1 1
/dev/vdb1 /storage                             ext4    defaults        0 0
/dev/vdc1 /webdata/wulihub                     ext4    defaults        0 0

使用 mount -a 进行挂载

Linux: 'xxx' is not in the sudoers file. This incident will be reported

使用更简单的命令来添加 root 用户

shell
# debian (ubuntu/kbuntu, debian)
$ usermod -a -G sudo user
# rhel (redhat, fedora, centos)
$ usermod -a -G wheel user

说明

创建时间: 2023-01-15 00:36:00 , 最后编辑于 2024-01-09 15:47:00