Linux文件目录操作指令
進(jìn)入 home/itcast 目錄
?cd /home/itcast
ls 顯示目錄內(nèi)容:
?ls
mkdir 創(chuàng)建一個(gè)目錄 家庭A:
?mkdir familyA
?
cd 切換目錄 進(jìn)入familyA 目錄:
?cd familyA
ls 顯示當(dāng)前目錄內(nèi)容:
?ls
touch 新建空文件
?
?touch father.txt 家庭A中有一個(gè)父親
?touch mother.txt 有一個(gè)母親
?touch son.txt 兒子
?touch daughter.txt 女兒
mkdir 創(chuàng)建一個(gè)目錄
?mkdir house 房子
cd 切換目錄
?cd house
mkdir 創(chuàng)建目錄
?mkdir kitchen 廚房
?mkdir bathroom 衛(wèi)生間
?mkdir roomA
?mkdir roomB
?mkdir roomC
?touch sofa.txt 沙發(fā)
ls 顯示目錄內(nèi)容:
?ls 顯示
cd 切換目錄
?cd roomB
touch 新建空文件
?touch bed.txt
?echo "Your are the best boy." > book.txt 建立帶簡(jiǎn)單內(nèi)容的文件
?cat book.txt 查看文件內(nèi)容
cd 切換目錄
?cd .. 返回上一級(jí)目錄
?cd roomC
touch 新建空文件
?touch bed.txt
?echo "Your are the best girl." > book.txt
?cat book.txt
?touch doll.txt
cp 拷貝文件
?cp doll.txt /home/itcast/familyA/house/roomB
cd 切換目錄
?cd ..
?cd roomB
ls 顯示目錄內(nèi)容:
?ls 顯示
cd 切換目錄
?cd ..
mv 移動(dòng)文件
?mv sofa.txt /home/itcast/familyA/house/roomB
cd 切換目錄
?cd roomB
ls 顯示目錄內(nèi)容:
?ls 顯示
rm 刪除文件目錄
?rm doll.txt
?
more less 分頁(yè)顯示
?more book.txt
wc 顯示文檔行數(shù),字?jǐn)?shù),字符數(shù)
?wc book.txt
find 查找指定的文件
?find -name book.txt
grep 查找指定字符串
?grep best book.txt
pwd 顯示當(dāng)前目錄
tree 顯示目錄樹(shù)
rmdir 刪除空目錄
?rmdir bathroom
ln -s 建立軟連接
?ln -s /home/itcast/familyA/house/roomB /home/roomB
?
總結(jié)
以上是生活随笔為你收集整理的Linux文件目录操作指令的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。
- 上一篇: 节假日可以去办理交房子首付吗?
- 下一篇: Linux下和Windows下创建Ora