Java programmers commonly used Linux commands 01 - linux command base

1. Display the date of the order of date

Show date:

1 [root@localhost ~]# date

Show date:

1 [root@localhost ~]# date '+%Y%m%d'

 

2. Display the calendar instruction cal

Display a calendar month.

1 [root@localhost ~]# cal

 

3. Use the calculator command: bc

 The first way:

1 [root@localhost ~]# bc <<< 1+2

The second way:

The string to be passed to the calculated flow conduit manner bc

[root@localhost ~]# echo '5*6' | bc

 

4. Several of the more important hotkeys

[Tab] ----- have command completion of function

[Ctrl] + C ------ let the current program stopped

[Ctrl] + D ------- output end of the keyboard: the equivalent of exit

5. Review the help manual command man

Usage: man [command you want to query]

[root@localhost ~]# man cat

 

 6. The need to preserve the memory of the data are written to the hard disk: sync

Before we shut down, it is likely there will be some in memory, such as cache data is not written to the hard disk, etc. which, however we look at the implementation of this command before the shutdown, you can put that data to be written to the hard disk, it is written the hard disk to avoid data loss.

[root@localhost ~]# sync

我们无法显式的看到效果。

7.切换执行等级:init

Linux系统有7种执行等级,其中比较常用的是0,3,5,6

0:停机或者关机(千万不能将initdefault设置为0)3:纯文本模式5:图形化(即图形界面)

6:重启(千万不要把initdefault设置为6)

用法是:init 执行等级

1 [root@localhost ~]# init 3

 

Guess you like

Origin www.cnblogs.com/fengyun2019/p/11210877.html