From 1f043154eaac4b85de2f607fc240eb7d8d352ca8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8B=8F=E6=B8=85=E5=8D=8E?= <1463670799@qq.com> Date: Wed, 15 May 2024 15:15:46 +0800 Subject: [PATCH 1/5] =?UTF-8?q?240514=E7=AC=94=E8=AE=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../240514 \345\210\235\350\257\206linux.md" | 52 +++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 "52 \350\213\217\346\270\205\345\215\216/240514 \345\210\235\350\257\206linux.md" diff --git "a/52 \350\213\217\346\270\205\345\215\216/240514 \345\210\235\350\257\206linux.md" "b/52 \350\213\217\346\270\205\345\215\216/240514 \345\210\235\350\257\206linux.md" new file mode 100644 index 0000000..47d9109 --- /dev/null +++ "b/52 \350\213\217\346\270\205\345\215\216/240514 \345\210\235\350\257\206linux.md" @@ -0,0 +1,52 @@ +# linux + +一种操作系统内核,有centos,debian,redhat等。 + +## 安装 + +安装vm17,安装debian iso文件。 + +## 命令 + +### 查看ip地址: + +第一种:ip addr show + +第二种: + +apt-get update + +apt-get install net-tools + +ifconfig + +### ssh: + +apt-get install ssh + +apt-get install vim + +vim /etc/ssh/sshd_config + +port 22 打开端口 + +permitrootlogin yes 启用root登录 + +passwordauthentication yes 验证密码 + +permitemptypasswords no 禁止使用空密码登录 + +/etc/init.d/ssh restart + +### sudo: + +su root + +apt-get install sudo + +sudo vim /etc/sudpers + +root all=(all:all) all + +用户名 all=(all:all) all 添加用户名 + -- Gitee From 0b08baa2bbd3b3ecaaa01ed5f1ca8582a5202f31 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8B=8F=E6=B8=85=E5=8D=8E?= <1463670799@qq.com> Date: Wed, 15 May 2024 15:16:59 +0800 Subject: [PATCH 2/5] =?UTF-8?q?240510=E7=AC=94=E8=AE=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../240514 \345\210\235\350\257\206linux.md" | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git "a/52 \350\213\217\346\270\205\345\215\216/240514 \345\210\235\350\257\206linux.md" "b/52 \350\213\217\346\270\205\345\215\216/240514 \345\210\235\350\257\206linux.md" index 47d9109..83e9ec0 100644 --- "a/52 \350\213\217\346\270\205\345\215\216/240514 \345\210\235\350\257\206linux.md" +++ "b/52 \350\213\217\346\270\205\345\215\216/240514 \345\210\235\350\257\206linux.md" @@ -40,11 +40,11 @@ permitemptypasswords no 禁止使用空密码登录 ### sudo: -su root +su root 更换给root模式 apt-get install sudo -sudo vim /etc/sudpers +sudo vim /etc/sudoers root all=(all:all) all -- Gitee From ab43f8f0f6027c60afc50607f303e29705b75532 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8B=8F=E6=B8=85=E5=8D=8E?= <12077670+shenxiz@user.noreply.gitee.com> Date: Wed, 15 May 2024 07:16:28 +0000 Subject: [PATCH 3/5] =?UTF-8?q?=E5=88=A0=E9=99=A4=E6=96=87=E4=BB=B6=2052?= =?UTF-8?q?=20=E8=8B=8F=E6=B8=85=E5=8D=8E/240514=20=E5=88=9D=E8=AF=86linux?= =?UTF-8?q?.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../240514 \345\210\235\350\257\206linux.md" | 52 ------------------- 1 file changed, 52 deletions(-) delete mode 100644 "52 \350\213\217\346\270\205\345\215\216/240514 \345\210\235\350\257\206linux.md" diff --git "a/52 \350\213\217\346\270\205\345\215\216/240514 \345\210\235\350\257\206linux.md" "b/52 \350\213\217\346\270\205\345\215\216/240514 \345\210\235\350\257\206linux.md" deleted file mode 100644 index 83e9ec0..0000000 --- "a/52 \350\213\217\346\270\205\345\215\216/240514 \345\210\235\350\257\206linux.md" +++ /dev/null @@ -1,52 +0,0 @@ -# linux - -一种操作系统内核,有centos,debian,redhat等。 - -## 安装 - -安装vm17,安装debian iso文件。 - -## 命令 - -### 查看ip地址: - -第一种:ip addr show - -第二种: - -apt-get update - -apt-get install net-tools - -ifconfig - -### ssh: - -apt-get install ssh - -apt-get install vim - -vim /etc/ssh/sshd_config - -port 22 打开端口 - -permitrootlogin yes 启用root登录 - -passwordauthentication yes 验证密码 - -permitemptypasswords no 禁止使用空密码登录 - -/etc/init.d/ssh restart - -### sudo: - -su root 更换给root模式 - -apt-get install sudo - -sudo vim /etc/sudoers - -root all=(all:all) all - -用户名 all=(all:all) all 添加用户名 - -- Gitee From 2a0f48e41f7297dc5804bd2370e8f6a06609dfbb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8B=8F=E6=B8=85=E5=8D=8E?= <1463670799@qq.com> Date: Wed, 15 May 2024 15:19:38 +0800 Subject: [PATCH 4/5] =?UTF-8?q?240514=E7=AC=94=E8=AE=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../240514 \345\210\235\350\257\206linux.md" | 52 +++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 "52 \350\213\217\346\270\205\345\215\216/240514 \345\210\235\350\257\206linux.md" diff --git "a/52 \350\213\217\346\270\205\345\215\216/240514 \345\210\235\350\257\206linux.md" "b/52 \350\213\217\346\270\205\345\215\216/240514 \345\210\235\350\257\206linux.md" new file mode 100644 index 0000000..83e9ec0 --- /dev/null +++ "b/52 \350\213\217\346\270\205\345\215\216/240514 \345\210\235\350\257\206linux.md" @@ -0,0 +1,52 @@ +# linux + +一种操作系统内核,有centos,debian,redhat等。 + +## 安装 + +安装vm17,安装debian iso文件。 + +## 命令 + +### 查看ip地址: + +第一种:ip addr show + +第二种: + +apt-get update + +apt-get install net-tools + +ifconfig + +### ssh: + +apt-get install ssh + +apt-get install vim + +vim /etc/ssh/sshd_config + +port 22 打开端口 + +permitrootlogin yes 启用root登录 + +passwordauthentication yes 验证密码 + +permitemptypasswords no 禁止使用空密码登录 + +/etc/init.d/ssh restart + +### sudo: + +su root 更换给root模式 + +apt-get install sudo + +sudo vim /etc/sudoers + +root all=(all:all) all + +用户名 all=(all:all) all 添加用户名 + -- Gitee From 6a8945a3e03f6dbce31267d3923112c8708264e4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8B=8F=E6=B8=85=E5=8D=8E?= <1463670799@qq.com> Date: Sat, 18 May 2024 21:58:29 +0800 Subject: [PATCH 5/5] =?UTF-8?q?240516=E7=AC=94=E8=AE=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../240516 \347\233\256\345\275\225.md" | 147 ++++++++++++++++++ 1 file changed, 147 insertions(+) create mode 100644 "52 \350\213\217\346\270\205\345\215\216/240516 \347\233\256\345\275\225.md" diff --git "a/52 \350\213\217\346\270\205\345\215\216/240516 \347\233\256\345\275\225.md" "b/52 \350\213\217\346\270\205\345\215\216/240516 \347\233\256\345\275\225.md" new file mode 100644 index 0000000..9442371 --- /dev/null +++ "b/52 \350\213\217\346\270\205\345\215\216/240516 \347\233\256\345\275\225.md" @@ -0,0 +1,147 @@ +# 目录 + +## / + +根目录。 + +## /bin + +binary,可执行文件。存放常用的基本命令。 + +## /boot + +引导加载程序和内核文件。 + +## /dev + +设备文件。 + +例如:/dev/sda 硬盘设备文件 /dev/ttyUSB0 USB串行设备文件 + +## /etc + +配置文件。包括网络配置,Nginx,ssh等。 + +## /home + +普通用户的家目录。 + +## /lib + +系统共享库文件。 + +## /media + +可移动介质的挂载点。usb或者cdrom。 + +## /mnt + +手动挂载临时文件系统。 + +## /opt + +第三方软件包安装目录。 + +## /proc + +虚拟文件,有系统和运行进程的信息。例如cpu,内存。 + +## /root + +root用户的家目录。 + +## /run + +运行时的临时文件目录。 + +## /sbin + +root才能操作的系统管理命令。 + +## /srv + +服务的数据目录。 + +## /sys + +虚拟文件系统。有关硬件的,例如网卡。 + +## /tmp + +临时文件目录。 + +## /usr + +用户安装的程序和文件。 + +## /var + +日志文件缓存文件等经常变化的文件。 + +# 命令 + +人类通过终端控制硬件,linux默认使用的终端是bash。shell与bash是包含与被包含的关系。 + +优势: + +通过上下方向键调取执行过的Linux命令。 + +命令或参数仅需输入前几位就可以用tab补全。 + +## 命令格式 + +命令名称 [命令选项] [命令参数] + +命令名称:想要做的事情,例如创建,查看等。 + +命令选项:对命令进行调整,例如-l,-a等。 + +命令参数:指要处理的文件,目录等。 + +命令选项的长短格式: + +--help 长 -- + +-h 短 - + +例如: + +列出目录内容:ls -l /home/debian1ban + +ls是命令,-l是选项,/home/user是参数 + +复制文件:cp debian.txt dabian.txt + +cp是命令,debian.txt,dabian.txt是参数 + +## man + +man命令是用来访问unix/linux手册页的。手册页系统命令、函数、库调用等的文档,提供了关于如何使用这些命令和功能的详细信息。 + +如何使用: + +查看ls命令的手册页:man ls + +运行后会看到: + +name 简要描述了命令或函数。 + +synopsis 展示了命令的基本用法和语法。 + +description 详细描述了命令或函数的功能。 + +option 列出了命令或函数的可用选项。 + +examples 给出使用的示例。 + +see also 列出其他。 + +## 快捷键 + +tab 补全命令。 + +ctrl+c 终止当前进程的运行。 + +ctrl+d 键盘输入结束。 + +ctrl+l 清屏。 -- Gitee