shell 유용한 명령어 (정리중)

이태혁·2020년 9월 15일
0

🦊 사용자 이름 확인

whoami

🦊 사이트의 ip주소 알아내기

  • 명령어
host naver.com
  • 결과
naver.com has address 210.89.164.90
naver.com has address 125.209.222.141
naver.com has address 210.89.160.88
naver.com has address 125.209.222.142
naver.com mail is handled by 10 mx2.naver.com.
naver.com mail is handled by 10 mx1.naver.com.
naver.com mail is handled by 10 mx3.naver.com.

🦊 패키지가 어느 폴더에 깔려있는지 확인

  • 명령어
which python3
whereis python3
  • 결과
/Library/Frameworks/Python.framework/Versions/3.7/bin/python3

🦊 파일 찾기

  • 현재 폴더포함 모든 하위폴더에서 키워드를 포함하고 있는 파일 찾기
find . | grep "키워드"

🦊 키워드가 담긴 파일 찾기

grep "키워드" *

🦊 폴더에 있는 모든 .git관련폴더 찾아서 삭제

( find . -type d -name ".git" && find . -name ".gitignore" && find . -name ".gitmodules" ) | xargs rm -rf

🦊 파일내에 utf8 encoding이 아닌 문자 찾기

perl -ne 'print "$. $_" if m/[\x80-\xFF]/' */*/*.c

🦊 여러파일에서 내용 검색 후 바꾸기

sed -i '' "s/taelee/jehong/g" /

🦊 한번에 여러 파일 생성(touch)

touch file{01..03}.py
//file01.py ~ file03.py 생성
profile
back-end, cloud, docker, web의 관심이 있는 예비개발자입니다.

0개의 댓글