'Linux'에 해당되는 글 7건

Package manager

Linux 2021. 1. 24. 09:52

package manager는

우리가 앱스토어 또는 플레이 스토어 같은 파일들을 다운 받아 설치하듯이

리눅스에서 그러한 기능을 수행하는 것을 말한다.

apt, yum 등등 많다고 한다. 

사용방법은 크게 다르지 않다고 하니 apt로 보고 개념이해에 중점을 두도록 하자.

 

'Linux' 카테고리의 다른 글

nano 파일 에디터  (0) 2021.01.19
sudo  (0) 2021.01.19
mv  (0) 2021.01.19
기본명령어  (0) 2021.01.19
cd, rm, rm-r  (0) 2021.01.18
블로그 이미지

JustDoIt_Sun

,

nano 파일 에디터

Linux 2021. 1. 19. 18:45

nano 파일을 편집할 수 있는 에디터를 불러온다

sunhangui-MacBookAir:sunhangcho sunhangcho$ nano

실행화면

파일 생성

<html>

</html> 입력 

저장 : control O

파일 이름: hello.html

파일 생성 확인 

control x 로 빠져 나온 후

sunhangui-MacBookAir:sunhangcho sunhangcho$ ls -l

total 8

drwxr-xr-x   6 sunhangcho  staff   192  1 14 12:32 cisco project

-rw-r--r--   1 sunhangcho  staff    16  1 19 17:33 hello.html #생성 됨

drwxr-xr-x   7 sunhangcho  staff   224  1 19 12:34 linux

sunhangui-MacBookAir:sunhangcho sunhangcho$ 

 

다시 편집시 

nano hello.html #해당 파일 nano 편집 시작

  GNU nano 2.0.6                       File: hello.html                                                    

 

<html>

 

</html>

==============================================

Cut Text 

텍스트 자르기

UnCut Text

자른 텍스트 붙이기

control 6

마크셋, 맥터널에서 안됨

Where Is

찾기 기능 윈도우 control f 같은

 

'Linux' 카테고리의 다른 글

Package manager  (0) 2021.01.24
sudo  (0) 2021.01.19
mv  (0) 2021.01.19
기본명령어  (0) 2021.01.19
cd, rm, rm-r  (0) 2021.01.18
블로그 이미지

JustDoIt_Sun

,

sudo

Linux 2021. 1. 19. 17:24

sudo (super user do)

관리자 권한으로 실행해야 하는 경우에 앞에 붙인다.

예로 파일을 설치하거나 특정 작업에 권한이 없을때 

sudo를 사용하여 실행 한다.

'Linux' 카테고리의 다른 글

Package manager  (0) 2021.01.24
nano 파일 에디터  (0) 2021.01.19
mv  (0) 2021.01.19
기본명령어  (0) 2021.01.19
cd, rm, rm-r  (0) 2021.01.18
블로그 이미지

JustDoIt_Sun

,

mv

Linux 2021. 1. 19. 16:58

mv : Move 파일을 다른 디렉토리로 이동

mv 파일이름 디렉토리이름/

 

sunhangui-MacBookAir:dir2 sunhangcho$ ls -l #디렉토리2 자세히 보기

total 0

-rw-r--r--  1 sunhangcho  staff    0  1 19 14:30 aaa

drwxr-xr-x  5 sunhangcho  staff  160  1 19 16:48 dir3

-rw-r--r--  1 sunhangcho  staff    0  1 19 16:50 mv.txt #디렉토리2에 있음

sunhangui-MacBookAir:dir2 sunhangcho$ mv mv.txt dir3/  #디렉토리3으로 이동

sunhangui-MacBookAir:dir2 sunhangcho$ ls -l dir3/ #디렉토리3 자세히 보기

total 0

-rw-r--r--  1 sunhangcho  staff  0  1 19 12:43 1.txt

-rw-r--r--  1 sunhangcho  staff  0  1 19 12:43 2.txt

-rw-r--r--  1 sunhangcho  staff  0  1 19 16:50 mv.txt #디렉토리3에 있음

-rw-r--r--  1 sunhangcho  staff  0  1 19 16:48 rename

 

mv 파일이름 변경파일이름 #mv로도 파일이름을 변경할 수 있음

 

sunhangui-MacBookAir:dir2 sunhangcho$ ls -l

total 0

-rw-r--r--  1 sunhangcho  staff    0  1 19 14:30 aaa

drwxr-xr-x  5 sunhangcho  staff  160  1 19 16:51 dir3

-rw-r--r--  1 sunhangcho  staff    0  1 19 16:52 rename #디렉토리 2에 리네임 파일

sunhangui-MacBookAir:dir2 sunhangcho$ mv rename rename2 #파일 이름 변경

