whoami ---打印出当前用户名
man <命令> ---查看命令手册
man whoami
clear ---清屏
pwd ---查看当前目录位置
ls ---打印出当前目录下的文件
ls -l ---打印的内容更加详细
cd 目录 ---切换目录
mkdir ---创建目录
rmdir ---删除目录
rm - remove files or directories删除文件
touch -- change file timestamps改变文件的时间戳/创建文件
mv - move (rename) files移动或重命名文件
cp - copy files and directories复制文件
head - output the first part of files展示文件内容最前面部分
tail - output the last part of files展示文件内容后面部分
date -查看时间
cat - concatenate files and print on the standard output连接文件输出到标准输出/查看文件内容
less - opposite of more更好的查看文件
echo - display a line of text有点像printf函数
wc - print newline, word, and byte counts for each file查看文件行数,字数,大小
sort - sort lines of text files对文本内容排序
history --查看过往命令
| -管道接受前面传来的参数
xargs --接受管道传来的参数
> -重定向覆盖
>> -重定向添加
du - estimate file space usage
ps - report a snapshot of the current processes.查看当前进程
kill -杀死进程
jobs-查看工作
fg -前台工作
bg -后台工作
gzip -k 文件 --压缩文件并保留原文件
gzip -d 文件 --解压缩文件
gzip -k env.txt
gzip -d env.txt.gz
tar -cf new.tar env.txt error.txt right.txt 存档
tar -xf new.tar 解档
tar -czf new.tar env.txt error.txt right.txt 存档并压缩
tar -xf new.tar 解档并解压缩
nano -文本编辑器
好用
find - search for files in a directory hierarchy查找文件目录
grep - print lines that match patterns查看文件内的内容
*代表任意占位符
?代表一个占位符
su -切换用户
sudo -升级为root权限
passwd -更改密码
chown - change file owner and group更改文件的所有者
chmod -设置文件u,g,o的r,w,x,权限
ln - make links between files注意软链接和硬链接
参考感谢:freeCodeCamp.org