news 2026/6/15 13:05:03

【把Linux“聊”明白】vim编辑器完全指南

作者头像

张小明

前端开发工程师

1.2k 24
文章封面图
【把Linux“聊”明白】vim编辑器完全指南
一、基本概念

首先,我们要知道,Linux下有两种用户:超级用户(root)、普通用户。

  • 超级用户:可以在linux系统下做任何事情,不受限制
  • 普通用户:在linux下做有限的事情。
  • 超级用户的命令提示符是“#”,普通用户的命令提示符是“$”

命令:su [用户名] 功能:切换用户。 例如,要从root用户切换到普通用户user,则使用su user。 要从普通用户user切换到root用户则使用su root(root可以省略),此时系统会提示输入root用户的口令。 实例:

在这里插入图片描述

在这里我们再介绍一个su -,用法是一样的,有一点不同:

su:只切换用户身份,但保持原用户的工作环境(环境变量、工作目录等)。 su - 或 su -l:切换用户身份,并同时切换到该用户的完整登录环境。

实例:

在这里插入图片描述

说明(基本都知道): 从超级用户->普通用户,权限降低; 从普通用户->超级用户,权限提高; 提高有什么用,简单来说,因为很多文件不允许普通用户操作。

二、Linux权限管理
2.1 “权限”详解

首先,我们要知道权限是什么?

权限的本质,就是能或者不能做什么事情

其次,为什么要有权限?

在日常生活中,我们都听过,“谁谁谁没有权限做什么操作……” 权限就是为了控制用户的行为,防止错误的发生。 这里也很好理解,权限首先限制的是角色(谁有我的权限),权限还要求目标必须具备对应的属性(也就是,我想在LeetCode上玩游戏,但是,它不具备玩游戏的“属性”呀)。 所以,权限=角色+目标权限属性(目标有什么权限) 通俗一点,哪个角色有目标的什么权限。 在Linux下,一切皆文件,面对的都是文件,那文件有什么权限呢–>读、写、执行

2.2 权限=角色+目标权限属性
  1. 看现象: 下面,我们来看一下我在一个目录下列出该目录下所以文件和目录的详细信息:

在这里插入图片描述

这里显示的就是文件或者目录的属性,因为文件不仅仅是内容,文件=内容+属性。 那我们来详解一下这些属性都代表什么意思:

在这里插入图片描述

在这里插入图片描述

在这里插入图片描述

  1. 角色前面我们说到:权限=角色+目标权限属性,那在Linux中角色有什么呢,在上图我们看到,有所有者,所属组,那对于每一个角色都要一一列举嘛,显然不是,除了这两个其它的角色都称为“其它”,所以在Linux中:


www.dongchedi.com/article/7594897166766965272
www.dongchedi.com/article/7594897310665245246
www.dongchedi.com/article/7594897192310407705
www.dongchedi.com/article/7594897631617794585
www.dongchedi.com/article/7594896580080435737
www.dongchedi.com/article/7594895704896684568
www.dongchedi.com/article/7594897374330503705
www.dongchedi.com/article/7594895618720449048
www.dongchedi.com/article/7594896034183397912
www.dongchedi.com/article/7594896087656694334
www.dongchedi.com/article/7595300698343260734
www.dongchedi.com/article/7595300086620734014
www.dongchedi.com/article/7595300794661257753
www.dongchedi.com/article/7595300922285146649
www.dongchedi.com/article/7595300794661159449
www.dongchedi.com/article/7595301535278858814
www.dongchedi.com/article/7595300053246837310
www.dongchedi.com/article/7595298997771141656
www.dongchedi.com/article/7595298747215987224
www.dongchedi.com/article/7595298653444080190
www.dongchedi.com/article/7595299173835276862
www.dongchedi.com/article/7595293834620191257
www.dongchedi.com/article/7595294214674596377
www.dongchedi.com/article/7595294735703966270
www.dongchedi.com/article/7595294214674825753
www.dongchedi.com/article/7595269939515703870
www.dongchedi.com/article/7595270106293600793
www.dongchedi.com/article/7595268901785584153
www.dongchedi.com/article/7595268784974545433
www.dongchedi.com/article/7595270592459506238
www.dongchedi.com/article/7595268816629219865
www.dongchedi.com/article/7595267640395235902
www.dongchedi.com/article/7595267822872166937
www.dongchedi.com/article/7595266120056422936
www.dongchedi.com/article/7595265326464795161
www.dongchedi.com/article/7595264479055970878
www.dongchedi.com/article/7595263814942376472
www.dongchedi.com/article/7595263889965924926
www.dongchedi.com/article/7595264219466121753
www.dongchedi.com/article/7595261441830486590
www.dongchedi.com/article/7595257155528409624
www.dongchedi.com/article/7595257148431974937
www.dongchedi.com/article/7595255577883198014
www.dongchedi.com/article/7595257264999858713
www.dongchedi.com/article/7595255131160085054
www.dongchedi.com/article/7595254038942401086
www.dongchedi.com/article/7595272535034430014
www.dongchedi.com/article/7595273235844137496
www.dongchedi.com/article/7595271162356302398
www.dongchedi.com/article/7595269071357231641
www.dongchedi.com/article/7595269220477567512
www.dongchedi.com/article/7595268287076958782
www.dongchedi.com/article/7595269071357264409
www.dongchedi.com/article/7595268315833270809
www.dongchedi.com/article/7595265492903363096
www.dongchedi.com/article/7595265055567299096
www.dongchedi.com/article/7595265773019841049
www.dongchedi.com/article/7595265891500114494
www.dongchedi.com/article/7595264904798978585
www.dongchedi.com/article/7595263429863195161
www.dongchedi.com/article/7595261995696800280
www.dongchedi.com/article/7595258440394818073
www.dongchedi.com/article/7595256795065893401
www.dongchedi.com/article/7595256961541767704
www.dongchedi.com/article/7595257257731408446
www.dongchedi.com/article/7595253896583774745
www.dongchedi.com/article/7595252944199778841

