mj@DESKTOP-8EI80N4:~$ pwd
/home/mj
mj@DESKTOP-8EI80N4:~$ ls
mj@DESKTOP-8EI80N4:~$ mkdir data - 디렉토리 생성
mj@DESKTOP-8EI80N4:~$ ls
data
mj@DESKTOP-8EI80N4:~$ rm data - 파일 또는 디렉토리 삭제
rm: cannot remove 'data': Is a directory - 이렇게 지워지지 않는 겨우
mj@DESKTOP-8EI80N4:~$ rm -r data - rm -r 폴더명 사용
-그래도 지워지지 않는다면 rm -rf 폴더명(강력함 각오해야함)
mj@DESKTOP-8EI80N4:~$ mkdir data
mj@DESKTOP-8EI80N4:~$ cd data
mj@DESKTOP-8EI80N4:~/data$ echo '안녕하세요'
안녕하세요
mj@DESKTOP-8EI80N4:~/data$ echo '안녕하세요' > hello.txt
mj@DESKTOP-8EI80N4:~/data$ ls
hello.txt
mj@DESKTOP-8EI80N4:~/data$ cat hello.txt
안녕하세요
mj@DESKTOP-8EI80N4:~/data$ cat > hello.txt
ㅋㅋㅋㅋㅋㅋ
ㅋㅋㅋㅋㅋㅋ
하잉
^C -ctrl + c
mj@DESKTOP-8EI80N4:~/data$ cat hello.txt
ㅋㅋㅋㅋㅋㅋ
ㅋㅋㅋㅋㅋㅋ
하잉
echo ‘하고싶은말’
echo ‘하고싶은말’ > 파일명. txt(파일로 저장됨
cat 파일명.txt(내용 읽어오기)
cat > 파일명.txt(’w’ 새로 작성하기)
cat >> 파일명.txt(’a’ 추가하기)
cat <<'end'> dairy.txt
mj@DESKTOP-8EI80N4:~/data$ cat test.py
a = 'Life is Egg'
c = a.replace('Egg','Beautiful')
print(a)
print(c)
mj@DESKTOP-8EI80N4:~/data$ python -V
Command 'python' not found, did you mean:
command 'python3' from deb python3
command 'python' from deb python-is-python3
mj@DESKTOP-8EI80N4:~/data$ python3 -V
Python 3.10.12
mj@DESKTOP-8EI80N4:~/data$ python3 test.py
Life is Egg
Life is Beautiful
mj@DESKTOP-8EI80N4:~/data$ ls
hello.txt test.py
mj@DESKTOP-8EI80N4:~/data$ cat >> test.py
print("라인이 끝났습니다. 마지막 라인은 나!")^C
mj@DESKTOP-8EI80N4:~/data$ cat test.py
a = 'Life is Egg'
c = a.replace('Egg','Beautiful')
print(a)
print(c)
mj@DESKTOP-8EI80N4:~/data$ python3 test.py
Life is Egg
Life is Beautiful
mj@DESKTOP-8EI80N4:~/data$ cat >> test.py
print("라인이 끝났습니다. 마지막 라인은 나!")
^C
mj@DESKTOP-8EI80N4:~/data$ cat test.py
a = 'Life is Egg'
c = a.replace('Egg','Beautiful')
print(a)
print(c)
print("라인이 끝났습니다. 마지막 라인은 나!")
mj@DESKTOP-8EI80N4:~/data$ python3 test.py
Life is Egg
Life is Beautiful
라인이 끝났습니다. 마지막 라인은 나!
mj@DESKTOP-8EI80N4:~/data$ cat <<'end'> dairy.txt
> 오늘은 밥이 맛있었다
> 그래서 살이 쪘다
> 슬프다
> end
mj@DESKTOP-8EI80N4:~/data$ cat <<'끝'> dairy.txt
> 오늘 일기 시작
> 오늘 일기 끝
> 끝
mj@DESKTOP-8EI80N4:~/data$ cat dairy.txt
오늘 일기 시작
오늘 일기 끝
mj@DESKTOP-8EI80N4:~/data$
mj@DESKTOP-8EI80N4:~/data$ nano test.txt -> 편집기
mj@DESKTOP-8EI80N4:~/data$ cd ..
mj@DESKTOP-8EI80N4:~$ ls
data
mj@DESKTOP-8EI80N4:~$ cd ..
mj@DESKTOP-8EI80N4:/home$ ls
mj
mj@DESKTOP-8EI80N4:/home$ cd mj
mj@DESKTOP-8EI80N4:~$ sudo nano ~/.bashrc -> 유저의 환경설정파일
패키지 설치
mj@DESKTOP-8EI80N4:~$ sudo apt install cowsay
mj@DESKTOP-8EI80N4:~$ cowsay "ㅎㅎㅎ"
________
< ㅎㅎㅎ >
--------
\\ ^__^
\\ (oo)\\_______
(__)\\ )\\/\\
||----w |
|| ||
mj@DESKTOP-8EI80N4:~$ sudo apt remove cowsay
ssh설치
mj@DESKTOP-8EI80N4:~$ sudo apt install openssh-server
ssh:SSH(Secure Shell)는 네트워크를 통해 다른 컴퓨터에 안전하게 접속하기 위한 프로토콜입니다. 주로 원격 로그인이나 파일 전송 등을 위해 사용됩니다. SSH는 데이터 통신을 암호화하여, 접속 과정에서 데이터가 도청되거나 변조되는 것을 방지합니다.
SSH 서비스가 활성화되어 있는지, 실행 중인지, 그리고 최근에 발생한 로그 메시지들을 확인할 수 있습니다.
mj@DESKTOP-8EI80N4:~$ sudo systemctl status ssh
mj@DESKTOP-8EI80N4:~$ sudo systemctl start ssh
mj@DESKTOP-8EI80N4:~$ sudo systemctl stop ssh
단축키
alt + shift + "+" 칸 나누기
alt + shift + "-" 칸 없애기
ctrl + shift + w 터미널 닫기
PS C:\\Users\\Admin> ssh mj@localhost
The authenticity of host 'localhost (::1)' can't be established.
ED25519 key fingerprint is SHA256:+VhonywMmK3KQjgohch2nLnNK0Z3F56qTCNvkpLQtAQ.
This key is not known by any other names.
Are you sure you want to continue connecting (yes/no/[fingerprint])? y
Please type 'yes', 'no' or the fingerprint: yes
Warning: Permanently added 'localhost' (ED25519) to the list of known hosts.
mj@localhost's password:
Welcome to Ubuntu 22.04.5 LTS (GNU/Linux 5.15.167.4-microsoft-standard-WSL2 x86_64)
* Documentation: <https://help.ubuntu.com>
* Management: <https://landscape.canonical.com>
* Support: <https://ubuntu.com/pro>
System information as of Thu Feb 13 17:12:27 KST 2025
System load: 0.0 Processes: 34
Usage of /: 0.1% of 1006.85GB Users logged in: 1
Memory usage: 3% IPv4 address for eth0: 172.26.38.186
Swap usage: 0%
* Strictly confined Kubernetes makes edge and IoT secure. Learn how MicroK8s
just raised the bar for easy, resilient and secure K8s cluster deployment.
<https://ubuntu.com/engage/secure-kubernetes-at-the-edge>
Last login: Thu Feb 13 16:45:21 2025
mj@DESKTOP-8EI80N4:~$ exit
logout
Connection to localhost closed.
mj@DESKTOP-8EI80N4:~$ ifconfig
Command 'ifconfig' not found, but can be installed with:
sudo apt install net-tools
mj@DESKTOP-8EI80N4:~$ sudo apt install net-tools
[sudo] password for mj:
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following NEW packages will be installed:
net-tools
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 204 kB of archives.
After this operation, 819 kB of additional disk space will be used.
Get:1 <http://archive.ubuntu.com/ubuntu> jammy/main amd64 net-tools amd64 1.60+git20181103.0eebece-1ubuntu5 [204 kB]
Fetched 204 kB in 1s (179 kB/s)
Selecting previously unselected package net-tools.
(Reading database ... 45465 files and directories currently installed.)
Preparing to unpack .../net-tools_1.60+git20181103.0eebece-1ubuntu5_amd64.deb ...
Unpacking net-tools (1.60+git20181103.0eebece-1ubuntu5) ...
Setting up net-tools (1.60+git20181103.0eebece-1ubuntu5) ...
Processing triggers for man-db (2.10.2-1) ...
mj@DESKTOP-8EI80N4:~$ ifconfig
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet ***172.26.38.186*** netmask 255.255.240.0 broadcast 172.26.47.255
inet6 fe80::215:5dff:fedc:f43a prefixlen 64 scopeid 0x20<link>
ether 00:15:5d:dc:f4:3a txqueuelen 1000 (Ethernet)
RX packets 61466 bytes 83079340 (83.0 MB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 2438 bytes 191783 (191.7 KB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
inet6 ::1 prefixlen 128 scopeid 0x10<host>
loop txqueuelen 1000 (Local Loopback)
RX packets 118 bytes 18598 (18.5 KB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 118 bytes 18598 (18.5 KB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
PS C:\\Users\\Admin> ssh mj@localhost 이렇게로도 들어가지고,
PS C:\\Users\\Admin> ssh mj@172.26.38.186 로도 들어가짐
단축키 alt + shift + "+" 칸 나누기 alt + shift + "-" 칸 없애기 ctrl + shift + w 터미널 닫기
mj@DESKTOP-8EI80N4:~$ python3 -V
Python 3.10.12
mj@DESKTOP-8EI80N4:~$ sudo apt update
[sudo] password for mj:
Hit:1 <http://archive.ubuntu.com/ubuntu> jammy InRelease
Get:2 <http://security.ubuntu.com/ubuntu> jammy-security InRelease [129 kB]
Get:3 <http://archive.ubuntu.com/ubuntu> jammy-updates InRelease [128 kB]
Get:4 <http://archive.ubuntu.com/ubuntu> jammy-backports InRelease [127 kB]
Get:5 <http://security.ubuntu.com/ubuntu> jammy-security/main amd64 Packages [2079 kB]
Get:6 <http://archive.ubuntu.com/ubuntu> jammy-updates/main amd64 Packages [2316 kB]
Get:7 <http://archive.ubuntu.com/ubuntu> jammy-updates/universe amd64 Packages [1187 kB]
Get:8 <http://archive.ubuntu.com/ubuntu> jammy-updates/universe Translation-en [291 kB]
Fetched 6258 kB in 3s (2246 kB/s)
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
All packages are up to date.
mj@DESKTOP-8EI80N4:~$ cat /etc/os*
PRETTY_NAME="Ubuntu 22.04.5 LTS"
NAME="Ubuntu"
VERSION_ID="22.04"
VERSION="22.04.5 LTS (Jammy Jellyfish)"
VERSION_CODENAME=jammy
ID=ubuntu
ID_LIKE=debian
HOME_URL="<https://www.ubuntu.com/>"
SUPPORT_URL="<https://help.ubuntu.com/>"
BUG_REPORT_URL="<https://bugs.launchpad.net/ubuntu/>"
PRIVACY_POLICY_URL="<https://www.ubuntu.com/legal/terms-and-policies/privacy-policy>"
UBUNTU_CODENAME=jammy
2025.02.18
mj@DESKTOP-8EI80N4:~$ ifconfig
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 172.26.38.186 netmask 255.255.240.0 broadcast 172.26.47.255
inet6 fe80::215:5dff:fedc:f11a prefixlen 64 scopeid 0x20<link>
ether 00:15:5d:dc:f1:1a txqueuelen 1000 (Ethernet)
RX packets 9698 bytes 14744197 (14.7 MB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 2050 bytes 140376 (140.3 KB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
inet6 ::1 prefixlen 128 scopeid 0x10<host>
loop txqueuelen 1000 (Local Loopback)
RX packets 40 bytes 4631 (4.6 KB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 40 bytes 4631 (4.6 KB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
============================================================
PS C:\\Users\\Admin> ssh mj@172.26.38.186
mj@172.26.38.186's password:
Welcome to Ubuntu 22.04.5 LTS (GNU/Linux 5.15.167.4-microsoft-standard-WSL2 x86_64)
* Documentation: <https://help.ubuntu.com>
* Management: <https://landscape.canonical.com>
* Support: <https://ubuntu.com/pro>
System information as of Tue Feb 18 14:54:33 KST 2025
System load: 0.0 Processes: 31
Usage of /: 0.1% of 1006.85GB Users logged in: 1
Memory usage: 2% IPv4 address for eth0: 172.26.38.186
Swap usage: 0%
* Strictly confined Kubernetes makes edge and IoT secure. Learn how MicroK8s
just raised the bar for easy, resilient and secure K8s cluster deployment.
<https://ubuntu.com/engage/secure-kubernetes-at-the-edge>
Last login: Tue Feb 18 14:49:44 2025
파일 탐색기가 열림
mj@DESKTOP-8EI80N4:~$ explorer.exe .
mj@DESKTOP-8EI80N4:~$ ls
data
mj@DESKTOP-8EI80N4:~$ cd data
mj@DESKTOP-8EI80N4:~/data$ ls
test.txt
mj@DESKTOP-8EI80N4:~/data$
-mysql 설치 설치 하기 전 sudp apt update 꼭 하기
mj@DESKTOP-8EI80N4:~$ sudo apt install mysql-server
mj@DESKTOP-8EI80N4:~$ sudo mysql
mj@DESKTOP-8EI80N4:~$ sudo systemctl status mysql
● mysql.service - MySQL Community Server
Loaded: loaded (/lib/systemd/system/mysql.service; enabled; vendor preset: enabled)
Active: active (running) since Tue 2025-02-18 15:02:35 KST; 3min 2s ago
Process: 1628 ExecStartPre=/usr/share/mysql/mysql-systemd-start pre (code=exited, status=0/SUCCESS)
Main PID: 1636 (mysqld)
Status: "Server is operational"
Tasks: 38 (limit: 19086)
Memory: 361.3M
CGroup: /system.slice/mysql.service
└─1636 /usr/sbin/mysqld
mj@DESKTOP-8EI80N4:~$ sudo systemctl stop mysql
mj@DESKTOP-8EI80N4:~$ sudo systemctl status mysql
○ mysql.service - MySQL Community Server
Loaded: loaded (/lib/systemd/system/mysql.service; enabled; vendor preset: enabled)
Active: inactive (dead) since Tue 2025-02-18 15:06:40 KST; 2s ago
Process: 1628 ExecStartPre=/usr/share/mysql/mysql-systemd-start pre (code=exited, status=0/SUCCESS)
Process: 1636 ExecStart=/usr/sbin/mysqld (code=exited, status=0/SUCCESS)
Main PID: 1636 (code=exited, status=0/SUCCESS)
Status: "Server shutdown complete"
mj@DESKTOP-8EI80N4:~$ sudo apt remove mysql-server
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done