본문 바로가기

테크/I T일반

mac terminal command 맥북 터미널 명령어 모음

반응형
  • 명령어 도움말 보기
    • man "command name here"
    • enter q to exit help
  • Lesson 1
    • ls : list of directory
    • cd : go to directory (cd .. go to previous directory)
    • pwd : current path
    • cat 파일 이름 : 파일 보기
    • head 파일 이름 : 첫줄
    • tail : 파일 이름 : 마지막줄
    • mkdir "폴더명" : 폴더만들기
    • rm -r "폴더명" : 폴더 삭제
    • rm : 파일 삭제
    • clear : 코멘트 화면 청소
    • cp "picture1.png" Documents 
    • cp -r Documents Documents_2 : copy directory Documents to Documents_2
    • mv "picture1.png" "Hi.png"
    • touch test_file : create file named "test_file"
    • date : 시간 프린트
  • Lesson 2
    • nano "파일명" : 파일 마들기 내용 작성하기
    • su 사용자 이름 : Switch User
    • whoami : 현재사용자
    • history : command history
    • history -c : clean history
    • sudo su root : login as root
  • Lesson 3
    • passwd : change password
    • sudo shutdown -h now 
    • sudo shutdown -h now : 17:00
    • sudo shutdown -r now : reboot
    • sudo reboot : reboot
    • sudo halt : shutdown
  • Lesson 4
    • ls -l : file permission
    • sudo chown Guest Documents
    • sudo chmod 777 Documents : 모든 권리
    • sudo chmod 755 Documents : 읽기만
    • sudo chmod 700 Documents : 오너만 조작 가능
  • Lesson 5
    • zip ./hi.zip ./hi : hi라는 파일을 hi.zip로 압축
    • zip ./hi.zip ./hi1 : hi1라는 파일도 hi.zip에 압축
    • zip -r ./hi.zip ./Documents : 폴더를 hi.zip로 압축
    • unzip hi.zip 
    • zip -e ./Test.zip ./TestFile : TestFile문서를 암호 추가해서 zip
    • zip -re ./Test.zip ./TestDir : TestDir폴더를 암호 추가해서 zip
    • gunzip : gz 파일 압축할 때
    • tar : tar 파일 압축할 때
  • Lesson 6
    • find . -name Test -print 2> ./ErrorLog : Test라는 폴더 찾는다 에러로그를 ErrorLog에 출력
    • find / -name Test -print 2> ./ErrorLog : Test라는 모든 폴더 찾는다
    • say "할말" : 기계가 할말을 읽네…
    • 1.emacs->esc+x 
    • 2.snake : snake game ,,,,, tetris : tetris game
    • ls /Volumes : hard drives
    • chmod +x Boob(Filename)
    • top : see all processes are running
    • top -o cpu : sort by cpu usage 
    • top then hit Shift + f, then choose the display to order by memory usage by hitting key n then press Enter.
    • ps aux : see all processes
    • ps aux | grep terminal : terminal 포함된것만 추출 
    • ps aux | more : 더 디테일 하게 보기 q로 나가기
    • kill /  killall Terminal :
    • passwd : change password
    • grep는 함수 같은 ?? 뒤에 단어 포함한 행을 반환
    • grep hi
    • hi하면 hi반환
    • afasd 아무것도 반환 안함
  • 파일 관리 등 시스템 관련
    • echo hi > HI : hi를 HI라는 파일에 아웃풋함
    • echo hi >> ~\Desktop\HI : HI라는 파일에 hi한행 더 추가
    • df : 디스크 용량 확인하기
    • df -h : 사용자가 보기 쉬운 포맷으로 보여주기
    • du -sh ~ : 자신의 홈디렉토리가 얼마 쓰고 있는지 확인
    • du -sh * : 현재 디렉토리 파일(폴더)들이 얼마씩 쓰고 있는지 확인
    • ifconfig : IP 주소 확인
    • ln -s 기존 폴더경로 바로가기 만들 폴더 경로
    • 파일다운로드시 curl -O http://example.com/file1.pdf (현재 경로에 file1.pdf로 다운로드 됨)
    • 파일다운로드시 curl -o downloadedfile1.pdf http://example.com/file1.pdf (이름 지정해서 저장)
반응형