版权声明: 本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若内容造成侵权/违法违规/事实不符,请联系邮箱:809451989@qq.com进行投诉反馈,一经查实,立即删除!
网站建设 2026/6/9 22:23:03

TradingView图表库终极集成指南:5分钟构建专业金融图表应用

TradingView图表库终极集成指南:5分钟构建专业金融图表应用 【免费下载链接】charting-library-examples Examples of Charting Library integrations with other libraries, frameworks and data transports 项目地址: https://gitcode.com/gh_mirrors/ch/charti…

作者头像 李华
网站建设 2026/5/31 1:01:07

小米智能家居C控制终极指南:从零打造个性化智能生活

小米智能家居C#控制终极指南:从零打造个性化智能生活 【免费下载链接】mi-home С# API for Xiaomi Mi Home devices 项目地址: https://gitcode.com/gh_mirrors/mi/mi-home 还在为小米官方APP的功能限制而烦恼吗?想要实现更灵活、更个性化的智能…

作者头像 李华
网站建设 2026/5/22 9:56:45

开源模型也能强逻辑?DeepSeek-R1思维链能力评测与部署

开源模型也能强逻辑?DeepSeek-R1思维链能力评测与部署 1. 背景与技术定位 近年来,大语言模型在自然语言理解、代码生成和逻辑推理等任务中展现出惊人能力。然而,主流高性能模型往往依赖高算力GPU进行推理,限制了其在边缘设备或隐…

作者头像 李华
网站建设 2026/5/31 14:38:27

没GPU如何测试Qwen-Image?云端按需付费方案详解

没GPU如何测试Qwen-Image?云端按需付费方案详解 你是不是也遇到过这种情况:AI课程老师布置了作业,要求体验最新的Qwen-Image图像生成模型,结果发现学校机房没有GPU,自己的笔记本连显卡都没有,或者只有个入…

作者头像 李华
网站建设 2026/6/5 20:58:14

ProGuard Maven插件完整指南:Java字节码优化与混淆的最佳实践

ProGuard Maven插件完整指南:Java字节码优化与混淆的最佳实践 【免费下载链接】proguard-maven-plugin ProGuard Maven plugin that supports modularised ProGuard packages 项目地址: https://gitcode.com/gh_mirrors/pr/proguard-maven-plugin 在当今Java…

作者头像 李华
网站建设 2026/6/13 16:43:22

小鹏汽车:以AI重构万人团队招聘,赋能一线业务管理

在“AI招聘 潮头之上”2025NFuture最佳雇主颁奖盛典深圳站现场,小鹏汽车营销服招聘负责人冯晓莲分享了题为《用AI赋能一线管理者》的深度实践。面对业务快速扩张带来的海量人才需求,她坦言团队曾面临巨大挑战,而AI工具的引入,帮助…

作者头像 李华