# # #判断linux系统是32位还是64位
You can use "getconf word_bit" and "getconf long_bit" to get the digits of WORD and LONG, and 64-bit systems should be 32 and 64 respectively.
If [$ (getconf word_bit) = ' + '] && [$ (getconf long_bit) = ' 64 ']; Then
Echo 64
Else
Echo 32
Fi
# # #在当前脚本中调用另外的脚本文件
Method: (English point). + file name or source + file name
Fist.sh:
#!/bin/bash
Echo ' Your is in first file '
Second.sh:
#!/bin/bash
Echo ' Your is in second file '
SOURCE First
#或者用下面的方法
# # #列出当前目录下最大的10个文件
[Email protected] ~]# Du-s * | Sort-n | Tail
# # #统计keyword在日志中的出现次数
[Email protected] test]# grep-c ". Net" Resolve.txt 28
###!$
!$ is a special environment variable that represents the last string of the previous command. Such as: You may be like this:
$mkdir Mydir
$MV Mydir Yourdir
$CD Yourdir
Can be changed to:
$mkdir Mydir
$MV!$ Yourdir
$CD!$
Sudo!!
Execute the previous command as root
# # #shell时间
2 days before Time:
[[email protected] test]# date-d "2 days ago" +%y-%m-%d 2015-02-03
1 days before Time:
date-d "Yesterday" +%y-%m-%d
date-d "1 days Ago" +%y-%m-%d
Current time:
[[Email protected] test]# Date ' +%y-%m-%d%h:%m:%s ' 2015-02-05 04:19:02
Shell trivia (Occasional updates)