1.ls命令
2.切换目录
3.mkdir
例如代码
mkdir -p a/b/c
在上面就是创建了a/b/c的递归文件夹
4.rm命令符
5.拷贝或者移动文件
以上三个命令具体使用方法
cp ./lao/lao.txt . 在这里表示将lao下面的lao.txt文件复制到当前目录当中
复制目录记得要加上-r
grep命令:
基本格式:grep "***" [文件夹名字]
laozhichi@laozhichi-virtual-machine:~/桌面$ touch laozhichi.txt laozhichi@laozhichi-virtual-machine:~/桌面$ grep as laozhichi.txt dasdaf asasasasas ugcgc fhcsdifhvdsfhsofhsoas laozhichi@laozhichi-virtual-machine:~/桌面$ grep -n as laozhichi.txt 1:dasdaf asasasasas ugcgc 2:fhcsdifhvdsfhsofhsoas laozhichi@laozhichi-virtual-machine:~/桌面$ grep -n as laozhichi.txt 1:dasdaf asasasasas ugcgc 2:fhcsdifhvdsfhsofhsoas laozhichi@laozhichi-virtual-machine:~/桌面$ grep -v as laozhichi.txt weewe laozhichi@laozhichi-virtual-machine:~/桌面$ grep -vn as laozhichi.txt 3:weewe laozhichi@laozhichi-virtual-machine:~/桌面$
laozhichi@laozhichi-virtual-machine:~/桌面$ grep ^d laozhichi.txt dasdaf asasasasas ugcgc laozhichi@laozhichi-virtual-machine:~/桌面$ grep s$ laozhichi.txt fhcsdifhvdsfhsofhsoas laozhichi@laozhichi-virtual-machine:~/桌面$ grep -n s$ laozhichi.txt 2:fhcsdifhvdsfhsofhsoas
6.echo重定向
echo laozhichi >lao.txt //在这里表示将laozhichi全新添加到lao.txt文件当中,注意以前文件当中是没有内容的 echo laozhichi >>lao.txt //在这里表示将laozhichi追加到lao.txt文件当中
7.查看文件内容
cat lao.txt //在这里表示打开lao.txt文件 more lao.txt //在这里表示以分屏方式打开lao.txt文件