
보통 root 계정의 home 디렉토리인 /root 경로에서 작업하긴함.

cat /root/.profile: /root/.profile 경로의 파일 내용을 출력함.mkdir -p test/test1/test2: test, test1 디렉토리를 자동으로 생성함.touch test.txtmy test.txt sample/test.txt: 현재 경로의 test.txt를 sample 디렉토리로 이동mv sample/test.txt sample/sample.txt: sample/ 경로의 test.txt를 sample.txt로 이름 변경.


Ubuntu는 Linux 기반의 OS 임.
docker pull ubuntu
docker images
ubuntu 이미지 다운로드
docker run -it `
>> --name ubuntu-container `
>> ubuntu `
>> /bin/bash
컨테이너 생성.
바로 /bin/bash를 적었기 때문에 ubuntu 환경에 바로 접속하게 됨.
whoami
접속한 계정 확인.
apt-get update
apt-get의 update 해야하는 목록 확인.
apt-get upgrade
apt-get의 update 목록을 실제로 upgrade.
apt-get dist-upgrade
설치된 모든 패키지를 최신 버전으로 업그레이드.
apt-get install -y sudo vim
권한 문제를 해결하기 위한 sudo, 문서 작업을 위한 vim 설치.
sudo passwd root
대충 root 계정의 비밀번호를 재설정함.
apt-get install -y adduser
adduser student
student라는 계정을 새로 만듦.
su - student
student 계정에 접속함.
mkdir test
touch test/test.txt
echo "HelloWorld" > test/test.txt
cat test/test.txt
대충 .txt 파일 하나 만들어줌.
adduser student
현재 상태에서 위 코드는 오류남.
users 그룹의 student 계정은 새로운 계정을 생성할 권한이 없음.
su - root
adduser tutorial
su - tutorial
다시 root 계정으로 접속하고 생성하고 접속하면 됨.
tutorial@d436241614d5:~$ cat ../student/test/test.txt
cat: ../student/test/test.txt: Permission denied
tutorial 계정으로 student 계정에서 만든 test.txt 파일을 실행하려고 하니까 권한 거부됨.
su - student
chmod 755 ../student
ls -l
chmod 755 test
ls -l
cd test
ls -l
chmod 755 test.txt
ls -l
su - tutorial
student 계정으로 접속해서 권한 좀 바꿔주고 toturial 계정으로 돌아옴.
cat ../student/test/test.txt
이제 tutorial 계정으로 student 계정의 test.txt를 실행해서 "HelloWorld"라는 글자가 출력되는 것을 볼 수 있음.
root 계정의 home 경로에서 실행.
vim .vimrc
vim 에디터의 설정파일을 만들어줌.
set smartindent
set tabstop=4
set expandtab
set shiftwidth=4
.vimrc에 indent, 탭 설정을 해줌.
입력 후 esc -> :wq!
cat .vimrc
변경사항이 저장된 것을 볼 수 있음.