v*******a 发帖数: 14 | 1 1)Let's say you know a process called "test" is running, and listening on a
TCP port for clients to connect over the network. How would you figure out
what port number it is listening on?
2)You have encountered a linux system that does not have any swap space
configured on it. How can you add swap space to the system while it runs?
What do you need to do to ensure that after a reboot the system retains the
newly-added swap space?
谢谢 |
c****j 发帖数: 258 | 2 lsof, netstat
different unix has different command to do this, but they all can make a
file and use it for swap (see mkfile, dd, swap, swapon etc.)
http://www.cyberciti.biz/faq/linux-add-a-swap-file-howto/ |
v*******a 发帖数: 14 | 3 1)Let's say you know a process called "test" is running, and listening on a
TCP port for clients to connect over the network. How would you figure out
what port number it is listening on?
2)You have encountered a linux system that does not have any swap space
configured on it. How can you add swap space to the system while it runs?
What do you need to do to ensure that after a reboot the system retains the
newly-added swap space?
谢谢 |
T**********l 发帖数: 12149 | 4
a
the
【在 v*******a 的大作中提到】 : 1)Let's say you know a process called "test" is running, and listening on a : TCP port for clients to connect over the network. How would you figure out : what port number it is listening on? : 2)You have encountered a linux system that does not have any swap space : configured on it. How can you add swap space to the system while it runs? : What do you need to do to ensure that after a reboot the system retains the : newly-added swap space? : 谢谢
|
D****e 发帖数: 9 | 5 1) netstat -antp | grep `ps -eaf | grep test | awk '{print $2}' | head -n
1`
or use lsof to list out the fd
2) man swapon |