In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly introduces "the summary of shell commands commonly used under Linux". In the daily operation, I believe that many people have doubts about the summary of shell commands commonly used under Linux. The editor consulted all kinds of data and sorted out simple and easy-to-use operation methods. I hope it will be helpful to answer the doubts of "summary of commonly used shell commands under Linux". Next, please follow the editor to study!
Hardware section
CPU correlation
Lscpu # looks at the statistics of cpu. Cat / proc/cpuinfo # View CPU information details, such as the model of each CPU, main frequency, etc.
Memory dependent
Free-m # Summary View memory situation the unit here is MBcat / proc/meminfo # View memory details
Disk dependent
Lsblk # View the distribution of hard drives and partitions, which is very intuitive df-h # View the usage of each partition cat / proc/partitions # View the hard disk and partition mount | column-t # View the status of attached partitions
Network card related
Lspci | grep-I 'eth' # View Nic hardware information ifconfig-a # View all network interfaces of the system ethtool eth0 # if you want to view the details of a network interface, such as the detailed parameters and metrics of eth0
Software section
Kernel correlation
Uname-a # View current operating system kernel information) cat / proc/version # View current operating system version information cat / etc/issue # View version current operating system release information cat / etc/redhat-release # only use lsb_release-a # to check linux compatibility under the cat / etc/SuSE-release # suse system above Lsmod # lists the loaded kernel modules
The network
Ifconfig # View properties of all network interfaces iptables-L # View firewall settings service iptables status # View firewall status service iptables stop # turn off firewall route-n # View routing table netstat-lntp # View all listening ports netstat-antp # View all established connections netstat-s # View network statistics process netstat-at # list all tcp ports netstat-au # list all udp ports netstat-lt # list only all listening tcp ports
System management
Top # check the details of all the processes in the system, such as CPU, memory, etc., a lot of information! Df-lh # View hard disk size and usage mount # mount remote directory, NFS, Local shared directory to linux hostname # View / modify computer name w # View active user id # View specified user information last # View user login log cut-d:-F1 / etc/passwd # View all users of the system cut-d:-F1 / etc/group # View all groups of the system crontab-l # View the current user's scheduled task service chkconfig-list # list all system services chkconfig-list | grep on # list all started system service programs rpm-qa # View all installed software packages uptime # View system running time, Number of users, load / sbin/chkconfig-- list # View system auto-boot list / sbin/chkconfig-add mysql # add MySQL to the startup service group of the system
File correlation
Ls-lht # list all files and sizes in a folder, access rights du-sh # View the size of the specified directory du-lh # View the size of the specified directory and each file ln-s # establish a soft link
Process related
Pstree-p pid # View all threads under a process pstree-a # shows all the details of all processes, and can be compressed when encountering the same process name. Ps-ef # View all processes kill-9 pid # Kill process kill all test # Kill process kill-9 `pgrep test` # Kill process. / test.sh & # make the program run nohup. / test.sh & # make the program run in the background
Compression and decompression
Zip-r dir.zip dir file # compress directory dir, file file, etc. Into zip package, zip-re dir.zip dir file # create zip package, and encrypt unzip dir.zip # decompress tar-zcvf dir.tar.gz dir file # compress directory dir, file file, etc. into tar package tar-xf dir.tar.gz # decompress
Screen command
The advantage of screen command group * * is that when your shell exits or shuts down, the services you run will not matter, that is, we can open a set of services in screen without being affected by terminal disconnection.
Screen-S test # create a screenscreen-r test # named test, open screenscreen-r pid # named test, open screenscreen-ls # with process number pid, list all screenctrl + a-ls d # when in a screen, exit screenctrl + a-ls n # when in a screen Switch to the next window ctrl + a screen c # when in a window, create a new window
Scp command
Scp local_file remote_username@remote_ip:remote_dir # copy local files to the remote machine scp-r local_dir remote_username@remote_ip:remote_dir # copy the entire local directory to the remote machine
Package installation management command
Suppose the package you want to install is called app. Note that the commands here usually require sudo or root permissions.
/ / centos system, redhat system rpm-qa | grep app # find whether this machine has installed app;rpm-ivh app.rpm # suppose you have the rpm package of app, so install sudo yum install app # directly, otherwise install yum update app # update apprpm-e app # online delete the installed app package / / suse, opensuse system zypper search app # find out whether app is installed on this machine Zypper install app # install zypper update app # update zypper remove app # remove zypper lr # list all defined installation sources. Zypper ar # adds a new installation source. Zypper rr # remove the specified installation source zypper mr # modify the specified installation source / / ubuntu system apt-get install app # install apt-get update app # update apt-get remove app # remove apt-cache search app # search package dpkg-I app.deb # suppose you have app's deb package, so install it directly to this The study on "summary of commonly used shell commands under Linux" is over. I hope to be able to solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.