查看某个进程号打开文件数量(open files)

先获取到该进程号,然后执行:

ls -l /proc/xxx/fd

xxx为具体的进程号,输出例入下:

total 0
lr-x------ 1 namer namer 64 Jul 14 21:41 0 -> pipe:[271495439]
l-wx------ 1 namer namer 64 Jul 14 21:41 1 -> pipe:[271495440]
lr-x------ 1 namer namer 64 Jul 14 21:41 10 -> anon_inode:inotify
lrwx------ 1 namer namer 64 Jul 18 07:00 11 -> socket:[274231623]
l-wx------ 1 namer namer 64 Jul 16 17:27 12 -> /workspace/door-god/log/2017-07-18.log
l-wx------ 1 namer namer 64 Jul 17 23:05 13 -> /workspace/door-god/log/2017-07-18.log
lrwx------ 1 namer namer 64 Jul 18 11:30 14 -> socket:[274230820]
lrwx------ 1 namer namer 64 Jul 18 15:16 15 -> socket:[274234729]
lr-x------ 1 namer namer 64 Jul 16 07:36 16 -> /dev/urandom
l-wx------ 1 namer namer 64 Jul 14 21:41 2 -> pipe:[271495441]
lrwx------ 1 namer namer 64 Jul 14 21:41 3 -> socket:[274235127]
lrwx------ 1 namer namer 64 Jul 14 21:41 4 -> socket:[271495456]
lr-x------ 1 namer namer 64 Jul 14 21:41 5 -> anon_inode:inotify
lr-x------ 1 namer namer 64 Jul 14 21:41 7 -> anon_inode:inotify
lrwx------ 1 namer namer 64 Jul 14 21:41 8 -> anon_inode:[eventpoll]
lrwx------ 1 namer namer 64 Jul 14 21:41 9 -> socket:[271495458]

则为打开的文件数量,如果要快速获取文件数量,则可以:

ls -l /proc/xxx/fd|wc -l

Jetbrain产品各个系统配置目录

Windows

All the files are located under this directory by default:

Windows Vista, 7, 8, 10:

<SYSTEM DRIVE>\Users\<USER ACCOUNT NAME>\.<PRODUCT><VERSION>

Windows XP:

<SYSTEM DRIVE>\Documents and Settings\<USER ACCOUNT NAME>\.<PRODUCT><VERSION>

Sample paths for different products

Under this directory you'll find the following sub-directories

config: configuration (idea.config.path)

config\plugins: plugins (idea.plugins.path)

system: caches, local history, etc (idea.system.path)

system\log: logs and thread dumps (idea.log.path)

You can find more details about what is stored in each folder in the Project and IDE Settings documentation section.

Linux and other Unix systems

Product directory starting with dot can be found in your user home directory, the pattern is:

 ~/.<PRODUCT><VERSION>

~ is an alias for the home directory, for example /home/john.

Mac OS X

Configuration (idea.config.path):

~/Library/Preferences/<PRODUCT><VERSION>

Caches (idea.system.path):

~/Library/Caches/<PRODUCT><VERSION>

Plugins (idea.plugins.path):

~/Library/Application Support/<PRODUCT><VERSION>

Logs (idea.log.path):

~/Library/Logs/<PRODUCT><VERSION>

ssh登录速度慢解决办法

Server: Ubuntu

终端下输入sudo vim /etc/ssh/sshd_config,找到:

UseDNS yes
GSSAPIAuthentication yes

将上面的 yes 改为no, 如果没有找到这两个配置项,在该文件底部增加即可,然后输入命令sudo service ssh restart重新登录,速度快了很多

Linux下获取某网卡的ip地址

方法1:

ifconfig wlan0|sed -n 2p|awk  '{ print $2 }'|awk -F : '{ print $2 }'

方法2:

ifconfig wlan0|sed -n 2p|awk  '{ print $2 }'|tr -d 'addr:'

将wlan0换成想要获取的网卡名即可