Linux - 파일 및 폴더 생성

2dean·2023년 5월 19일
0

Linux 기초

목록 보기
2/13
post-thumbnail

파일 및 폴더 생성

touch

새로운 파일 또는 여러개의 파일을 생성할 때 사용하는 명령어입니다
확장자 없이 써도 만들 수 있음

touch mizz

touch mizz.txt

한꺼번에 여러개 만들기

touch rose lily jacob

touch man

touch – change file access and modification times
The touch utility sets the modification and access times of files. If
any file does not exist, it is created with default permissions.


file

file
:download ddu$ clear
:download ddu$ file lily.jpeg
lily.jpeg: JPEG image data, JFIF standard 1.01, aspect ratio, density 1x1, segment length 16, baseline, precision 8, 93x93, components 3

이미지 파일의 확장자를 지우고 txt로 했을 경우 이미지 뷰어로 열지 않고 텍스트 편집기로 열게됨!
확장자 명을 변경하더라도 운영체제는 원래 이미지 파일이라고 인지하고 있음
응용프로그램에는 영향이 있으므로 확장자 제대로써야함 -
확장자 명이 실제 파일의 타입를 정하는게 아님 메타데이터(?) ㅎ ㅎ

mkdir

make directory

존재하지 않는 Chickens 폴더에 Roosters 폴더 생성하기

-p 옵션을 사용해 상위 폴더를 지정해줘야함

mkdir -p Chickens/Roosters 

Project 라는 폴더 만들고 파일 여러개 만들기

:linux ddu$ mkdir Project
:linux ddu$ ls
Cats		Dogs		Project		download
Chickens	Horses		cutePic		my website
:linux ddu$ cd Project
:Project ddu$ touch index.html app.css app.js
:Project ddu$ ls
app.css		app.js		index.html
:Project ddu$
profile
냅다 써보는 공부의 흔적😇

0개의 댓글

관련 채용 정보