Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What are the basic commands of RHEL7?

2025-03-31 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/02 Report--

Today, I would like to talk to you about the basic commands of RHEL7, which may not be well understood by many people. in order to make you understand better, the editor has summarized the following for you. I hope you can get something from this article.

The words in this section are sorted out:

Termnial: terminal network-scripts network script passwd password file

Nologin forbids logging in to shutdown shutdown reboot restart poweroff shutdown

Grep filter localhost Native useradd add users

Commonly used keyboard shortcuts:

Ctrl+shift+T New pseudo Terminal

Alt + digital key terminal handoff

Alt + F4 close the terminal

Zoom in: ctrl+shift+ +

Zoom out: ctrl+-

Lab: use ssh remotely to view pts

[root@xinsz608~] # ps-aux | grep pts

User name PID virtual terminal

Root 39741 0.0 0.0 116676 3348 pts/0 Ss+ 20:52 0:00 / bin/bash

Root 39794 0.0 0.0 116676 3268 pts/1 Ss+ 20:54 0:00 bash

Root 39839 0.1 0.1 149740 5968? Ss 20:55 0:00 sshd: root@pts/2

1.ls command

Function: check what files are in the current directory

Syntax: ls directory, if you don't add a directory to view the current directory

Parameters:

-l display shortcuts in the details system # ll=ls-l

-a show hidden files

-d View the directory (do not check the contents)

-h enhanced readability

For example:

[root@localhost ~] # ls-l / etc/passwd

-rw-r--r-- 1 root root 2047Nov 25 20:43 / etc/passwd

[root@localhost ~] # ls-lh / etc/passwd

-rw-r--r-- 1 root root 2.0KNov 25 20:43 / etc/passwd

Different colors in linux system represent different file types.

Blue directory / etc

Black file / etc/passwd

Light blue link / etc/grub2.cfg

Red compressed package boot.tar.gz

Green executable file / etc/init.d/network

Black background yellow letter device file / dev/sda

two。

View system and BIOS hardware time:

Refers to bios time (Grinitz Observatory)

[root@xuegod60 ~] # hwclock

Thu 28 Jan 2016 05:34:24 AMCST-0.943039 seconds

View system time

[root@xuegod60 ~] # date

Wed Jan 27 21:34:42 CST 2016

3. Shutdown command

Shutdown

Function: shutdown, restart, timing shutdown

Syntax: shutdown [options]

-r = > restart the computer

-h = > turn off the computer

-h + time = > timing shutdown

-c = > cancel the previous scheduled shutdown or ctrl+c

[root@xuegod60] # shutdown-h + 10

Turn it off in 10 minutes.

[root@xuegod60 ~] # shutdown-h 23:30

Specify a specific time point for shutdown

[root@xuegod60] # shutdown-h now

Turn off the computer immediately

Shutdown-r now restart immediately

Shutdown-r + 10 # restart in 10 minutes

Shutdown-r 22:22 # restart after 22:22

Init command

(this is an order from rhel6)

Function: toggle system run level

Syntax: init 0-6

7 startup levels for Linux:

0 system downtime mode, the default running level of the system cannot be set to 0, otherwise it cannot start normally and the machine shuts down.

1 single-user mode, root authority, for system maintenance, prohibit remote login, just like the secure mode login under Windows.

2 multi-user mode, no NFS network support.

3 complete multi-user text mode, with NFS, enter the command line mode of the console after login.

4 the system is not in use, it is generally not used, and it can be used to do something in some special cases. For example, when the laptop battery runs out, you can switch to this mode to make some settings.

(5) graphical mode, enter graphic GUI mode and X Window system after login.

6 restart mode, the default running level cannot be set to 6, otherwise it cannot be started normally. Run init 6 and the machine will restart.

The startup level has been changed in rhel7.

Set the default third startup level

[root@xuegod60 ~] # systemctl set-default multi-user.target

Removed symlink/etc/systemd/system/default.target.

Created symlink from/etc/systemd/system/default.target to/usr/lib/systemd/system/multi-user.target.

Set the default fifth startup level

[root@xuegod60 ~] # systemctl set-default graphical.target

Removed symlink/etc/systemd/system/default.target.

Created symlink from/etc/systemd/system/default.target to / usr/lib/systemd/system/graphical.target.

View the current default startup level

[root@xuegod60 ~] # systemctl get-default

Graphical.target

After reading the above, do you have any further understanding of the basic commands of RHEL7? If you want to know more knowledge or related content, please follow the industry information channel, thank you for your support.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report