特殊命令

特殊命令:

查看系统内核版本
[root@localhost ~]# uname -a
Linux localhost.localdomain 3.10.0-693.el7.x86_64 #1 SMP Thu Jul 6 19:56:57 EDT 2017 x86_64 x86_64 x86_64 GNU/Linux

查看系统查见信息
[root@localhost ~]# cat /etc/redhat-release
Red Hat Enterprise Linux Server release 7.4 (Maipo)

查看系统负载 小于1是正常
[root@localhost ~]# uptime
22:56:50 up 2:52, 2 users, load average: 0.00, 0.01, 0.05


每一分钟查看负载情况:
[root@localhost ~]# watch -n 1 uptime


查看当前系统内存使用情况
[root@localhost ~]# free -m
total used free shared buff/cache available
Mem: 1839 209 1408 8 221 1457
Swap: 2047 0 2047

 

查看当前登录主机的用户情况:
[root@localhost ~]# who
root pts/0 2017-11-20 21:37 (172.30.2.13)
root pts/1 2017-11-20 22:47 (172.30.2.243)


查看系统登录情况:

[root@localhost ~]# last
root pts/1 172.30.2.243 Mon Nov 20 22:47 still logged in
root pts/1 172.30.2.243 Mon Nov 20 22:10 - 22:42 (00:32)
root pts/0 172.30.2.13 Mon Nov 20 21:37 still logged in

 

查看用户输入过的命令
[root@localhost ~]# cat /root/.bash_history


ls命令
-a 查看全部文件
-d 仅看目录本身
-h 易读文件容量
-l 显示文件详细信息

 

wc命令用于统计文本行数,字数,字节数
-l 显示行数
-w 显示单词数
-c 显示字节数

挂在光盘:
[root@localhost Packages]# mount /dev/cdrom /media/cdrom
[root@localhost ~]# cd /media/cdrom/Packages/

设置时间:
[root@localhost ~]# date -s 15:56:30


安装at
[root@localhost Packages]# yum -y install at

[root@localhost ~]# at 16:20

ctrl+d进行保存

[root@localhost ~]# atq
3 Mon Nov 20 16:15:00 2017 = root
4 Mon Nov 20 16:20:00 2017 a root

使用atrm进行删除
[root@localhost ~]# atrm 4
[root@localhost ~]# atq
3 Mon Nov 20 16:15:00 2017 = root

 

ssh指定端口登录:
[root@localhost ~]# ssh -p 8022 172.30.100.11

远程拷贝-->指定端口上传对应文件


[root@localhost ~]# scp -P 8022 /home/cisco/sh/a.txt 172.30.100.11:/home/ceshi

 

查看是哪个安装包
[root@localhost ~]# rpm -qf `which parted`
parted-3.1-28.el7.x86_64

 


=======================================================
标准的网卡配置
[root@localhost ~]# cat /etc/sysconfig/network-scripts/ifcfg-enp1s0
TYPE="Ethernet"
BOOTPROTO="none"
DEFROUTE="yes"
IPV4_FAILURE_FATAL="no"
IPV6INIT="yes"
IPV6_AUTOCONF="yes"
IPV6_DEFROUTE="yes"
IPV6_FAILURE_FATAL="no"
NAME="enp1s0"
UUID="484a533a-7e48-436d-8dfb-8c778ec8185e"
ONBOOT="yes"
HWADDR="74:D4:35:E3:84:90"
IPADDR0="192.168.0.241"
PREFIX0="24"
GATEWAY0="192.168.0.1"
IPV6_PEERDNS="yes"
IPV6_PEERROUTES="yes"

====================================


解决没有ifconfig&route -n处理
[root@localhost Packages]# rpm -ivh net-tools-2.0-0.17.20131004git.el7.x86_64.rpm
警告:net-tools-2.0-0.17.20131004git.el7.x86_64.rpm: 头V3 RSA/SHA256 Signature, 密钥 ID fd431d51: NOKEY
准备中... ################################# [100%]
正在升级/安装...
1:net-tools-2.0-0.17.20131004git.el################################# [100%]
[root@localhost Packages]# yum install -y ifconfig

