很多朋友在学习我的上一篇Linux编程时,发现对Linux不熟悉,以及常用命令等都不懂,下面来介绍一些Linux的基本用法。
首先我们可以运行
who 查看当前登录到Linux的用户有哪些,查看自己用whoami,记得没有空格!
cd 切换目录,例如 cd /tmp
mv 移动操作,例如 mv /tmp/hello /tmp/thank
rm 删除操作,例如 rm -rf /tmp/hello
cp 复制操作,例如 cp hello.c /tmp
vi 文档编辑器,例如 vi hello.c
ls 文件检索工具,例如 ls -l
touch 新建文件操作,例如 touch hello.c
mkdir 新建文件夹操作,例如 mkdir /hi
chmod 权限更改,例如 chmod -R 777 hello
cat 复制文档的内容在屏幕上打印(不能更改),例如 cat hello.c
ifconfig 查看网卡适配器,例如 ifconfig eth0
passwd 更改用户密码,例如 passwd root
sudo 使用超级权限运行,例如 sudo passwd root
发表评论: