Linux Useseful Info

xiaoxiao2021-03-06  80

How to check the version of the Linux kernel you currently use under Linux

You can use uname -r to view the current kernel version. If you use uname -a, you can see information including the kernel version, machine hardware information, network node name, operating system name, etc.

How to use iptable to do NAT on Linux

Below RedHat7.3 as an exception network card IP 200.200.200.100 NIC IP 192.168.8.1 Add the following content to the /etc/rc.d/rc.local file, restart the machine can be ########## ###### echo 1> / proc / sys / net / ipv4 / ip_forward / sbin / rmmod ipchains / sbin / modprobe ip_tables / sbin / modprobe iptable_filter / sbin / modprobe iptable_nat / sbin / modprobe ip_conntrack / sbin / modprobe ip_conntrack_ftp / SBIN / MODPRBOE IP_NAT_FTP / SBIN / IPTABLES -F INPUT / SBIN / IPTABLES -F Forward / Sbin / iptables -f PostRouting -t NAT / SBIN / IPTABLES -P forward Drop / Sbin / iptables -t Nat -a PostRouting -O Eth0 - S 192.168.8.0/24 -j masquerade / sbin / iptables -a forward -i eth0 -m state --state established, Related -j Accept / sbin / iptables -a forward -s 192.168.8.0/24 -j accept ## #######################################

How to check the port of the system?

You can use the command: netstat -lnp to view the port of the current listening of the system. Where l option indicates a port that is listening (listen); n option means that the port number is displayed instead of being converted to port names by viewing / etc / service; the P option indicates the listening program.

How to restore normal when the terminal is chaotic

What if there is some confusion or worse, use a program to make the terminal setting completely confusing? To go back to "Real", try the following command: Stty Sane If the keystrokes become confusing, try

To enclose the command, enter

The order is to press CTRL and type the J key.

Ctty Sane

This command will not return to the previous settings, but can remove some of the strange settings. And what is really setting to rely on the system used, but it will at least let you enter characters and see the result. From here, you can set some key keys to the way you like.

How to quickly find files under Linux

Find files can be used with Find, but it is best to use Locate, fast speed, less parameter. $ Locate filename It is looking for in a database, so I have to remember to update the database frequently with the UpdatedB command. Generally, the cron.daily script in crontab will execute the / usr / sbin / logrotate /etc/logrotate.conf command, allowing the machine to update the database late in the late night.

How to create a large number of users at a time under Linux

转载请注明原文地址:https://www.9cbs.com/read-94851.html

New Post(0)