Linux system commands

Source: Internet
Author: User

Commonly used linux system commands www.2cto.com Java code top memory df-h file system du-sh * current folder file size hostname view host name cat/etc/sysconfig/network modification the host name is used to modify this file. For details, run the getconf LONG_BIT system bit uname-a command to check the kernel version lsb_release-a and run the linix version vim/etc/resolv command. conf is mainly used to check the DNS server configuration to connect to the Internet vim/etc/sysconfig/iptables. If there is no hardware restriction on the port, view the current system time. network synchronization time cp/usr/share/zoneinfo /Asia/Shanghai/etc/localtime adjusted the current time zone ntpdate us.pool.ntp.org. Check whether the port is occupied. The following shows how to check port 22 magne @ magne-desktop :~ $ Lsof-I tcp: 22 this indicates that there are several dual-core CPUs, namely the dual-core CPUs. The following is the dual-core CPUs. [root @ hengwe-dev ~] # More/proc/cpuinfo | grep "model name" model name: Pentium (R) Dual-Core CPU E5200 @ 2.50 GHz model name: Pentium (R) dual-Core CPU E5200 @ 2.50 GHz import database SQL file mysql-uroot-ppassword mysql <localhost. SQL. Create an account and test grant all on *. * to "test" @ "%" Identified by "123456"; find. /-name "*. * "| xargs grep 'heibao' search for heyibao % s/kuyibao/heyipan/g string to replace source: kuyibao dist: heyibao ps-aux | grep 'xxx 'Find the specified Thread ln-s static link as the required soft connection [root @ localhost http] # who view the current logon User root tty1 Apr 9 17 http pts/0 Apr 16 (192.168.8.235) pkill-u webadmin said that the dangerous reason is: all related programs of the user will be turned off. If you accidentally execute the command to kick out the root program, this means that the ssh service enabled with root is stopped. You must (yes! Yes !) The monitor is connected to the server, or you must press reset ~~ Reserved Java code # uname-a # view kernel/OS/CPU information # head-n 1/etc/issue # view OS version # cat/proc/cpuinfo # view CPU information # hostname # View computer name # lspci-TV # list all PCI devices # lsusb-TV # list all USB devices # lsmod # list loaded kernel modules # env # view the environment variable resource # free-m # view memory usage and swap zone usage # df-h # view the usage of each partition # du-sh <Directory Name> # view the size of a specified directory # grep MemTotal /proc/meminfo # view the total memory # grep MemFree/proc/meminfo # view the Amount of idle memory # uptime # view the system running time, number of users, and load # cat/proc/loadavg # view the system load disk and partition # mount | column-t # view the status of the mounted partition # fdisk-l # view all partitions # swapon-s # view all swap partitions # hdparm-I/dev/ hda # view disk parameters (applicable only to IDE devices) # dmesg | grep IDE # view the IDE Device Detection Status at startup Network # ifconfig # view the attributes of all network interfaces # iptables-L # view firewall settings # route-n # view route table # netstat -lntp # view all listening ports # netstat-antp # view all established connections # netstat-s # view network statistics process # ps-ef # view all processes # top # Real-Time display Process status user # w # view active users # id <User Name> # view specified user information # last # view User Logon logs # cut-d: -f1/etc/passwd # view all users in the system # cut-d: -f1/etc/group # view all system groups # crontab-l # view the scheduled Task Service of the current user # chkconfig-list # list all system services # chkconfig-list | grep on # list all started system service programs # rpm-qa # view all installed software packages

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.