sunhangui-MacBookAir:dir2 sunhangcho$ ls -l

total 0

-rw-r--r--  1 sunhangcho  staff    0  1 19 14:30 aaa

drwxr-xr-x  5 sunhangcho  staff  160  1 19 16:51 dir3

-rw-r--r--  1 sunhangcho  staff    0  1 19 16:52 rename2 #디렉토리2에 rename이 rename2로 변경됨

sunhangui-MacBookAir:dir2 sunhangcho$ 

 

mv로 디렉토리 이름도 바꿀수 있음

mv /디렉토리위치/디렉토리위치/디렉토리(바꾸고 싶은 거)      /디렉토리위치/디렉토리위치/디렉토리(바꾸고싶은 이름)

sunhangui-MacBookAir:sunhangcho sunhangcho$ ls -l

total 0

drwx------@  5 sunhangcho  staff   160  1 19 11:19 Desktop

drwx------@  4 sunhangcho  staff   128  1 18 15:58 Documents

drwx------+ 30 sunhangcho  staff   960  1 19 10:47 Downloads

drwx------@ 63 sunhangcho  staff  2016  1 14 22:23 Library

drwx------+  3 sunhangcho  staff    96  1  8 14:27 Movies

drwx------+  3 sunhangcho  staff    96  1  8 14:27 Music

drwxr-xr-x   9 sunhangcho  staff   288  1  9 10:02 PacketTracer7.3.1.0362

drwx------+  3 sunhangcho  staff    96  1  8 14:27 Pictures

drwxr-xr-x+  4 sunhangcho  staff   128  1  8 14:27 Public

drwxr-xr-x   2 sunhangcho  staff    64  1 19 14:20 aa

drwxr-xr-x   7 sunhangcho  staff   224  1 19 12:34 aaa #이거를 linux 디렉토리 바꿈

drwxr-xr-x   6 sunhangcho  staff   192  1 14 12:32 cisco project

sunhangui-MacBookAir:sunhangcho sunhangcho$ mv /users/sunhangcho/aaa /users/sunhangcho/linux

 

total 0

drwx------@  5 sunhangcho  staff   160  1 19 11:19 Desktop

drwx------@  4 sunhangcho  staff   128  1 18 15:58 Documents

drwx------+ 30 sunhangcho  staff   960  1 19 10:47 Downloads

drwx------@ 63 sunhangcho  staff  2016  1 14 22:23 Library

drwx------+  3 sunhangcho  staff    96  1  8 14:27 Movies

drwx------+  3 sunhangcho  staff    96  1  8 14:27 Music

drwxr-xr-x   9 sunhangcho  staff   288  1  9 10:02 PacketTracer7.3.1.0362

drwx------+  3 sunhangcho  staff    96  1  8 14:27 Pictures

drwxr-xr-x+  4 sunhangcho  staff   128  1  8 14:27 Public

drwxr-xr-x   2 sunhangcho  staff    64  1 19 14:20 aa

drwxr-xr-x   6 sunhangcho  staff   192  1 14 12:32 cisco project

drwxr-xr-x   7 sunhangcho  staff   224  1 19 12:34 linux  #aaa에서 linux로 바뀜

sunhangui-MacBookAir:sunhangcho sunhangcho$ 

'Linux' 카테고리의 다른 글

nano 파일 에디터  (0) 2021.01.19
sudo  (0) 2021.01.19
기본명령어  (0) 2021.01.19
cd, rm, rm-r  (0) 2021.01.18
기본 명령어 pwd, mkdir, ls, ls -l  (0) 2021.01.18
블로그 이미지

JustDoIt_Sun

,

기본명령어

Linux 2021. 1. 19. 14:38

ls --help 설명서

ls -a 모두보기

ls -l 자세히 보기

ls -al 모든 파일 자세히 보기

ls -alS 모드 파일 자세히 보기 큰 파일 순서대로 대문자 S 중요 소문자로 할시 다른 명령어

mkdir -p 하위폴더 여러개 동시 생성

cp a파일 b파일 : a파일을 b파일로 복사, 현재 있는 디렉토리내에서

cp  a파일 /디렉토리 b파일

 

 

 

ls --help

명령어에대한 설명서 

 

root@goorm:/workspace/linux#
root@goorm:/workspace/linux# ls --help
사용법: ls [<옵션>]... [<파일>]...
List information about the FILEs (the current directory by default).
Sort entries alphabetically if none of -cftuvSUX nor --sort is specified.

