美文网首页
Linux 常用命令与设置 (CentOS7)

Linux 常用命令与设置 (CentOS7)

作者: 恒忏 | 来源:发表于2017-12-27 19:53 被阅读0次

CentOS7 最小化安装.也有近1个 G...830M

ifconfig 已经过时了。
改用“ip addr”和“ip link”命令来查找网卡详情。
要知道统计数据,可以使用“ip -s link”。

network is not running after installation ...

vi /etc/sysconfig/network-scripts/ifcfg-eth0s3
### edit=> ONBOOT="yes" 
systemctl restart network
bash:Bourne Again Shell(/bin/bash)
默认 Shell

```# 注释```
单行注释的写法

```echo $SHELL ```
当前 SHELL 的名称,例如:/bin/bash

```find / -name hell*```
从根目录开始,递归子目录,查找文件 hell*.*

软件包管理:
apt-get:Ubuntu.软件包管理工具
brew:macOS.apt-get...
yum:RedHat.apt-get...

yum -y install net-tools
yum -y install docker
yum -y install go

systemctl 是系统服务管理器命令,它实际上将 service 和 chkconfig 这两个命令组合到一起。

任务  旧指令 新指令
使某服务自动启动    chkconfig –level 3 httpd on systemctl enable httpd.service
使某服务不自动启动   chkconfig –level 3 httpd off    systemctl disable httpd.service
检查服务状态  service httpd status    systemctl status httpd.service (服务详细信息) systemctl is-active httpd.service (仅显示是否 Active)
显示所有已启动的服务  chkconfig –list systemctl list-units –type=service
启动某服务   service httpd start systemctl start httpd.service
停止某服务   service httpd stop  systemctl stop httpd.service
重启某服务   service httpd restart   systemctl restart httpd.service

//centos 查看所有运行中的服务的详细信息命令:
netstat -tunpl
ps -aux | grep YourKeyWordToSearch


Q:how to know OS Name?

lsb_release -a
cat /etc/os-release
cat /etc/redhat-release


Q:How to show disk space?
A:```df``` NOT ```dd```.

Q:df only show one disk. how to show another bigger disk?
A:```fdisk -l```

Q:如何限制一个命令执行的时间?
```timeout 1s ls```

SSH.DSA
---
Your identification has been saved in /root/.ssh/id_rsa.   
Your public key has been saved in /root/.ssh/id_rsa.pub.

dsa is not supported by default.

To compatible dsa, you need to add below line:
```PubkeyAcceptedKeyTypes +ssh-dss```
into your ~/.ssh/config

cat ~/.ssh/config
PubkeyAcceptedKeyTypes +ssh-dss

DNS:
---

//to set dns:
sudo su -
nmcli con mod enp4s0 ipv4.dns "202.99.192.66 202.99.192.68 8.8.4.4 8.8.8.8"
nmcli con up enp4s0

nmcli dev show enp4s0

# 在shell 中,将某个文件复制成一百个文件
for (( i=1; i<=100; i++ ))  
do
    cp bg.jpg bg$i.jpg
done

相关文章

  • http://mirrors.aliyun.com/centos

    我遇到的问题 是Linux没有设置DNS,按照以下教程设置DNS后即可。 设置DNS:Linux Centos7添...

  • Linux 常用命令与设置 (CentOS7)

    CentOS7 最小化安装.也有近1个 G...830M ifconfig 已经过时了。改用“ip addr”和...

  • 常用命令

    linux 常用命令 @(Linux)[linux, 解压, 压缩] [TOC] 登录服务器 登录服务器并设置可显...

  • 大数据技术学习路线

    一、大数据技术基础1、linux操作基础 linux系统简介与安装linux常用命令–文件操作linux常用命令–...

  • Linux学习笔记

    Linux常用命令 Linux显示隐藏文件 Linux网络设置 dns服务解析域名配置 临时设定ip相关配置 添加...

  • centos下iptables的使用

    centos7默认情况下使用firewalld,关闭iptabels. 设置开机启动 常用命令 开放端口 创建IP...

  • 其他

    Git常用命令mac常用命令Linux 常用命令汇总Linux 常用命令0Linux 常用命令1--ls命令

  • CentOS7 MySQL / Redis 开机启动

    CentOS7 MySQL开机启动 #设置为linux系统服务[root@localhost ~]# cp /us...

  • Linux 常用命令汇总

    Linux 常用命令0Linux 常用命令1--ls命令 参考 Linux 常用命令汇总

  • Linux免密登陆

    参考 Linux机器之间免密登录设置 1. 配置两台Linux服务器,均为Centos7 master: 192....

网友评论

      本文标题:Linux 常用命令与设置 (CentOS7)

      本文链接:https://www.haomeiwen.com/subject/ithpgxtx.html