본문 바로가기

카테고리 없음

리눅스 탐방기 : 리눅스 환경에서 사용하기 좋은 명령어

제가  리눅스 GUI 환경에서 터미널로 즐겨쓰는 명령어를
보여드리겠습니다.

 

 

1.  vsCode로  열기 

 

제가 선호하는  에디터는 비쥬얼 스튜디오 코드입니다.  많은 익스텐션을  제공해서 그렇습니다.

# 지금 환경에서 비쥬얼 스튜디오 코드를 열은다~~
$ code .

 

 

2.  파일 목록 보기

 

(1)  현재 경로에서 파일 목록 보기 

andante@andante-All-Series:~/바탕화면/test$ ls
test.txt

 

(2)   현재 경로에서 파일 목록 전체 보기 

# a 라는 옵션을 이용합니다. 
andante@andante-All-Series:~/바탕화면/test$ ls -a
.  ..  test.txt

 

   tip ! ) help 명령어를 이용하면 도움말을 볼수 있습니다. 

andante@andante-All-Series:~/바탕화면/test$ ls --help
사용법: ls [<옵션>]... [<파일>]...
<파일>의 정보를 나타냅니다(기본: 현재 디렉터리).
-cftuvSUX 또는 --sort 옵션을 지정하지 않으면 항목을 알파벳 순으로 정렬합니다.

긴 옵션의 필수 인자값은 짧은 옵션에서도 마찬가지입니다.
  -a, --all                  . (점)으로 시작하는 항목을 무시하지 않습니다
  -A, --almost-all           . 과 .. 를 목록으로 나타내지 않습니다
      --author               -l 옵션을 붙이면, 각 파일의 작성자를 출력합니다
  -b, --escape               출력할 수 없는 문자를 C언어 방식 이스케이프로 출력합니다
      --block-size=SIZE      with -l, scale sizes by SIZE when printing them;
                               e.g., '--block-size=M'; 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
                               modification of file status information);
                               with -l: show ctime and sort by name;
                               otherwise: sort by ctime, newest first
  -C                         list entries by columns
      --color[=WHEN]         colorize the output; WHEN can be 'always' (default
                               if omitted), 'auto', or 'never'; more info below
  -d, --directory            list directories themselves, not their contents
  -D, --dired                generate output designed for Emacs' dired mode
  -f                         do not sort, enable -aU, disable -ls --color
  -F, --classify             append indicator (one of */=>@|) to entries
      --file-type            likewise, except do not append '*'
      --format=WORD          across -x, commas -m, horizontal -x, long -l,
                               single-column -1, verbose -l, vertical -C
      --full-time            like -l --time-style=full-iso
  -g                         -l과 같지만 소유주를 보여주지 않습니다
      --group-directories-first
                             group directories before files;
                               can be augmented with a --sort option, but any
                               use of --sort=none (-U) disables grouping
  -G, --no-group             길게 보여주지만 그룹 이름은 출력하지 않음
  -h, --human-readable       -l, -s 옵션과 같이, 1K 234M 2G 처럼 크기를 출력.
      --si                   비슷하지만 1024배수가 아닌 1000배수를 활용합니다
  -H, --dereference-command-line
                             명령행에 나열한 심볼릭 링크를 따라갑니다
      --dereference-command-line-symlink-to-dir
                             디렉터리를 가리키는 각 명령행 심볼릭 링크를
                               따라갑니다
      --hide=<패턴>          셸 <패턴>에 일치하는 암시 항목을 나타내지 않습니다
                             (-a 또는 -A로 동작 덮어씀)
      --hyperlink[=<시기>]     파일 이름의 하이퍼링크를 만듭니다.
                               <시기>에는 'always'(생략시 기본) 또는
                               'auto', 'never'가 들어갑니다.
      --indicator-style=WORD  append indicator with style WORD to entry names:
                               none (default), slash (-p),
                               file-type (--file-type), classify (-F)
  -i, --inode                print the index number of each file
  -I, --ignore=PATTERN       do not list implied entries matching shell PATTERN
  -k, --kibibytes            default to 1024-byte blocks for disk usage;
                               used only with -s and per directory totals
  -l                         use a long listing format
  -L, --dereference          when showing file information for a symbolic
                               link, show information for the file the link
                               references rather than for the link itself
  -m                         fill width with a comma separated list of entries
  -n, --numeric-uid-gid      -l과 유사하나, 사용자/그룹 숫자 ID를 나타냅니다
  -N, --literal              따옴표 처리하지 않은 항목 이름을 출력합니다
  -o                         -l과 유사하나, 그룹 정보를 나타내지 않습니다
  -p, --indicator-style=slash
                             디렉터리 뒤에 / 표시를 붙입니다
  -q, --hide-control-chars   print ? instead of nongraphic characters
      --show-control-chars   show nongraphic characters as-is (the default,
                               unless program is 'ls' and output is a terminal)
  -Q, --quote-name           enclose entry names in double quotes
      --quoting-style=WORD   use quoting style WORD for entry names:
                               literal, locale, shell, shell-always,
                               shell-escape, shell-escape-always, c, escape
                               (overrides QUOTING_STYLE environment variable)
  -r, --reverse              정렬을 역순으로 합니다
  -R, --recursive            하위 디렉터리를 연속으로 조회합니다
  -s, --size                 각 파일의 블록 단위 할당 크기를 출력합니다
  -S                         sort by file size, largest first
      --sort=WORD            sort by WORD instead of name: none (-U), size (-S),
                               time (-t), version (-v), extension (-X)
      --time=WORD            change the default of using modification times;
                               access time (-u): atime, access, use;
                               change time (-c): ctime, status;
                               birth time: birth, creation;
                             with -l, WORD determines which time to show;
                             with --sort=time, sort by WORD (newest first)
      --time-style=TIME_STYLE  time/date format with -l; see TIME_STYLE below
  -t                         시간순으로 정렬. 최신이 먼저옵니다. --time 참조
  -T, --tabsize=<열>         8 대신 <열> 길이만큼 탭 간격을 지정합니다
  -u                         with -lt: sort by, and show, access time;
                               with -l: show access time and sort by name;
                               otherwise: sort by access time, newest first
  -U                         do not sort; list entries in directory order
  -v                         natural sort of (version) numbers within text
  -w, --width=COLS           set output width to COLS.  0 means no limit
  -x                         list entries by lines instead of by columns
  -X                         sort alphabetically by entry extension
  -Z, --context              print any security context of each file
  -1                         list one file per line.  Avoid '\n' with -q or -b
      --help     이 도움말을 표시하고 끝냅니다
      --version  버전 정보를 출력하고 끝냅니다

