git을 위한 터미널 명령어

take_the_king·2024년 11월 29일

Git

목록 보기
2/9

Basic 터미널 명령어

작업위치

pwd

Print working directory; 현재 작업 위치 알려줌.

ls

list files; 현재의 directory의 모든 파일들을 보여줌.

cd ..

상위 디렉토리로 이동.

cd ~

사용자의 홈디렉토리(/Users/hannah)로 감.

cd 디렉토리명

change directory; 원하는 디렉토리로 이동; 다만 건너뛸 수는 없음. 한 칸씩 단계적으로 들어가야 함.

디렉토리 / 폴더

mkdir 디렉토리명

make directory; 새로운 directory 생성.

rm –rf 디렉토리명

디렉토리 삭제. 디렉토리와 디렉토리 하위의 모든 파일까지 삭제.

cp -R </sourcedir/> </destdir/>

디렉토리 복사.
Sourcedir: 카피하고 싶은 폴더명, destdir: 옮기고싶은 폴더명.
검색키워드# mac terminal commands copy directory

파일

cat 파일명

파일의 contents를 보여줌.

touch .파일명

파일 만들기.
Ex) touch .DS_Store (DS_Store라는 파일 만들기)

echo "파일내용" > 파일명

내용과 함께 새로운 파일 만들기.
Ex) echo "project test" > test.html ('project test'라는 내용이 있는 test.html 파일을 생성)

파일명 .gitignore

무시해야할 소스파일 만들기. 소스파일 버전관리.

ls -al | grep .파일명

특정 파일 불러오기. 찾고 싶은 파일이 있을 때.
Ex) ls -al | grep .gitconfig (gitconfig파일 찾기)

etc.

ctrl + L

터미널 화면 clear (화면이 너무 복잡할 때).

profile
개발을 좋아하는 taketheking 입니다.

0개의 댓글