本文共 770 字,大约阅读时间需要 2 分钟。
使用pwd命令可以查看当前工作目录。
~ 表示用户主目录。... 表示返回上一级目录。touch命令创建文件: touch fileA
也可以批量创建:
touch file{1..5}.txt mkdir命令创建文件夹: mkdir -p path/to/directory
-p选项支持创建多级目录。
cp fileA directory/
cp -r directoryA /path/to/destination
rm fileA
rm -f fileA
rm -r directoryA
mv fileA directoryA
mv fileA newFileName
rename命令批量重命名文件: rename *.txt *.txt
例如,将所有 .txt 文件重命名为 .oldtxt。
cat fileA
tac fileA
cat -n fileA
more fileA
file fileA
vim编辑文件,适用于文本文件的编辑操作。mkdir -p /var/www/forum && cd /var/www/forum
rm -f /path/to/file*.txt
mkdir -p /var/www/{app,lib,config} 转载地址:http://ecahz.baihongyu.com/