echo "한글" : 한글이라는 내용 print
echo "hello" > a.txt : a.txt 에 ecoh 의 결과물인 hello 라는 문자열 저장
mv filename1 filename2 : 파일 이름 1에서 2로 바꾸기
date > b.txt : b.txt 에 date의 결과물인 문자열 저장
date : 현재 시스템 시간 보여줌
파이썬에서 date == datetime.datetime.now() 이다
import datetime
datetime.datetime.now()
-> datetime.datetime(2023, 3, 22, 13, 48, 34, 779759)
from datetime import datetime
datetime.now()
-> datetime.datetime(2023, 3, 22, 13, 48, 34, 779759)
# re_input.py
data = input()
print(data)
#a.txt
how's it going
python3 re_input.py < a.txt
-> how's it going
python3 re_input.py < a.txt : a.txt 내용을 input 으로 넣어서 py 파일 실행
head filename : 파일 앞 부분 조금 보여줌
head -n 10 filename : 파일 앞 10 줄 보여줌
tail filename : 파일 뒷 부분 조금 보여줌
ls /file/directory/ | wc -l : 폴더에 있는 ls 결과 행 개수 출력
- rwx r-x r-x
위 정보는 4부분으로 나눌 수 있다.
- 파일(-), 디렉토리(d)를 구분
rwx 사용자(owner, 소유자) 권한(퍼미션)
r-x 그룹(group) 권한
r-x 다른 사용자(other) 권한
rwx는 각각 읽기(read), 쓰기(write), 실행(execute) 권한을 나타냅니다.
chmod o-rw /mount/cs4ks_2023/파일이름 : 파일 이름 권한을 다른 사용자 rw 불가능하게 바꾸기
python3 format_str.py > /mount/cs4ks_2023/ug20191222/format_str.print
내가 만든 파일의 결과를 새로운 format_str.print 라는 파일에 저장
'수업정리 > Fundamental' 카테고리의 다른 글
[Python] 한글 유니코드 2 - 한글을 byte 데이터로 만들기, byte(), bytearray() (0) | 2023.04.05 |
---|---|
Python basic 2 - 수학 함수(all, max, min, sorted, pow)format, zip (0) | 2023.03.31 |
[Python] 한글 유니코드 (0) | 2023.03.17 |
python basic 1 - data type, 연산자, char(), ord(), int(), hex() (0) | 2023.03.15 |
vi 명령어 (0) | 2023.03.10 |