Linux 4

tar 명령어 (압축, 압축해제)

tar 명령어 # tar 옵션 -c 압축 -x 압축해제 -f 파일이름 지정 -v 과정 출력 -z gzip으로 압축하거나 해제함 (tar.gz, tgz) # ex # 압축하기 tar -cvf [압축 파일명].tar [압축할 폴더 or 파일] # 현재 경로의 모든 파일을 압축 tar -tvf [압축 파일명].tar # 압축해제 tar -xvf archive.tar # tar.gz로 압축 tar -cvfz [압축 파일명].tar.gz [압축할 폴더 or 파일] # tar.gz 압축해제 tar -xvfz [압축 파일명].tar.gz tar과 tar.gz(gzip)의 차이점 tar : 압축하지 않음. 단순히 파일들을 하나로 묶어주는 것 tar.gz : 압축함.

리눅스 파일 권한과 chmod, 특수 권한 (SetUID, SetGID, Sticky-Bit)

리눅스 파일 권한 권한 보는 법 ex) drwxrw-r— 1번째 문자 : 파일의 종류(- : 파일 / d : 디렉토리 / l : 링크) → d : 디렉토리 2~4번째 문자 : 소유주 권한 → rwx : 읽기, 쓰기, 실행 가능 5~7번째 문자 : 소유 그룹 권한 → rw- : 읽기, 쓰기 가능 8~10번째 문자 : 나머지 유저 권한 → r— : 읽기 가능 권한 계산하는 법 1번째 문자(파일 종류)를 제외한 뒤, 소유주, 그룹, 나머지 권한을 각각 2진수로 나타내면 rwx/rw-/r— = 111/110/100 = 764 즉 chmod 644 [파일명]의 경우, 해당 파일 권한을 rw-/r—/r— 으로 수정한다. chmod 파일의 권한을 수정하는 명령어 # 사용법 chmod [권한] [파일명] # 예 # 파..

윈도우에서 리눅스 사용하기 (WSL2)

WSL2 (Windows Subsystem for Linux 2) 윈도우에서 리눅스를 돌리는 기능 (윈도우10에서 공식 지원하는 기능) 셋업 https://docs.microsoft.com/en-us/windows/wsl/install-win10 순서대로 따라하면 된다. 요약 (모든 과정은 관리자 권한 powershell이나 terminal 등에서 실행한다) 1. WSL을 사용 가능하도록 설정 dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart 2. 재부팅 3. 가상머신 기능을 사용 가능하도록 설정 dism.exe /online /enable-feature /featurename:Vir..

Chocolatey | 윈도우에서 리눅스처럼 프로그램 설치하기

Chocolatey 설치 윈도우에 각종 프로그램 설치를 도와주는 프로그램. powershell에서 동작함 1. powershell 관리작 권한으로 실행 2. https://chocolatey.org/install 에 보면 인스톨 커맨드가 나와있음. powershell에서 실행한다. Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.o..