[Linux] 3 Linux 操作文件目录

Linux 操作文件目录

Posted by Mr.Vincent on 2019-07-14
Estimated Reading Time 1 Minutes
Words 285 In Total
Viewed Times

基础命令

命令 说明 语法 参数 参数说明
ls 显示文件和目录列表 ls [-alrtAFR] [name…]
-l 列出文件的详细信息
-a 列出当前目录所有文件,包含隐藏文件
mkdir 创建目录 mkdir [-p] dirName
-p 父目录不存在情况下先生成父目录
cd 切换目录 cd [dirName]
touch 生成一个空文件
echo 生成一个带内容文件 echo abcd > 1.txt,echo 1234 >> 1.txt
cat 显示文本文件内容 cat [-AbeEnstTuv] [–help] [–version] fileName
cp 复制文件或目录 cp [options] source dest
rm 删除文件 rm [options] name…
-f 强制删除文件或目录
-r 同时删除该目录下的所有文件
mv 移动文件或目录 mv [options] source dest
find 在文件系统中查找指定的文件
-name 文件名
grep 在指定的文本文件中查找指定的字符串
tree 用于以树状图列出目录的内容
pwd 显示当前工作目录
ln 建立软链接
more 分页显示文本文件内容
head 显示文件开头内容
tail 显示文件结尾内容
-f 跟踪输出

If you like this blog or find it useful for you, you are welcome to comment on it. You are also welcome to share this blog, so that more people can participate in it. If the images used in the blog infringe your copyright, please contact the author to delete them. Thank you !