1. Intro Delete python 2 (Default installed) 2. Command # check python2 version python –version # Delete python2 sudo apt purge python2.x-minimal # Install pip3 sudo apt install python3-pip # link python2 -> python3 sudo ln -s /usr/bin/python3 /usr/bin/python sudo ln -s /usr/bin/pip3 /usr/bin/pip # check python version python –version
Category: Linux 공통
md5sum directory
1. Abstract If you need an md5sum for a directory, you can get the md5sum for the files and md5sum for that list. 2. Command find [Directory] -type f -exec md5sum {} \; | sort -k 2 | md5sum
Find files that do not contain a specific string
1. Abstract Find files that do not contain a specific string 2. Command grep -c “string_to_find” *
Compare Directory
1. Intro If you want to compare all files in directory A and directory B 2. Command diff -ru dir_A dir_B
Check Sendmail version
1. Intro Show Sendmail version 2. Command sendmail -d0.1 < /dev/null | grep -i version
Fail crond
1. Intro If cron does not run with the following error 2. Cause Account password expired. 3. Solution Modify Account’s password max days 3.1. Check default Policy grep “PASS_MAX_DAYS” /etc/login.defs 3.2. Change account Policy chage -E -1 -M 99999 [username] grep “[username]” /etc/shadow
split file
1. Intro split a file into pieces 2. Command 2.1. split by byte split -b [10m / 10k] [file name] 2.2. split by line split -l [line number] [file name]
Set date
1. Intro Set date, time 2. Command 2.1. sync NTP : rdate rdate -s time.nist.gov 2.2. manually set date : date date -s “2020-01-31 19:10:00”
set timezone
1. Intro Set timezone 2. Command ll /usr/share/zoneinfo/Asia/Seoul sudo ln -sf /usr/share/zoneinfo/Asia/Seoul /etc/localtime
screen
1. Intro Use multiple shell windows from a single SSH session. Keep a shell active even through network disruptions. Disconnect and re-connect to a shell sessions from multiple locations. Run a long running process without maintaining an active shell session. ref> https://www.rackaid.com/blog/linux-screen-tutorial-and-how-to/ 2. Install yum install screen 3. Command # session list 확인 […]