linux 一些有用的命令

本文介绍了多种常用的Linux命令,如whoami、whereis等,用于查询用户信息、文件类型及内存使用情况等。同时,还提供了执行历史命令、查看端口使用情况等功能的命令介绍。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

1.whoami,whereis,which,id
//whoami:确认自己身份
//whereis:查询命令所在目录以及帮助文档所在目录
//which:查询该命令所在目录(类似whereis)
//id:打印出自己的UID以及GID。(UID:用户身份唯一标识。GID:用户组身份唯一标识。每一个用户只能有一个唯一的UID和 GID)
eg: whoami //显示你自已登陆的用户名
whereis bin 显示bin所在的目录,将显示为:/usr/local/bin
which bin

2.!! 执行最近一次的命令

3. finger 可以让使用者查询一些其他使用者的资料
eg: finger //查看所用用户的使用资料
finger root //查看root的资料

4. id  print user and group id's

5. iconv  convert the character set of a file

6. free  display memory usage

7. file  determine file type

8. basename  strip directory and suffix from filenames

9. cal   display a calender

10. enable  enable and disable builtin shell commands

11. expr   evaluate  expressions

12. groups  print group names a user is in

13. let  perform arithmetic on shell variables

14. local   create variables

15. test  evaluate a conditional expression

16. uname  print system information

17. wc    print byte, word, and line counts

18. yes  print a string until interrupted

 

19. netstat -nltp 查看主机端口使用情况

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值