码迷,mamicode.com
首页 > 系统相关 > 详细

linux基本操作

时间:2020-02-24 22:15:09      阅读:90      评论:0      收藏:0      [点我收藏+]

标签:文件夹   mkdir   pre   make   df -h   conf   yun   torrent   地址   

技术图片

  1. 查看系统、内核
cat /etc/redhat-release     //查看系统
uname -r                    //查看内核
  1. 查看CPU
grep "CPU" /proc/cpuinfo
  1. 运行时间
uptime
  1. 查看系统位数
getconf LONG_BIT
  1. 查看硬盘和分区
df -h
  1. 软件安装与卸载
yum update  //更新系统
yum makecache 软件名   //更新软件源缓存
yum search 软件名      //搜索软件
yum install 软件名     //安装软件
yum remove  软件名     //下载软件
  1. 软件的管理
service 软件名 start   //启动
service 软件名 restart //重启
service 软件名 stop    //关闭
service 软件名 status  //状态
  1. 文件与文件夹管理
touch 文件名           //创建文件
mkdir -p a/b/c/d      //递归创建文件夹
cp a.a b.b            //复制文件
mv a.a c.c            //重命名或者复制(同一文件夹下为复制)
chmod 0755 d          //目录权限修改
chown -R 用户名:用户组 e  //目录归属
rm a.bc -rf           //删除文件或文件夹
ls                      //列出当前目录的内容
cd ..                   //返回上一级目录
cd ~                    //回到家目录/root
cd /root/Desktop        //进入桌面目录
  1. 文件的下载
weget http://下载地址
例:
    wget https://mirrors.aliyun.com/centos/7.3.1611/isos/x86_64/CentOS-7-x86_64-DVD-1611.torrent
  1. 压缩和解压
tar zcvf 压缩包名.tar.gz        //压缩
tar zxvf 压缩包名.tar.gz        //解压(由解压文件显示)
tar xzf  压缩包名.tar.gz        //解压(无文件显示)
  1. 显示当前的路径
pwd
  1. 关机与重启
init 0                      //在root模式下关机
reboot                      //重启
shutdown -h 20              //20分钟后关机
shutdown -h 20 $            //20分钟后关机并在后台运行

linux基本操作

标签:文件夹   mkdir   pre   make   df -h   conf   yun   torrent   地址   

原文地址:https://blog.51cto.com/13909428/2473265

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!