728x90
반응형
SMALL

전체 글 342

231204 Linux 사용자 계정 관리

(root 계정에서 설정 할 것!) ■ 사용자 계정 관리 : 리눅스는 다중 사용자 시스템(multi user system) # 사용자 계정 정보 (sql : dba_users) [root@centos ~]# cat /etc/passwd user1:x:1000:1000:user1:/home/user1:/bin/bash 사용자명:암호:사용자id:사용자가 소속되 그룹id:전체이름:/home/홈디렉터리:/bin/기본셸 [root@centos ~]# cat /etc/group user1:x:1000:user1 그룹명:암호:그룹id:그룹에 속한 유저 ■ useradd, adduser : 유저 생성하는 명령어 # useradd : 유저 생성(암호X) [root@centos ~]# useradd user2 [root@..

Data Base/Linux 2023.12.04

231201 Linux 명령어2

명령어 해석 코드 timedatectl 현재 date, timezone 확인 [root@centos ~]# timedatectl timezone timezone 정보확인 [root@centos ~]# timedatectl list-timezones [root@centos ~]# timedatectl list-timezones | more set-timezone timezone 정보 변경 [root@centos ~]# timedatectl set-timezones "Asia/Seou" cal 달력 확인 [user1@centos ~]$ cal → 현재 달력 [user1@centos ~]$ cal 2023 → 2023년 달력 [user1@centos ~]$ cal 12 2023 → 2023년 12월 달력 re..

Data Base/Linux 2023.12.01

231201 Linux vi(visual editor), 커서 이동

■ vi(visual editor) - 문서편집기 [user1@centos test1]$ vi passwd # 이동 명령 키워드(키보드) 해석 h 왼쪽으로 이동 j 아래 이동 k 위로 이동 l 오른쪽 이동 H 화면 맨위로 이동 M 화면 중간으로 이동 L 화면 맨 아래로 이동 G 문서 맨 아래로 이동 1G 숫자 라인으로 이동 gg 제일 첫 라인으로 이동 ^ 그 줄의 맨 앞으로 이동 $ 그 줄의 맨 뒤로 이동 :n n번째 숫자 라인으로 이동 + 커서를 다음 행의 처음으로 이동 - 커서를 앞 행의 처음으로 이동 w 커서의 다음 단어의 첫글자로 이동 b 커서의 앞 단언의 첫글자로 이동 e 커서의 다음 단어의 마지막 글자로 이동 # 행 번호 출력 유무 :set nu 라인번호 보이게 출력 :set nonu 라인번호..

Data Base/Linux 2023.12.01

231130 Linux 명령어1

# user1 계정에서 root 계정으로 접속 [user1@centos ~]$ su - Password: [user1@centos ~]$ su - root Password: ■ 리눅스 시스템 종료 [root] 사용자가 리눅스 시스템을 종료할 수 있다 init 0 shutdown -h now halt poweroff ■ 리눅스 시스템 재부팅 [root] 사용자가 리눅스 시스템을 재부팅 할 수 있다. reboot init 6 shutdown -r now ls(list) : 디렉터리 안에 있는 파일이나 서브 디렉터리 등 디렉터리의 내용을 보는 명령 ls -l 파일들을 나열할 때 자세히 출력 ls -a 경로 안의 모든 파일들 나열(숨긴 파일도 포함) ls -h -l 옵션과 함께 사용하면 파일의 크기의 맞춰 단위..

Data Base/Linux 2023.11.30

231129 Python 실기 문제

[문제1] 구구단을 가로로 출력해주세요. for i in range(1, 10): for dan in range(2, 10): print("{} * {} = {}".format(dan, i, dan*i), end='\t') print(' ') [문제2] 감염병_발생현황.csv 데이터를 이용해서 년도별 감염병 발생현황을 bar plot, line plot 을 생성해주세요. import pandas as pd import matplotlib.pyplot as plt from matplotlib import font_manager, rc font_name = font_manager.FontProperties(fname='C:/Windows/Fonts/gulim.ttc').get_name() re('font',..

문제/Python 2023.11.29

231128 Python_Oracle 접속, conda 설치, 바인드변수, create_engin, 정규표현식, 메타문자

설치 Anaconda Prompt conda install -c anaconda cx_oracle (base) C:\Users\ITWILL>lsnrctl status : 상태정보 import pandas as pd from pandas import Series, DataFrame emp = pd.read_csv('c:/data/emp.csv') dept = pd.read_csv('c:/data/dept.csv') ■ 파이썬에서 오라클 접속 import cx_Oracle 오라클 접속 # 계정명, 비번, HOST명:PORT번호/serviece이름, encoding conn = cx_Oracle.connect("hr","hr","DESKTOP-E88DR0D:1521/xe",encoding="UTF-8") cu..

Language/Python 2023.11.28

231128 Python 문제

import sqlite3 import pandas as pd [문제1] 근무일수가 가장 많은 10위 까지 직원들의 employee_id, last_name, department_name, 근무일수를 출력해 주세요. 단. sqlite를 이용하세요. conn = sqlite3.connect(':memory:') c = conn.cursor() data = pd.read_csv("c:/data/emp.csv") dept_table = pd.read_csv("c:/data/dept.csv") emp_table.to_sql("emp", conn, index=False) dept_table.to_sql("dept", conn, index=False) c.execute("select * from emp") c.fe..

문제/Python 2023.11.28

231127 Python_join, inner join, outer join, union, union all, intersect, except, over(partition by), rank() over(), dense_rank over()

# 테이블 불러오기, 이관작업 data = pd.read_csv('c:/data/dept.csv') data.info() data.to_sql('dept', conn, index=False) c.execute("select * from dept") c.fetchall() # 컬럼명 확인 c.execute("pragma table_info(dept)") c.fetchall() # join # cartesian product(cross join) c.execute("""select employee_id, department_name from emp, dept""") c.fetchall() # ANSI join c.execute("""select employee_id, department_name from e..

Language/Python 2023.11.27
728x90
반응형
LIST