Information display and search command

[Quan # # @ the root of Better ~] $ the uname - R & lt kernel release number Display #
 2.6 . 32 - 696 .el6.x86_64
[root @ # # of Better Quan ~] $ uname - the n-# show hostname
Better
[root @ # # of Better Quan ~] $ uname - v # show version of the kernel
# . 1 the SMP-Mar Tue 21 is  . 19 : 29 : 05 UTC 2017 
[the root of Better # @ # Quan ~] $ the uname - m # Display Computer Architecture
x86_64
[root@#quan#Better ~]$
[root@#quan#Better ~]$hostname  
Better
[root @ # # of Better Quan ~ ] $ # temporary hostname AAA modify the hostname
[root @ # # of Better Quan ~] $ vim / etc / sysconfig / Network permanently modify the hostname #
[root@#quan#Better ~]$cat /etc/sysconfig/network
NETWORKING=yes
HOSTNAME=Better
NTPSERVERARGS=iburst
[root@#quan#Better ~]$

[Quan # # @ the root of Better ~] $ CAT / etc / hosts hosts Host Configuration # parse
 127.0 . 0.1    localhost localhost.localdomain localhost4 localhost4.localdomain4
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6

[root @ # # of Better Quan ~] $ hostname - the I # acquisition system IP address, card number on how many IP address
 192.168 . 139.128  192.168 . 31.66  
[root @ # # of Better Quan ~] $
dmesg displays the contents of the core ring buffer, city guide system, the kernel will initialize the hardware modules and related information is written in the buffer, / var / log / dmesg
[root@#quan#Better ~]$dmesg |less


Initializing cgroup subsys cpuset
Initializing cgroup subsys cpu
Linux version 2.6.32-696.el6.x86_64 ([email protected]) (gcc version 4.4.7 20120313 (Red Hat 4.4.7-18) (GCC) ) #1 SMP Tue Mar 21 19:29:05 UTC 2017
Command line: ro root=UUID=bedc9145
stat: displaying detailed information about the status of a file or a file system
[root@#quan#Better ~]$stat /etc/hosts
  File: `/etc/hosts'
  Size: 158           Blocks: 8          IO Block: 4096   regular file
Device: 805h/2053d    Inode: 1179681     Links: 1
Access: (0644/-rw-r--r--)  Uid: (    0/    root)   Gid: (    0/    root)
Access: 2019-09-14 23:04:36.745216799 +0800
Modify: 2010-01-12 21:28:22.000000000 +0800
Change: 2019-07-27 19:00:34.411999909 +0800
# Access to digital content file corresponding to the corresponding rights
[root@#quan#Better ~]$stat -c %a /etc/hosts
644
du disk space usage statistics, you can find that file using too much disk space
[Quan # # @ the root of Better tmp] du $ - A # display size of all files, including all the subfolders in hidden files and directories
 280     ./ zabbix_server.log
 0     ./.esd- 0 / Socket
 . 4     ./.esd- 0 
. 4     ./ sess_tvr0so89lsjuv3hkpsskira1g3
 0     ./pulse-DQ6pTKVyMQbA/ Native
 . 4     ./pulse- DQ6pTKVyMQbA
 0     ./keyring-95urfx/ socket.pkcs11
 0     ./keyring-95urfx/ Socket
 0     ./keyring-95urfx/ socket.ssh
 . 4     ./ keyring- 95urfx
 0     ./keyring-AGHgFM/socket.pkcs11
0    ./keyring-AGHgFM/socket
[root @ # # of Better Quan tmp] $ du - S displays the total file size of
 392     .
[root@#quan#Better tmp]$du -h  人性化显示
4.0K    ./.esd-0
4.0K    ./pulse-DQ6pTKVyMQbA
4.0K    ./keyring-95urfx
4.0K    ./keyring-AGHgFM
4.0K    ./.ICE-unix
4.0K    ./keyring-z210kg
4.0K    ./keyring-Qhfnnd
4.0K    ./keyring-vU6ECi
24K    ./gconfd-gdm
8.0K    ./orbit-gdm
4.0K    ./keyring-hRsO0e
8.0K    ./pulse-dLTEGSQL3ge3
4.0K    ./keyring-SYAqed
4.0K    ./keyring-wlVYuR
4.0K    ./keyring-Foz4Hv
4.0K    ./.X11-unix
392K.
[root@#quan#Better tmp]$du -sh
392K.
[root@#quan#Better tmp]$date +%y
19
[root@#quan#Better tmp]$date +%Y
2019
[root@#quan#Better tmp]$date +%m
09
[root@#quan#Better tmp]$date +%d
15
[root@#quan#Better tmp]$date +%H
16
[root@#quan#Better tmp]$date +%M
41
[root@#quan#Better tmp]$date +%S
25
[root@#quan#Better tmp]$date +%F
2019-09-15
[root@#quan#Better tmp]$date +%T
16:41:37
[root@#quan#Better tmp]$date +%F -d "-1day"
2019-09-14
[root@#quan#Better tmp]$date +%F -d "-2day"
2019-09-13
[root@#quan#Better tmp]$date +%F -d "-1month"
2019-08-15

[root@#quan#Better tmp]$date -d "Thu May 6 21:41:16 CST 2019" "+%Y-%m-%d %H-%M-%S"
2019-05-06 21-41-16

 

[root @ # quan # Better tmp ] $ which hostname # show command the full path through the PATH environment variable
 / bin / hostname
[root @ # # of Better Quan tmp] $ Which -a # hostname - A class is found to stop, but now traverse the PATH Pathfinder
 / bin / hostname

 

[root@#quan#Better tmp]$whereis which
which: /usr/bin/which /usr/share/man/man1/which.1.gz

# View the file executable and source code files and man the help file path
locate quickly locate the path to the file
linux system which has a mlocate.db database file, the file name of the corresponding path galaxy which contains the file system, all do not traverse the disk, but directly to the database file,
Note: If it is a newly added file, mlocate.db is no record, all you want to use updatedb command with a new database file.
[root@#quan#Better tmp]$ll -h /var/lib/mlocate/mlocate.db 
-rw-r----- 1 root slocate 3.8M Sep 15 03:06 /var/lib/mlocate/mlocate.db
     
[root@#quan#Better tmp]$cat /etc/cron.daily/mlocate.cron 
#!/bin/sh
nodevs=$(< /proc/filesystems awk '$1 == "nodev" && $2 != "zfs" { print $2 }')
renice +19 -p $$ >/dev/null 2>&1
ionice -c2 -n7 -p $$ >/dev/null 2>&1
/usr/bin/updatedb -f "$nodevs"
[root@#quan#Better tmp]$

 

 

 

 

 

Guess you like

Origin www.cnblogs.com/betterquan/p/11880126.html