指尖上的记忆指尖上的记忆
首页
  • 基础
  • Laravel框架
  • Symfony框架
  • 基础
  • Gin框架
  • 基础
  • Spring框架
  • 命令
  • Nginx
  • Ai
  • Deploy
  • Docker
  • K8s
  • Micro
  • RabbitMQ
  • Mysql
  • PostgreSsql
  • Redis
  • MongoDb
  • Html
  • Js
  • 前端
  • 后端
  • Git
  • 知识扫盲
  • Golang
🌟 gitHub
首页
  • 基础
  • Laravel框架
  • Symfony框架
  • 基础
  • Gin框架
  • 基础
  • Spring框架
  • 命令
  • Nginx
  • Ai
  • Deploy
  • Docker
  • K8s
  • Micro
  • RabbitMQ
  • Mysql
  • PostgreSsql
  • Redis
  • MongoDb
  • Html
  • Js
  • 前端
  • 后端
  • Git
  • 知识扫盲
  • Golang
🌟 gitHub

linux之getent命令的使用:

root@ca4989b3147e:/var/www# getent passwd www-data
www-data:x:1000:33:www-data:/var/www/:/bin/bash
  
分析:
www-data:用户名
x:密码字段(现代系统一般用 x 表示密码已加密存储)
33:用户 ID (UID)
33:组 ID (GID)
www-data:用户描述信息
/var/www:用户的家目录
/usr/sbin/nologin:用户登录时的 Shell(通常表示该用户不能直接登录)
  
root@ca4989b3147e:/var/www# 
root@ca4989b3147e:/var/www# getent group www-data
www-data:x:33:
  
分析:
www-data:组名
x:密码字段(组的密码,一般为空)
33:组 ID (GID)
空字段表示没有附加的成员信息
  
root@ca4989b3147e:/var/www# 
root@ca4989b3147e:/var/www# getent services http
http                  80/tcp www
  
分析:
使用 getent services 查询指定服务的端口和协议
  
root@ca4989b3147e:/var/www# 
root@ca4989b3147e:/var/www# getent protocols tcp
tcp                   6 TCP
  
分析:
使用 getent protocols 查询协议的相关信息