Mandatory arguments to long options are mandatory for short options too.
  -a, --all                  do not ignore entries starting with .
  -A, --almost-all           do not list implied . and ..
      --author               with -l, print the author of each file
  -b, --escape               print C-style escapes for nongraphic characters
      --block-size=SIZE      scale sizes by SIZE before printing them; e.g.,
                               '--block-size=M' prints sizes in units of
                               1,048,576 bytes; see SIZE format below
  -B, --ignore-backups       do not list implied entries ending with ~
  -c                         with -lt: sort by, and show, ctime (time of last

 

 

mkdir -p dir1/dir2/dir3

여러개의 하위 폴더 동시에 생성 단 하위폴더로 생성

root@goorm:/workspace/linux# mkdir -p dir1/dir2/dir3
root@goorm:/workspace/linux#

 

root@goorm:/workspace/linux/dir1/dir2/dir3# mkdir --help
사용법: mkdir [옵션]... 디렉터리...
Create the DIRECTORY(ies), if they do not already exist.

Mandatory arguments to long options are mandatory for short options too.
  -m, --mode=MODE   set file mode (as in chmod), not a=rwx - umask
  -p--parents     no error if existing, make parent directories as needed
  -v, --verbose     print a message for each created directory
  -Z                   set SELinux security context of each created directory
                         to the default type
      --context[=CTX]  like -Z, or if CTX is specified then set the SELinux
                         or SMACK security context to CTX
      --help     이 도움말을 표시하고 끝냅니다
      --version  버전 정보를 출력하고 끝냅니다

 

-p : 축약형

--parents : 풀네임

 

'Linux' 카테고리의 다른 글

nano 파일 에디터  (0) 2021.01.19
sudo  (0) 2021.01.19
mv  (0) 2021.01.19
cd, rm, rm-r  (0) 2021.01.18
기본 명령어 pwd, mkdir, ls, ls -l  (0) 2021.01.18
블로그 이미지

JustDoIt_Sun

,

cd, rm, rm-r

Linux 2021. 1. 18. 21:21

기본 명령어 

cd

cd 이동할 디렉토리의 경로명

sunhangui-MacBookAir:linux sunhangcho$ pwd

/users/sunhangcho/linux

sunhangui-MacBookAir:linux sunhangcho$ cd dir1/

sunhangui-MacBookAir:dir1 sunhangcho$ 

 

상대경로와 절대경로

 

상대경로는 현재 디렉토리의 위치를 기준으로 다른 디렉토리의 위치를 표현하는 것으로 ..은 부모 디렉토리를 의미합니다. 'cd ..'은 현재 디렉토리의 부모 디렉토리로 이동하는 명령이 됩니다. 참고로 현재 디렉토리는 '.' 입니다. 

sunhangui-MacBookAir:dir1 sunhangcho$ cd ..# dir1폴더에서 상위폴더 linux폴더로 이동

sunhangui-MacBookAir:linux sunhangcho$ 

 

절대경로는 최상위 디렉토리를 기준으로 경로를 표현하는 것을 의미합니다. 최상위 디렉토리는 루트(root) 디렉토리라고 하고 '/' 입니다. 'cd /'는 최상위 디렉토리로 이동한다는 뜻입니다. 'cd /home/egoing'은 현재 디렉토리가 무엇이건 언제나 '/home/egoing'을 의미하는데 이런 식의 경로 표현을 절대경로라고 합니다. 

sunhangui-MacBookAir:dir2 sunhangcho$ 

sunhangui-MacBookAir:dir2 sunhangcho$ cd /users/sunhangcho/linux

sunhangui-MacBookAir:linux sunhangcho$ 

상위폴더로 이동시 디렉토리 앞에 /를 붙여야함 --> /users

                                                                            cd users/sunhangcho/linux  --> / 뺀경우 에러

sunhangui-MacBookAir:dir2 sunhangcho$ cd users/sunhangcho/linux

-bash: cd: users/sunhangcho/linux: No such file or directory

sunhangui-MacBookAir:dir2 sunhangcho$ 

 

rm

  • rm 파일명
  • rm -r 디렉토리명

--help

명령어 뒤에 --help를 붙이면 명령의 사용설명서가 출력됩니다. 

예 

  • ls --help
  • rm --help
  • mkdir --help
  • pwd --help
root@goorm:/workspace/linux# ls -l
합계 12
-rw-r--r-- 1 root root 2000 1월 12 07:34 README.md
-rw-rw-r-- 1 root root 545 1월 18 11:03 goorm.manifest
drwxrwxr-x 2 root root 4096 1월 18 11:22 hello_linux
root@goorm:/workspace/linux# cd hello_linux/
root@goorm:/workspace/linux/hello_linux# pwd
/workspace/linux/hello_linux
root@goorm:/workspace/linux/hello_linux# cd /workspace/linux #change directory 폴더 변경, 절대 경로
root@goorm:/workspace/linux# pwd
/workspace/linux
root@goorm:/workspace/linux# cd hello_linux/ #디렉토리 이동시
root@goorm:/workspace/linux/hello_linux# pwd
/workspace/linux/hello_linux
root@goorm:/workspace/linux/hello_linux# cd .. #폴더 변경, 상위 디렉토리 가기, 윈도우 백스페이와 같은...
root@goorm:/workspace/linux# pwd
/workspace/linux
root@goorm:/workspace/linux# cd ..
root@goorm:/workspace# pwd
/workspace
root@goorm:/workspace# cd ..
root@goorm:/# pwd
/ #최상위 경로
root@goorm:/# cd /workspace/linux
root@goorm:/workspace/linux#
root@goorm:~/hell0_linux# pwd
/root/hell0_linux
root@goorm:~/hell0_linux# ㅊㅇ..
bash: ㅊㅇ..: 명령어를 찾을 수 없음
root@goorm:~/hell0_linux# cd..
bash: cd..: 명령어를 찾을 수 없음
root@goorm:~/hell0_linux# cd ..
root@goorm:~# touch empty_file.txt #빈 파일 생성
root@goorm:~# ls
empty_file.txt hell0_linux
root@goorm:~# rm hell0_linux/ #rm 명령만으로는 디렉토리를 지울 수 없음
rm: 'hell0_linux/'를 지울 수 없음: 디렉터리입니다
root@goorm:~# rm empty_file.txt #파일은 가능
root@goorm:~# rm -r hell0_linux/ #디렉토리를 지우기 위해서는 rm -r 실행
root@goorm:~# ped
bash: ped: 명령어를 찾을 수 없음
root@goorm:~# pwd
/root #디렉토리 지워짐
root@goorm:~# rm --help #시스코 cli로 치면 ? 명령어
사용법: rm [<옵션>]... [<파일>]...
Remove (unlink) the FILE(s).
 
-f, --force ignore nonexistent files and arguments, never
prompt
-i prompt before every removal
-I prompt once before removing more than three fi
les, or
when removing recursively; less intrusive th
an -i,
while still giving protection against most m
istakes
--interactive[=WHEN] prompt according to WHEN: never, once (-I)
, or
always (-i); without WHEN, prompt always

'Linux' 카테고리의 다른 글

nano 파일 에디터  (0) 2021.01.19
sudo  (0) 2021.01.19
mv  (0) 2021.01.19
기본명령어  (0) 2021.01.19
기본 명령어 pwd, mkdir, ls, ls -l  (0) 2021.01.18
블로그 이미지

JustDoIt_Sun

,

ls

현재 디렉토리의 파일 목록을 출력하는 명령어. 'ls -l'은 자세히 보기

pwd

현재 위치하고 있는 디렉토리를 알려주는 명령어

mkdir

mkdir 새로 생성할 디렉토리명

root@goorm:/workspace/linux# # root@goorm:/workspace/lin
ux# ls -al
합계 16
drwxr-xr-x 2 root root 4096 1월 12 07:34 .
drwxr-xr-x 3 root root 4096 1월 18 11:03 ..
-rw-r--r-- 1 root root 0 11월 13 12:14 .temp
-rw-r--r-- 1 root root 2000 1월 12 07:34 README.md
-rw-rw-r-- 1 root root 545 1월 18 11:03 goorm.manifest
root@goorm:/workspace/linux# pwd #print working directory 현재 있는 디렉토리
/workspace/linux
root@goorm:/workspace/linux# mkdir hello_linux #make directory 디렉토리 생성
root@goorm:/workspace/linux# pwd
/workspace/linux
root@goorm:/workspace/linux# #
root@goorm:/workspace/linux# ls #list 현재 있는 디렉토리에서 하위 디렉토리 및 파일 보기
README.md goorm.manifest hello_linux
root@goorm:/workspace/linux# ls -l #hello_linux가 파일인지 디렉토리인지 자세히 확인하기위해 사용
합계 12
-rw-r--r-- 1 root root 2000 1월 12 07:34 README.md
-rw-rw-r-- 1 root root 545 1월 18 11:03 goorm.manifest
drwxrwxr-x 2 root root 4096 1월 18 11:22 hello_linux #drwxrwxr-x 권한을 보여주고 맨앞의 d는 디렉토리를 뜻함
root@goorm:/workspace/linux#

'Linux' 카테고리의 다른 글

nano 파일 에디터  (0) 2021.01.19
sudo  (0) 2021.01.19
mv  (0) 2021.01.19
기본명령어  (0) 2021.01.19
cd, rm, rm-r  (0) 2021.01.18
블로그 이미지

JustDoIt_Sun

,