<크기> 인자는 정수값과 추가 단위로 구성합니다 (예: 10K는 10*1024).
단위는 K,M,G,T,P,E,Z,Y (1024 배수) 또는 KB,MB,... (1000 배수) 입니다.
이진 접미사의 경우 마찬가지입니다. KiB=K, MiB=M, 등과 같습니다.

<시각_형식> 인자는 full-iso, long-iso, iso, locale, or +<형식> 중 하나가 될 수 있습니다.
<형식>은 date(1) 명령처럼 해석합니다.  <형식>이 <형식1><newline><형식2>의 형태라면,
<형식1>에는 최신 이전의 설정을 적용하고 <형식2>에 최신 설정을 적용합니다.
<시각_형식> 앞에 'posix-' 접두부를 붙이면 POSIX 로캘이 아닐 경우에만 동작합니다.
<시각_형식> 환경 변수는 또한 활용 기본 모양새를 설정하기도 합니다.

Using color to distinguish file types is disabled both by default and
with --color=never.  With --color=auto, ls emits color codes only when
standard output is connected to a terminal.  The LS_COLORS environment
variable can change the settings.  Use the dircolors command to set it.

종료 상태코드:
 0  정상,
 1  단순한 문제 (예: 하위 디렉터리 접근 불가),
 2  중대한 문제 (예: 명령행 인자 접근 불가).

GNU coreutils 온라인 도움말: <https://www.gnu.org/software/coreutils/>
번역 버그는 <https://translationproject.org/team/ko.html>에 알려주십시오
완전한 문서 <https://www.gnu.org/software/coreutils/ls>
또는 로컬 문서: info '(coreutils) ls invocation'

 

3. 폴더 생성 && 폴더 삭제 

 

(1) 폴더 생성

# 폴더 생성

andante@andante-All-Series:~/바탕화면/test$ mkdir create

# 조회하기 

andante@andante-All-Series:~/바탕화면/test$ ls
create  test.txt

 

(2) 폴더 삭제

# 폴더 삭제하기 
andante@andante-All-Series:~/바탕화면/test$ rmdir create

# 폴더 삭제되었는지 조회하기 
andante@andante-All-Series:~/바탕화면/test$ ls
test.txt

 

4. 파일 생성 && 파일 삭젶 

 

# 빈 파일 생성하기
andante@andante-All-Series:~/바탕화면/test$ touch create.ts
andante@andante-All-Series:~/바탕화면/test$ ls
create.ts  test.txt

# 빈 파일 삭제하기 
andante@andante-All-Series:~/바탕화면/test$ rm create.ts
andante@andante-All-Series:~/바탕화면/test$ ls
test.txt