不言不语

您现在的位置是: 首页 >  Linux

Linux

LINUX之基本命令

2020-05-05Linux
LINUX的基本命令以及用法

使用之前先打快照


1.关机

halt

poweroff

init 0

shutdown -h now


2.重启

reboot

init 6


3.操作命令

cat /etc/redhat-release  ---查看版本

uname -a   或者uname  ----查看内核版本

top   ---查看服务器负载,退出q或者ctrl+c

free -m   查看运行状态(cpu,内存相关)

uptime    ---也能查负载均衡

ifconfig    ----查看ip

netstat -nltp    ----查看端口

yum install net-tools  ----查看进程()

注:使用命令netstat时,提示netstat: command not found,需要执行:yum install net-tools


文件操作

mkdir   ---创建文件夹

echo 'hello word' >hehe.php   ----创建文件

touch    ----创建文件

cat   ----不打开文件,直接查看文件内容

rm -f    -----删除文件

rm -f *   -----删除当前目录所有文件

rm -rf    -----删除文件夹

mv 名字/目录/从命名   -----剪贴移动到另外一个位置

cp   ------拷贝

cp -r 文件夹名字------复制文件夹 

cd    ----当前用户的家目录

who    ---查看链接服务器的用户

head 文件  -----只显示前10行

head -n 20 文件名

find 路径 -name '搜索的名字'

unzio    -----解压zip压缩包

ll----列

ls----行

ll-s

cd ..  -- 返回上一级

date ---当前时间

yum install ---下载安装

quit    --退出

man   ---查看命令使用

bc   --计算器

ip addr   ---查看ip

ifconfig ----查看Ip

vi    ----打开文件,类似于windos下面的记事本

ll -a    ----列出隐藏文件

rz     -----将本地文件批量上传到远程Linux/Unix服务器,注意不能上传文件夹。

pwd    ---查看当前目录


image.png

文章评论