linux常用命令
poweroff关机
halt关机
reboot重启
运行程序
./main
sh hello.sh
python hello.py
切换目录
cd /home 进入home目录
mkdir hello创建hello这个文件夹
复制
cp hello.c //usr 复制当前目录的hello.c 到usr目录
剪切
mv hello.c //usr剪切当前目录的hello.c 到usr目录
查看
ls 列出当前目录所以文件
删除
rm -rf hello.c 删除hello.c
压缩解压
tar -czvf hello.tar.gz hello.c压缩为hello.tar.gz文件
tar -xzvf hello.tar.gz解压
zip
zip -r test.zip tmb/ 压缩tmb目录为test.zip
unzip
unzip test.zip 解压test.zip
USB相关
lsusb查看usb状态
mount /dev/sda1 /mnt 挂载sda1到mnt目录,sda1一般为u盘或者sd卡
网络
ifconfig查看网卡
ifconfig up wlan0启动无线网卡
ifconfig down eth0关闭有线网卡
输入命令或者路径的时候按tab键可以自动补齐
终端按上键会弹出上次输入的命令