Linux common commands

  • 2020-05-27 08:00:32
  • OfStack


1. Components of linux: kernel, shell, file system, application

2. linux directory structure: bin, sbin, home, root, boot, dev, etc, lib,

3. File directory operation: ls, cd, mkdir, touch, echo, cat, more, find, mv, cp, rm, wc, ln

4. linux channel "|"

5. System administration commands: passwd, su root, sudo passwd root,

top,kill, ps, du, df, ping, ifconfig, man

6. Switch machine: logout, exit, shutdown

7. Backup compression: package and compress tar-czvf news.tar.gz

Unpacking and decompressing tar-xzvf. tar. gz

9. VIM: i, esc, q! (force exit), wq(save exit), set number display line number, set nonumber cancel line number display

10. linux source code installation software

Decompression: tar-zxvf xxxx.tar.gz

Configuration: cd xxxx


Compiler: make

Installation: make install

Uninstall: make uninstall


1. Installation and uninstallation:

(1) dpkg package management

Install the package sudo dpkg-i tree_1.5.3-1_i386.deb

Delete the software package sudo dpkg -r tree

(2) APT package management

Install package: sudo apt-get install packagename

Delete package: sudo apt-get remove packagename

Check the installation status: sudo apt-cache policy packagename

Get a list of new packages: sudo apt-get update


1. Firewall related.

1. Turn off the firewall

systemctl stop firewalld

2. Turn on the firewall

systemctl start firewalld.service

3. Open the default port number

firewall-cmd --permanent --zone=public --add-port=3306/tcp
firewall-cmd --permanent --zone=public --add-port=3306/udp

4, make the latest firewall setup rules effective.

firewall-cmd --reload

Related articles: