1、复制文件
cp -v A B (将A复制到B文件或者B路径)
2、移动文件
mv 文件夹(文件)路径A 路径B (将文件(文件夹)A 移动到B位置或者文件)
3、查找文件
1)find . -name "*.c" (在本文件夹下查找c文件)
2)find . -name "*.c"|xargs grep --color=auto hello (在查找中的c文件中查找hello字符串,字符串标记颜色)
4、查找字符串
grep -rn "hello,world!" * (加行号查找字符串)
5、查找文件夹
find /(查找范围) -name '查找关键字' -type d
6、将查找到的文件复制到一个文件夹下
1)find . -name "*.o"|xargs -i cp {} myofile (myofile为复制到的位置的文件夹)
2)find . -name "*.o"|xargs -i cp --parent {} myofile (带文件夹一起复制)
7、编写文件
vi test.txt
8、查看文件
cat test.txt
9、解压文件
1)tar -xvf xxx.tar.gz -c /test/ (解压在test文件夹下)
2)unzip -q -o $1 -d $2 (参数1为需要解压的文件,参数2为解压地址)
10、压缩文件
zip -r xxx.zip ./*
11、移除文件
rm -rf test
12、改变文件权限
chmod 777 test.txt
13、echo写入参数
1)echo 1 > /tmp/test.txt 覆盖写入
2)echo 1 >> /tmp/test.txt 叠加写入
14、新建文件夹
mkdir test
15、删除文件夹
rmdir test
16、新建文件
touch test.txt
17、logcat使用
1) logcat -c;logcat -v time > tmp/mylog.log 重定向抓包
2)logcat | grep -e Dual -e NetworkLineRecevier 多字符串筛选
18、截图
screenshot -i tmp/login.png