Linux相关笔记

1.windows用Putty来远程管理服务器,下载地址:https://www.chiark.greenend.org.uk/~sgtatham/putty/

2.Mac用自带的命令行工具就可以,口令:ssh root@xx.xx.xx.xx

3.常用命令(基于CentOS)

# df -hl   查看磁盘使用情况

cat /etc/redhat-release  查看系统版本信息

rpm -qa |grep xxx  查看软件是否安装

mysql -u root -p  使用密码登录root账户

grant all privileges on oneinstack.* to caigouser@'localhost' identified by 'caigo888';

alter user 'root'@'localhost' identified by 'Lei_0916';

yum -y update  更新系统,需要常常进行

netstat -lntp #查看监听(Listen)的端口

netstat -antp #查看所有建立的TCP连接

安装nginx提前要做的步骤:http://nginx.org/en/linux_packages.html#stable
1)在/etc/yum.repos.d/下添加nginx.repo,内容是
[nginx]
name=nginx repo
baseurl=http://nginx.org/packages/OS/OSRELEASE/$basearch/
gpgcheck=0
enabled=1
注意:Replace “OS” with “rhel” or “centos”, depending on the distribution used, and “OSRELEASE” with “6” or “7”, for 6.x or 7.x versions, respectively.
2)yum -y install nginx
3)nginx -t 查看信息
4)/bin/systemctl stop|start|restart nginx.service   新版命令

有用安装rpm:https://dl.iuscommunity.org/pub/ius/stable/Redhat/7/x86_64/

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容