getElementsByName / tmp-doc

0 stars 0 forks source link

linux command cheat sheet #10

Open getElementsByName opened 3 years ago

getElementsByName commented 3 years ago

계정

user 확인

awk -F: '{ print $1"\t\t"$5}' /etc/passwd

group 확인

cut -d: -f1 /etc/group

group 사용자 리스트

getent group $GROUP_NAME

group 생성

groupadd $GROUP_NAME
groupadd -r $GROUP_NAME --gid $GROUP_NUMERIC_ID 

user 생성

useradd -r -u $USER_NUMERIC_ID -g $PRIMARY_GROUP_NAME -G $SUPPLYMENTARY_GROUP_NAME_LIST

계정 수정

usermod -a -G $GROUP_NAME $USER_NAME
getElementsByName commented 3 years ago

무한 대기 dummy

exec tail -f /dev/null
getElementsByName commented 3 years ago

file system size

disk free

df --human-readable

dir size

du --human-readable --total --summarize $TARGET_BASE_DIR


- top 10

TARGET_BASE_DIR=./

du --human-readable $TARGET_BASE_DIR | sort --reverse --human-numeric-sort | head -10

getElementsByName commented 3 years ago

network