linux 命令用法收集

修改fstab 使生效

mount -a 

格式化磁盘

mkfs.* 等命令

mkfs.btrfs mkfs.cramfs mkfs.ext2 mkfs.ext3 mkfs.ext4 mkfs.minix mkfs.xfs

磁盘分区

fdisk /dev/sdx

   a   toggle a bootable flag
   b   edit bsd disklabel
   c   toggle the dos compatibility flag
   d   delete a partition
   g   create a new empty GPT partition table
   G   create an IRIX (SGI) partition table
   l   list known partition types
   m   print this menu
   n   add a new partition
   o   create a new empty DOS partition table
   p   print the partition table
   q   quit without saving changes
   s   create a new empty Sun disklabel
   t   change a partition's system id
   u   change display/entry units
   v   verify the partition table
   w   write table to disk and exit
   x   extra functionality (experts only)

统计链接某个端口的ip

ss -an|grep 8888|grep ES|awk '{print $5}' |awk -F : '{print $1}'|sort |uniq -c|sort -n

linux 任务管理

ctrl+z  将当前运行的命令切到后台
jobs    显示当前在后台运行的任务
bg $num 将某个任务后台运行
fg $num 命令切回前端启动

查找当前目录下,特定目录名

find ./ -name "*gin*"

查找包含gin的目录

查找当前目录下,所有包含某字符串的文件

grep "hello" * -R
humboldt Written by:

humboldt 的趣味程序园