1、获取文件树形列表
tree /f >dir.txt
2、ubuntu
(1)、安装nodeJS
curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash -
sudo apt-get install -y nodejs
(2)、ubuntu查看磁盘空间
df -hl 查看磁盘剩余空间
df -h 查看每个根路径的分区大小
du -sh [目录名] 返回该目录的大小
du -sm [文件夹] 返回该文件夹总M数
(3)、查看ubuntu版本号
cat /proc/version
(4)、查看ubuntu系统内核版本
uname -a
(5)、查看内存使用
free -h
3、mongoDB以用户名密码登陆
db.auth("username","password")
4、查看node服务
ps -ef |grep node
5、查看某一端口号占用情况
lsof -i:端口号
6、杀进程
kill 进程句柄号
7、sh文件获取执行权限
chmod u+x file.sh
8、监听node文件改动,并自动重启服务
npm i supervisor -g
supervisor app.js // app.js为入口文件
supervisor -i ./webapp app.js // 监听文件改动时,忽略某个文件夹中的改动
9、将cmd命令写入到bat文件,并使其窗口不关闭
cmd /k "npm run alpha" // cmd /k作为前缀,后面带具体命令
10、连接wifi——使用wpa_supplicant工具
1、查看可用的网卡状态:iw dev 或 iw config 或 ifconfig
2、查看wlan0网卡的激活状态:ip link show wlan0
3、激活wlan0网卡:ip link set wlan0 up
4、搜索可用网络:
iw wlan0 scan | grep SSID
5、使用wpa_supplicant连接wifi:
wpa_supplicant -B -i wlan0 -c<wpa_passphrase "网络名" "无线密码">
6、分配ip地址:dhclient wlan0
7、再次查看网卡激活状态:ip link show wlan0