Common Commands (CentOS 7)

Basic Configuration

Query or System Locale                                                    localectl
Display the Current Time and Date                               date timedatectl
Sync Date and Time                                                          timedatectl
Configure SSH                                                                   /etc/ssh/ssh_config
                                                                                              /etc/ssh/sshd_config

 

Jobs and Services

List all Services                                                                     systemctl -at service
                                                                                                 ls /etc/systemd/system/*.service
                                                                                                 ls /usr/lib/systemd/system/*.service
List Services that are Running                                          systemctl -t service –state=active
Start and Stop services. Replace <service>                    with systemctl start <service>
with the name of the service                                              systemctl disable <service>
Enable and Disable Services. Replace <service>          systemctl enable <service>
with the name of the service                                              systemctl disable <service>
Check Service Status. Replace <service>
with the service name                                                         systemctl status <service>
Check Service Status. Replace <service>
with the service name                                                         systemctl status <service>
See if a Service is Enabled.
Replace <service>                                                                systemctl is-enabled <service>
Configure Logs                                                                     /etc/rsyslog.conf
                                                                                                /etc/rsyslog.d/*.conf
View Logs                                                                             /var/log journalctl
Find Files                                                                               find
Create Archive                                                                      tar
                                                                                                 cpio

  • 2 Users Found This Useful
Was this answer helpful?

Related Articles

How can I configure a ip range in CentOS7?

You have to use a range file Edit /etc/sysconfig/network-scripts/ifcfg-enp0s3 and make...

Adding a Public IPv6 Address to a Linux Server (CentOS 7)

To configure an additional public IPv6 address in CentOS 7, proceed as follows:...

How To Install EPEL Repository On CentOS And RHEL 7

How to install EPEL for Centos 7 [root@localhost ~]# cat  /etc/centos-release CentOS Linux...

Install LAMP Stack on CentOS 7

Install LAMP Stack on CentOS 7 One of the most simple and barebones solutions you can have for...