02_Linux基础-文件系统层次结构-提示符-进程-隐藏文件-通配符-绝对相对路径-其他基础命令
上次更新在 927 天之前,本文的内容可能过时。
文章摘要
TianliGPT
这篇文章介绍了Linux基础知识,包括文件系统层次结构、提示符、进程、隐藏文件、通配符和绝对相对路径等。文章详细介绍了一些常用的基础命令,如ls、mkdir、cd等,以及目录结构、进程、隐藏文件等相关内容。还介绍了通配符的使用方法和绝对路径、相对路径的区别等内容。
一. 基本命令
ls
plaintext
1 | ls --- 查看文件夹内容 ==> list |
ls -l
plaintext
1 | // ls -l 显示文件的详细信息 |
plaintext
1 | // ls -l 显示文件的详细信息 (大概能看到文件时间 ,不详细) |
其他参数
plaintext
1 | -l 显示文件的详细信息 |
plaintext
1 | // ls -a 显示所有的文件和文件夹 包括 . 和 .. |
mkdir
plaintext
1 | mkdir --- 新建文件夹 ==> make directory(目录) |
plaintext
1 | --- windows下 |
mkdir -p
plaintext
1 | // mkdir -p ( -P 的作用 ) |
plaintext
1 | // -p, --parents [ 选项 ] |
cd
plaintext
1 | cd --- 进入目录 ==> change directory to other directory |
pwd
plaintext
1 | pwd --- 显示当前所在路径 |
man
plaintext
1 | man --- 查询命令的使用手册(指南) |
. & …
plaintext
1 | . --- 代表当前目录 |
useradd
plaintext
1 | useradd cpen --- 新建一个普通用户 |
plaintext
1 | root用户的家目录在/root |
su & exit
plaintext
1 | --- su - cpen 切换用户登录 |
rm -rf
plaintext
1 | --- rm -rf 删除 |
bash
1 | [root@localhost china]# rm -rf jiangxi/ 删除数据一定要注意,非常不安全 |
rm -rf *
plaintext
1 | rm -rf * |
tree
plaintext
1 | yum install tree -y |
tab
plaintext
1 | --- 文件路径补齐:tab键 |
passwd
plaintext
1 | // 给用户设置密码 passwd username |
plaintext
1 | 回文 |
w
plaintext
1 | // 查看有哪些用户登录在linux系统里 w |
ssh
plaintext
1 | // ssh ip地址 连接到相同网段 的主机上 |
Ctrl + L
plaintext
1 | // 清屏 Ctrl + L |
touch
plaintext
1 | // touch |
date
plaintext
1 | //更新时间 |
plaintext
1 | // date 查看当前时间 |
stat
plaintext
1 | // stat 查看文件的状态(详细信息) |
cp
plaintext
1 | // cp 复制(复制的同时会粘贴) copy |
plaintext
1 | // cp -r |
plaintext
1 | // 复制原来有的文件,提示:是否覆盖 |
mv
plaintext
1 | // mv mv - move (rename) files |
plaintext
1 | 1.移动 外面就没有这些文件了 |
plaintext
1 | 2.重命名 |
du -sh
plaintext
1 | #注:查看的是所有文件 汇总的大小,而不是分开的文件 |
二. 目录结构
plaintext
1 | Linux目录结构 |
家目录
plaintext
1 | /root 是root用户的家目录 |
plaintext
1 | --- ~ 所在路径是用户的家目录 |
文件系统层次结构
plaintext
1 | // linux 文件系统层次结构 |
plaintext
1 | // 危险操作,不能做 |
三. 提示符
plaintext
1 | 提示符 |
四. 进程
plaintext
1 | // 进程 子进程、父进程 |
五. 通用命令格式
plaintext
1 | // linux命令的通用命令格式 |
六. 隐藏文件
plaintext
1 | // . 开头的文件在linux下是隐藏文件 |
七. *
plaintext
1 | // * 是通配符:代表所有的文件 |
plaintext
1 | // 选项可以组合,一般不分先后顺序 |
plaintext
1 | // 一般不分先后顺序 |
plaintext
1 | // 既没有参数,也没有选项,看当前 . |
八. * ? 通配符
plaintext
1 | // rm -rf 删除 |
九. 绝对路径、相对路径
plaintext
1 | // 相对路径 和 绝对路径 |
plaintext
1 | // cd ./hunan(不要这么写) 和 cd hunan 效果一样 |
十.
bash
1 | #注:这些操作也可以↓ |
plaintext
1 | // rm -rf hunan* 删除上面建的文件 |
本博客所有文章除特别声明外,均采用 CC BY-NC-SA 4.0 许可协议,转载请注明来自 Mycpen
- 感谢你赐予我前进的力量
赞助列表
因为你们的支持让我意识到写文章的价值🙏
评论
匿名评论
隐私协议