一、那些命令
#001:查看 Kernel、GCC 以及 RedHat 版本信息
cat /proc/version Linux version 3.10.0-693.el7.x86_64 (builder@kbuilder.dev.centos.org) (gcc version 4.8.5 20150623 (Red Hat 4.8.5-16) (GCC) ) #1 SMP Tue Aug 22 21:09:27 UTC 2017 uname -a Linux localhost.localdomain.com 3.10.0-693.el7.x86_64 #1 SMP Tue Aug 22 21:09:27 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux uname -r 3.10.0-693.el7.x86_64 more /etc/system-release CentOS Linux release 7.4.1708 (Core) more /etc/redhat-release CentOS Linux release 7.4.1708 (Core) more /etc/centos-release CentOS Linux release 7.4.1708 (Core)
#002:查看操作系统的位数
getconf LONG_BIT 64 getconf WORD_BIT 64 file /bin/ls /bin/ls: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.32, BuildID[sha1]=3d705971a4c4544545cb78fd890d27bf792af6d4, stripped
#003:查看 CPU 个数、核心数和线程数
# 查看 CPU 的物理个数 grep ‘physical id‘ /proc/cpuinfo | sort -u | wc -l 1 # 查看 CPU 的核心数量 grep ‘core id‘ /proc/cpuinfo | sort -u | wc -l 2 # 查看 CPU 的线程数量 grep ‘processor‘ /proc/cpuinfo | sort -u | wc -l 4 # 查看 CPU 的型号 dmidecode -s processor-version Intel(R) Core(TM) i3-4170 CPU @ 3.70GHz # 查看 内存 方法 grep MemTotal /proc/meminfo MemTotal: 3750308 kB
二、安装node
1、建立一个文件夹命名node
wget https://nodejs.org/dist/v12.13.0/node-v12.13.0-linux-x64.tar.xz tar xvf node-v12.13.0-linux-x64.tar.xz cd /node/node-v12.13.0-linux-x64/bin
2、创建软链接,以便全局使用
ln -s /node/node-v12.13.0-linux-x64/bin/npm /usr/bin/npm ln -s /node/node-v12.13.0-linux-x64/bin/node /usr/bin/node node -v npm -v
3、如果无法创建,先在/usr/bin/目录下删除已存在的
rm -rf node
rm -rf npm
原文:https://www.cnblogs.com/camille666/p/linux.html