sh centos_linux_commands.sh

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了sh centos_linux_commands.sh相关的知识,希望对你有一定的参考价值。

# Renew dhcp ip address
sudo dhclient -r
sudo dhclient
sudo dhclient -r eth0
sudo dhclient eth0

# Find runlevel of the system (multi-user.target=runlevel3, graphical.target=runlevel5)
systemctl get-default

# Set runlevel
systemctl set-default graphical.target

# View running services
service --status-all
chkconfig --list

# Cli gui to set startup services
ntsysv

# Cli to start/stop a service on startup
sudo chkconfig mongod off
sudo chkconfig mongod on

# Start service
sudo service rabbitmq-server start

# View open ports and the service using them
sudo netstat -tulpn

# Is the firewall running
firewall-cmd --state

# Which firewall zone are you using
firewall-cmd --get-active-zones

# View allowed firewall ports
firewall-cmd --list-ports

# Add firewall port
firewall-cmd --zone=public --add-port=2888/tcp --permanent
firewall-cmd --reload

# Disable / Stop / Status / Start / Enable of firewalld
systemctl disable firewalld
systemctl stop firewalld
systemctl status firewalld
systemctl start firewalld
systemctl enable firewalld

# List users in rabbitmq
sudo rabbitmqctl list_users

# Add user to rabbitmq
sudo rabbitmqctl add_user username1 password1

# Make a user administrator inrabbitmq
sudo rabbitmqctl set_user_tags username1 administrator

# Copy a folder
cp -r /home/hope/files/* /home/hope/backup

# Install Gnome
yum groups install "GNOME Desktop"
startx
systemctl set-default graphical.target

# Turn off SELinux
vim /etc/sysconfig/selinux
SELINUX=disabled

# Open file up in chrome from CMD
google-chrome index.html

# Quick view of system resource usage
free -h

# Create symbolic link
ln -s path/target path/source

# View file location of running process
ps -ef | grep node

以上是关于sh centos_linux_commands.sh的主要内容,如果未能解决你的问题,请参考以下文章

如何使我的命令行在具有扩展名(.sh)和名称如“weird.sh.sh.sh”的文件上工作

sh sh_template.sh

sh sh.sh

Linux下面如何运行 SH文件

配置告警系统主脚本main.sh mon.sh load.sh 502.sh disk.sh

shell 脚本各种执行方式(source ./*.sh, . ./*.sh, ./*.sh)的区别