Frequently used shell command logging under Linux

Source: Internet
Author: User
Tags scp command

Hardware Chapter

  • CPU-related
lscpu                   #查看的是cpu的统计信息. cat /proc/cpuinfo       #查看CPU信息具体信息, such as the model of each CPU, frequency, etc.
    • Memory-related
 free-m                 #概要查看内存情况  the unit here is MBcat /proc/meminfo       #查看内存具体信息
    • Disk-related
lsblk                   #查看硬盘和分区分布, display very intuitive DF -H                   #查看各分区使用情况 cat /proc/partitions    #查看硬盘和分区 Mount | Column-t       #查看挂接的分区状态
    • Nic Related
grep ' ETH '    #查看网卡硬件信息 ifconfig -a             #查看系统的全部网络接口ethtool eth0            #假设要查看某个网络接口的具体信息, such as the specific number of eth0 and indicators

Software article

    • Kernel-related
<textarea style="LINE-HEIGHT: 1.5; WIDTH: 419px; FONT-FAMILY: Courier New; HEIGHT: 148px; FONT-SIZE: 12px" cols="9">uname-a #查看版本号当前操作系统内核信息) cat/proc/version #查看当前操作系统版本号信息cat/etc/issue #查看版本号当前操作系统发行版 Information Cat/etc/redhat-release #同上cat/etc/suse-release #suse系统下才可使用lsb_release-a #用来查看linux兼容性的发行版信息lsmod #列出载入的内核模块</textarea>
    • Internet
ifconfig                -L             #查看防火墙设置service iptables status #查看防火墙状态service iptables stop   -N                 -lntp           -             antp           -s              -at-au              -lt             #仅仅列出全部监听tcpport
    • System Management
top #查看系统全部进程的具体信息, such as CPU, memory, etc., very much information! DF-LH #查看硬盘大小及使用率Mount#挂接远程文件夹, NFS, local shared folders to Linuxhostname#查看/Change computer nameW#查看活动用户ID#查看指定用户信息 Last#查看用户登录日志Cut-D:-f1/etc/passwd#查看系统全部用户Cut-D:-f1/etc/Group #查看系统全部组crontab-l #查看当前用户的计划任务服务chkconfig –list #列出全部系统服务chkconfig –list|grepOn #列出全部启动的系统服务程序rpm-QA #查看全部安装的软件包Uptime#查看系统执行时间, number of users, load/sbin/chkconfig--List #查看系统自己主动启动列表/sbin/chkconfig–add MySQL #把MySQL加入? Into the system's start-up service group.
    • File related
ls -lht                 #列出一个目录下全部文件及大小, Access to du -sh <dir>              du -lh <dir>            #查看指定文件夹及各文件的大小 ln-s                   #建立软链接
    • Process-related
Pstree-P pid           #查看一个进程下的全部线程pstree  -A              #显示全部进程的全部具体信息, encountered the same process name can be compressed display.  PS -EF                  #查看全部进程 kill -9  pid             #杀死进程 kill  All test           #杀死进程 kill -9  ' pgrep test '    #杀死进程. /test. sh &             #使程序在后台执行nohup. /test. sh &       #使程序在后台执行
    • Compression Decompression  
Zip-Rdir.Zip dir file#将文件夹dir, file files, etc. compressed into a zip package,Zip-redir.Zip dir file#创建zip包, and encryptionUnzip dir.Zip#解压Tar-zcvfdir.Tar. gzdir filecompress the #将文件夹dir, file files, etc. into the tar packageTar-xfdir.Tar. GZ #解压
    • Screen Command

The great advantage of the screen command group is that when your shell exits or shuts down, the service you perform does not matter, that is, we can open a set of services in screen without being affected by the disconnection of the terminal.

Screen-S test          -R test          -R pid           -ls              + a,d               + a,n              + a,c              #当在一个screen时, create a new form
    • SCP command
SCP local_file [email protected]_ip:remote_dir    #拷贝本地文件到远程机器上 SCP -R local_dir [email protected ]_ip:remote_dir  #拷贝本地整个文件夹到远程机器上
    • Package Installation Management Commands

If the package you want to install is called an app, note that the commands here usually require sudo or root privileges.

//CentOS System, Redhat systemRpm-qa |grepapp #查找本机是否安装了app; rpm-IVH app.rpm #如果你有app的rpm包, so install directlysudo Yum Installapp #否则就在线安装YumUpdate App #更新apprpm-e app #删除已安装的app包//SuSE, openSUSE systemZypper Search app #查找本机是否安装了app; zypperInstallapp #安装zypper update app #更新zypper remove app #删除zypper lr #列出全部已定义的安装源. Zypperar#加入? New Installation source. Zypper RR #删除指定的安装源zypper Mr #改动指定的安装源//Ubuntu SystemApt-getInstallapp #安装apt-get update app #更新apt-get remove app #删除 apt-Cache Search App #搜索软件包dpkg-I app.deb #如果你有app的deb包, so install directly

Frequently used shell command logging under Linux

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.