[root@centos7 data]# grep -v ‘/sbin/nologin$‘ /etc/passwd | cat -n
[root@centos7 data]# sort -t: -k3 -rn /etc/passwd | cut -d: --output-delimiter=‘ ‘ -f1,3,7 | head -1
nfsnobody 65534 /sbin/nologin
[root@centos7 data]# netstat -ant | tr -s ‘ ‘ | cut -d‘ ‘ -f 5 | cut -d‘:‘ -f 1 | tr -dc ‘0-9.\n‘ | sort -nr
192.168.100.1
0.0.0.0
0.0.0.0
0.0.0.0
0.0.0.0
0.0.0.0
[root@centos7 data]# cat user.sh
#! /bin/bash
read -p "Please input a username: " user
[ -z "$user" ] && { echo "You input none!";exit 1; }
id $user &> /dev/null && { echo -e "\033[1;31mThe user $user is exist\033[0m"; exit 10; }
useradd $user &> /dev/null && { echo magedu | passwd --stdin $user &> /dev/null; echo -e "\033[1;32mThe user $user create successfully.\033[0m" ; id $user; } || { echo Something error!; exit 20; }
[root@centos7 ~]#cat .vimrc
set nu
set tabstop=4
set softtabstop=4
set shiftwidth=4
set expandtab
set ignorecase
set cursorline
set autoindent
autocmd BufNewFile *.sh exec ":call SetTitle()"
func SetTitle()
if expand("%:e") == ‘sh‘
call setline(1,"#!/bin/bash")
call setline(2,"#")
call setline(3,"#*****************************************************************")
call setline(4,"#Author: lisonghe")
call setline(5,"#QQ: 1021208266")
call setline(6,"#Date: ".strftime("%Y-%m-%d"))
call setline(7,"#FileName: ".expand("%"))
call setline(8,"#Description: The test script")
call setline(9,"#Copyright (C): ".strftime("%Y")." All rights reserved")
call setline(10,"#****************************************************************")
call setline(11,"")
endif
endfunc
autocmd BufNewFile * normal G
原文:https://www.cnblogs.com/kfscott/p/12865348.html