========================================================================

本机mac
60-6D-C7-1B-9B-C9
======================================================================
[root@localhost ~]# timedatectl set-time "2017-11-27 22:22:22"
Failed to set time: Automatic time synchronization is enabled


更改时间遇到报错处理:

 

[root@localhost ~]# timedatectl set-time "2017-11-27 22:22:22"
Failed to set time: Automatic time synchronization is enabled
[root@localhost ~]# systemctl status ntp
Unit ntp.service could not be found.
[root@localhost ~]# timedatectl set-ntp no
[root@localhost ~]# timedatectl set-time "2017-11-27 22:22:22"
[root@localhost ~]# timedatectl
Local time: 一 2017-11-27 22:22:33 CST
Universal time: 一 2017-11-27 14:22:33 UTC
RTC time: 一 2017-11-27 14:22:33
Time zone: Asia/Shanghai (CST, +0800)
NTP enabled: no
NTP synchronized: no
RTC in local TZ: no
DST active: n/a


===============================================================================

处理tab不能补全:
安装如下包
install bash-completion-1:2.1-6.el7
================================================================================
Error 256

解决 yum [Errno 256] No more mirrors to try (2012-03-22 18:22:50)
标签: yum centos 分类: 系统应用
输入下面的命令即可解决问题:
yum clean all
yum makecache
备注:有可能执行以上操作后需要重新配置下yum源

 

========================================================================================


ctrl+l(小写) 是清屏命令

===================================================================================


查看找到提供nslookup命令的软件包
[root@c4kaichen ~]# yum provides */nslookup
已加载插件:fastestmirror, product-id, search-disabled-repos, subscription-manager
This system is not registered with an entitlement server. You can use subscription-manager to register.
rhel7 | 4.1 kB 00:00:00
Loading mirror speeds from cached hostfile
rhel7/filelists_db | 3.4 MB 00:00:00
32:bind-utils-9.9.4-50.el7.x86_64 : Utilities for querying DNS name servers
源 :rhel7
匹配来源:
文件名 :/usr/bin/nslookup


zsh-5.0.2-28.el7.x86_64 : Powerful interactive shell
源 :rhel7
匹配来源:
文件名 :/usr/share/zsh/5.0.2/functions/nslookup

 


==========================================================================================

[oracle@localhost ~]$ rman target /

Recovery Manager: Release 10.2.0.5.0 - Production on Thu Dec 21 16:26:43 2017

Copyright (c) 1982, 2007, Oracle. All rights reserved.

connected to target database: ORCL (DBID=1486024803)

RMAN> report schema;

using target database control file instead of recovery catalog
Report of database schema

List of Permanent Datafiles
===========================
File Size(MB) Tablespace RB segs Datafile Name
---- -------- -------------------- ------- ------------------------
1 460 SYSTEM *** /home/oracle/app/oracle/oradata/orcl/system01.dbf
2 990 UNDOTBS1 *** /home/oracle/app/oracle/oradata/orcl/undotbs01.dbf
3 400 SYSAUX *** /home/oracle/app/oracle/oradata/orcl/sysaux01.dbf
4 3201 USERS *** /home/oracle/app/oracle/oradata/orcl/users01.dbf
5 15000 ST_RIS *** /home/oracle/app/oracle/oradata/orcl/st_ris.dbf
6 15000 ST_PACS *** /home/oracle/app/oracle/oradata/orcl/st_pacs.dbf

List of Temporary Files
=======================
File Size(MB) Tablespace Maxsize(MB) Tempfile Name
---- -------- -------------------- ----------- --------------------
1 2485 TEMP 32767 /home/oracle/app/oracle/oradata/orcl/temp01.dbf


===========================================================================================================

安装rz
[root@localhost ~]# yum install -y lrzsz

===================================================================================================

 

posted on 2018-01-25 09:14  90500042陈  阅读(285)  评论(0编辑  收藏  举报