[AIX 운영 체제와 장치 관리 30] BSD 4.3 관리자 참조(프린터·관리 명령·cron·장치·UUCP·파일 시스템·터미널)와 입출력 방향 바꾸기
https://archive.horanglab.com/posts/aix-osdev-30
핵심 정리
- AIX는 4.3 BSD와 System V 두 인쇄 하위 시스템을 지원하며 SMIT로 하나만 켭니다.
/etc/printcap은 없고 스풀러 구성은/etc/qconfig, 프린터 기능은 ODM(mkvirprt)에 둡니다. - 장치는 드라이버가 커널(확장)에 있고
/dev특수 파일과/etc/objrepos객체 데이터베이스 항목이 맞아야 쓸 수 있으며,/etc/methods의 메서드를 구성 관리자(cfgmgr)가 호출합니다. - 파일 시스템 정보는
/etc/filesystems스탠자에 두며 check 변수가 fstab의 fsck 패스 필드에 해당합니다. 모두 마운트는mount all, 모두 해제는umount all입니다. - 파일 기술자 0·1·2는 표준 입력·출력·오류입니다.
>는 덮어쓰기(noclobber면 거부),>>는 덧붙이기,2>는 오류,<<(<<-)는 here 문서입니다.cat a b c > a는 a를 먼저 비우므로 조심합니다. - 파이프는 왼쪽에서 오른쪽 한 방향이며 각 명령은 별도 프로세스로 동시에 실행됩니다. tee는 출력을 화면에 보이면서 파일에 복사하고
-a로 덧붙입니다.
| 항목 | 내용 |
|---|---|
| 버전 | AIX 6.1 (5.3판과 거의 같음) |
| 원문 | Operating system and device management — 5.3판 336343쪽과 BSD 부록, 6.1판 325338쪽 |
| 관련 명령어 | mkvirprt, qadm, cfgmgr, crfs, mount all, penable, tic, cat, tee, echo, capture, script, banner |
| 관련 파일 | /etc/qconfig, /etc/hosts.lpd, /etc/methods, /etc/objrepos, /etc/filesystems, /usr/lib/terminfo, /dev/null |
AIX 운영 체제는 4.3 BSD와 System V 두 인쇄 하위 시스템을 지원합니다.
System V 방식 인쇄 하위 시스템은 System V Release 4 명령, 큐, 파일을 쓰며 같은 방식으로 관리합니다. 다음은 4.3 BSD 방식 인쇄 하위 시스템을 관리하는 데 알아야 할 내용입니다. 어느 하위 시스템을 켤지는 SMIT로 정합니다. 한 번에 하나만 활성일 수 있습니다.
인쇄는 /usr/lpd 디렉터리의 프로그램과 구성으로 관리합니다. 4.3 BSD와 AIX 프린터 하위 시스템은 설계, 구성, 큐 메커니즘, 데몬 프로세스가 다릅니다. 그러나 둘 다 원격 인쇄에 lpd 프로토콜을 씁니다. 두 시스템 모두 /etc/hosts.lpd가 있으면 그것을, 없으면 /etc/host.equiv(원문 그대로)를 씁니다. AIX 프린터 하위 시스템은 4.3 BSD 프린터 하위 시스템으로 가는 게이트웨이를 제공하므로, AIX 시스템은 4.3 BSD 시스템에 인쇄 작업을 보내고 4.3 BSD 시스템이 보낸 작업을 받을 수 있습니다.
4.3 BSD의 /etc/printcap 파일은 AIX에 없습니다. 이 파일은 스풀러 구성과 프린터 기능 데이터베이스를 합친 것입니다. 사용자는 프린터를 올바르게 설정하려면 printcap 파일의 형식과 키워드를 알아야 합니다.
AIX의 /etc/qconfig 파일에는 스풀러 구성 정보만 있습니다. 프린터 기능은 ODM의 미리 정의된 데이터베이스나 사용자 정의 데이터베이스에 정의합니다. mkvirprt(가상 프린터 만들기) 명령으로 특정 프린터의 기능을 시스템에 정의할 수 있습니다.
원격 호스트 viking에 있는 프린터 lp0으로 인쇄할 수 있게 하려면 4.3 BSD 시스템의 /etc/printcap 파일에 다음을 넣습니다.
lp0|Print on remote printer attached to
viking:Z
:lp=:rm=viking:rp=lp:st=/usr/spool/lp0d
AIX에서 같은 일을 하려면 /etc/qconfig 파일에 다음을 넣습니다.
lp0:
device = dlp0
host = viking
rq = lp
dlp0:
backend = /usr/lib/lpd/rembak
AIX는 다음 프린터 명령과 라이브러리 함수를 지원합니다.
| 명령 | 설명 |
|---|---|
| cancel(1) | 줄 프린터 요청을 취소합니다. |
| chquedev(1) | 프린터나 플로터 큐 장치 이름을 바꿉니다. |
| chvirprt(1) | 가상 프린터의 속성 값을 바꿉니다. |
| disable(1) | 프린터 큐를 끕니다. |
| enable(1) | 프린터 큐를 켭니다. |
| hplj(1) | K 카트리지를 쓰는 HP LaserJetII용으로 troff 출력을 후처리합니다. |
| ibm3812(1) | IBM 3812 Mod 2 Pageprinter용으로 troff 출력을 후처리합니다. |
| ibm3816(1) | IBM 3816 Pageprinter용으로 troff 출력을 후처리합니다. |
| ibm5587G(1) | 32x32/24x24 카트리지를 쓰는 IBM 5587G용으로 troff 출력을 후처리합니다. |
| lp(1) | 줄 프린터에 요청을 보냅니다. |
| lpr(1) | 인쇄 작업을 큐에 넣습니다. |
| lprm(1) | 줄 프린터 스풀 큐에서 작업을 지웁니다. |
| lpstat(1) | 줄 프린터 상태 정보를 보여 줍니다. |
| lptest(1) | 줄 프린터 물결 무늬를 만듭니다. |
| lsallqdev(1) | 큐 안에 구성된 모든 프린터 큐 장치 이름을 나열합니다. |
| lsvirprt(1) | 가상 프린터의 속성 값을 보여 줍니다. |
| mkque(1) | 시스템에 프린터 큐를 더합니다. |
| mkquedev(1) | 시스템에 프린터 큐 장치를 더합니다. |
| mkvirprt(1) | 가상 프린터를 만듭니다. |
| pac(1) | 프린터/플로터 계정 레코드를 준비합니다. |
| piobe(1) | 프린터 백엔드용 인쇄 작업 관리자 |
| pioburst(1) | 프린터 출력의 구분 페이지(머리·꼬리 페이지)를 만듭니다. |
| piocmdout(3) | 프린터 포매터용 속성 문자열을 출력하는 서브루틴 |
| piodigest(1) | 가상 프린터 정의의 속성 값을 소화해 저장합니다. |
| pioexit(3) | 프린터 포매터를 끝내는 서브루틴 |
| pioformat(1) | 프린터 포매터를 구동합니다. |
| piofquote(1) | PostScript 프린터로 가는 일부 제어 문자를 바꿉니다. |
| piogetstr(3) | 프린터 포매터용 속성 문자열을 가져오는 서브루틴 |
| piogetvals(3) | 프린터 포매터의 프린터 속성 데이터베이스 변수를 초기화하는 서브루틴 |
| piomsgout(3) | 프린터 포매터에서 메시지를 보내는 서브루틴 |
| pioout(1) | 프린터 백엔드의 장치 드라이버 인터페이스 프로그램 |
| piopredef(1) | 미리 정의된 프린터 데이터 스트림 정의를 만듭니다. |
| proff(1) | 개인용 프린터 데이터 스트림을 쓰는 프린터용으로 텍스트를 서식화합니다. |
| qadm(1) | 프린터 스풀 시스템의 시스템 관리를 합니다. |
| qconfig(4) | 프린터 큐 시스템을 구성합니다. |
| qstatus(1) | 인쇄 스풀 시스템의 프린터 상태를 제공합니다. |
| restore(3) | 프린터를 기본 상태로 되돌립니다. |
| rmque(1) | 시스템에서 프린터 큐를 지웁니다. |
| rmquedev(1) | 시스템에서 프린터나 플로터 큐 장치를 지웁니다. |
| rmvirprt(1) | 가상 프린터를 지웁니다. |
| splp(1) | 프린터 드라이버 설정을 바꾸거나 보여 줍니다. |
| xpr(1) | 창 덤프 파일을 프린터 출력용으로 서식화합니다. |
관련 정보
- 시스템 관리를 위한 프린터 개요
영어 원문
Printers for BSD 4.3 system managers
The AIX operating system supports two printing subsystems: 4.3 BSD and System V.
The System V style of printing subsystem uses System V Release 4 commands, queues, and files and is administered the same way. The following paragraphs describe what you need to know to manage the 4.3 BSD style of printing subsystem. You control which subsystem is made active through SMIT. Only one subsystem can be active at a time.
Printing is managed by programs and configurations in the /usr/lpd directory. The design, configuration, queueing mechanism, and daemon processes of the 4.3 BSD and printer subsystems for AIX are different. However, they both use the lpd protocol for remote printing. Both systems use /etc/hosts.lpd, if it exists, or /etc/host.equiv otherwise. The printer subsystem for AIX offers a gateway to 4.3 BSD printer subsystems, so systems using AIX can submit print jobs to 4.3 BSD systems and accept print jobs submitted by 4.3 BSD systems.
The /etc/printcap file of 4.3 BSD does not exist in AIX. This file is a combination of spooler configuration and printer capability database. Users need to understand the format and keywords of the printcap file to set up a printer correctly.
The /etc/qconfig file of AIX contains only the spooler configuration information. The printer capability is defined in the ODM predefined or customized database. You can use the mkvirprt (make virtual printer) command to define to the system the capabilities of a particular printer.
To make printer lp0 available to print on the remote host viking, put the following in a 4.3 BSD system /etc/printcap file:
lp0|Print on remote printer attached to
viking:Z
:lp=:rm=viking:rp=lp:st=/usr/spool/lp0d
To do the same in AIX, put the following in the /etc/qconfig file:
lp0:
device = dlp0
host = viking
rq = lp
dlp0:
backend = /usr/lib/lpd/rembak
AIX supports the following printer commands and library functions:
- cancel(1) — Cancels requests to a line printer
- chquedev(1) — Changes the printer or plotter queue device names
- chvirprt(1) — Changes the attribute values of a virtual printer
- disable(1) — Disables a printer queue
- enable(1) — Enables a printer queue
- hplj(1) — Postprocesses troff output for HP LaserJetII with the K cartridge
- ibm3812(1) — Postprocesses troff output for IBM 3812 Mod 2 Pageprinter
- ibm3816(1) — Postprocesses troff output for IBM 3816 Pageprinter
- ibm5587G(1) — Postprocesses troff output for IBM 5587G with 32x32/24x24 cartridge
- lp(1) — Sends requests to a line printer
- lpr(1) — Enqueues print jobs
- lprm(1) — Removes jobs from the line printer spooling queue
- lpstat(1) — Displays line printer status information
- lptest(1) — Generates the line printer ripple pattern
- lsallqdev(1) — Lists all configured printer queue device names within a queue
- lsvirprt(1) — Displays the attribute values of a virtual printer
- mkque(1) — Adds a printer queue to the system
- mkquedev(1) — Adds a printer queue device to the system
- mkvirprt(1) — Makes a virtual printer
- pac(1) — Prepares printer/plotter accounting records
- piobe(1) — Print Job Manager for the printer backend
- pioburst(1) — Generates burst pages (header and trailer pages) for printer output
- piocmdout(3) — Subroutine that outputs an attribute string for a printer formatter
- piodigest(1) — Digests attribute values for a virtual printer definition and stores
- pioexit(3) — Subroutine that exits from a printer formatter
- pioformat(1) — Drives a printer formatter
- piofquote(1) — Converts certain control characters destined for PostScript printers
- piogetstr(3) — Subroutine that retrieves an attribute string for a printer formatter
- piogetvals(3) — Subroutine that initializes Printer Attribute database variables for printer formatter
- piomsgout(3) — Subroutine that sends a message from a printer formatter
- pioout(1) — Printer backend's device driver interface program
- piopredef(1) — Creates a predefined printer data stream definition
- proff(1) — Formats text for printers with personal printer data streams
- qadm(1) — Performs system administration for the printer spooling system
- qconfig(4) — Configures a printer queueing system
- qstatus(1) — Provides printer status for the print spooling system
- restore(3) — Restores the printer to its default state
- rmque(1) — Removes a printer queue from the system
- rmquedev(1) — Removes a printer or plotter queue device from the system
- rmvirprt(1) — Removes a virtual printer
- splp(1) — Changes or displays printer driver settings
- xpr(1) — Formats a window dump file for output to a printer
Related information
Printer Overview for System Management
BSD 4.3 시스템 관리자를 위한 시스템 관리 명령
다음은 AIX 환경 관리에 쓰는 명령 목록입니다.
| 명령 | 설명 |
|---|---|
| bosboot(1) | 부트 장치를 초기화합니다. |
| bootlist(1) | 시스템이 쓸 수 있는 부트 장치 목록(이나 목록 안의 순서)을 바꿉니다. |
| cfgmgr(1) | /etc/methods 디렉터리의 프로그램을 실행해 장치를 구성합니다. |
| chcons(1) | 다음 시작부터 시스템 콘솔을 장치나 파일로 돌립니다. |
| chdev(1) | 장치의 특성을 바꿉니다. |
| chdisp(1) | 저기능 터미널(LFT) 하위 시스템이 쓰는 디스플레이를 바꿉니다. |
| checkcw(1) | troff 명령용 고정 폭 텍스트를 준비합니다. |
| checkeq(1) | 메모 매크로로 서식화한 문서를 검사합니다. |
| checkmm(1) | 메모 매크로로 서식화한 문서를 검사합니다. |
| checknr(1) | nroff와 troff 파일을 검사합니다. |
| chfont(1) | 부팅 때 고를 기본 글꼴을 바꿉니다. |
| chfs(1) | 파일 시스템의 속성을 바꿉니다. |
| chgroup(1) | 그룹 속성을 바꿉니다. |
| chgrpmem(1) | 그룹의 관리자나 구성원을 바꿉니다. |
| chhwkbd(1) | ODM에 저장한 LFT 키보드 속성을 바꿉니다. |
| chitab(1) | /etc/inittab 파일의 레코드를 바꿉니다. |
| chkbd(1) | 시스템 시작 때 LFT가 쓰는 기본 키보드 맵을 바꿉니다. |
| chkey(1) | 암호화 키를 바꿉니다. |
| chlang | 다음 로그인을 위해 /etc/environment 파일의 LANG 환경 변수를 설정합니다. |
| chlicense(1) | 사용자 라이선스(고정과 유동)를 바꿉니다. 고정 라이선스는 늘 켜져 있고 -u 플래그로 수를 바꾸며, 유동 라이선스는 -f 플래그로 켜고 끕니다. |
| chlv(1) | 논리 볼륨의 특성을 바꿉니다. |
| chnamsv(1) | 호스트의 TCP/IP 기반 이름 서비스 구성을 바꿉니다. |
| chprtsv(1) | 클라이언트나 서버의 인쇄 서비스 구성을 바꿉니다. |
| chps(1) | 페이징 공간 속성을 바꿉니다. |
| chpv(1) | 볼륨 그룹 안 물리 볼륨의 특성을 바꿉니다. |
| chque(1) | 큐 이름을 바꿉니다. |
| chquedev(1) | 프린터나 플로터 큐 장치 이름을 바꿉니다. |
| chssys(1) | 하위 시스템 객체 클래스의 하위 시스템 정의를 바꿉니다. |
| chtcb(1) | 파일의 신뢰 컴퓨팅 기반 속성을 바꾸거나 조회합니다. |
| chtz | 시스템 시간대 정보를 바꿉니다. |
| chuser(1) | 지정한 사용자의 속성을 바꿉니다. |
| chvfs(1) | /etc/vfs 파일의 항목을 바꿉니다. |
| chvg(1) | 볼륨 그룹의 특성을 설정합니다. |
| chvirprt(1) | 가상 프린터의 속성 값을 바꿉니다. |
| crfs(1) | 파일 시스템을 더합니다. |
| crvfs(1) | /etc/vfs 파일에 항목을 만듭니다. |
| exportvg(1) | 물리 볼륨 묶음에서 볼륨 그룹 정의를 내보냅니다. |
| extendvg(1) | 볼륨 그룹에 물리 볼륨을 더합니다. |
| grpck(1) | 그룹 정의가 올바른지 확인합니다. |
| importvg(1) | 물리 볼륨 묶음에서 새 볼륨 그룹 정의를 가져옵니다. |
| lsallq(1) | 구성된 모든 큐 이름을 나열합니다. |
| lsallqdev(1) | 지정한 큐 안에 구성된 모든 프린터·플로터 큐 장치 이름을 나열합니다. |
| lsdisp(1) | 시스템에서 지금 쓸 수 있는 디스플레이를 나열합니다. |
| lsfont(1) | 디스플레이가 쓸 수 있는 글꼴을 나열합니다. |
| lsfs(1) | 파일 시스템의 특성을 보여 줍니다. |
| lsgroup(1) | 그룹 속성을 보여 줍니다. |
| lsitab(1) | /etc/inittab 파일의 레코드를 나열합니다. |
| lskbd(1) | LFT 하위 시스템이 지금 쓸 수 있는 키보드 맵을 나열합니다. |
| lslicense(1) | 고정 라이선스 수와 유동 라이선스 상태를 보여 줍니다. |
| lslpp(1) | 선택 프로그램 제품을 나열합니다. |
| lsnamsv(1) | 데이터베이스에 저장한 이름 서비스 정보를 보여 줍니다. |
| lsprtsv(1) | 데이터베이스에 저장한 인쇄 서비스 정보를 보여 줍니다. |
| lsps | 페이징 공간과 속성을 나열합니다. |
| lsque(1) | 큐 스탠자 이름을 보여 줍니다. |
| lsquedev(1) | 장치 스탠자 이름을 보여 줍니다. |
| lssrc(1) | 하위 시스템, 하위 시스템 그룹, 하위 서버의 상태를 가져옵니다. |
| lsuser(1) | 사용자 계정 속성을 보여 줍니다. |
| lsvfs(1) | /etc/vfs 파일의 항목을 나열합니다. |
| mkcatdefs(1) | 메시지 소스 파일을 전처리합니다. |
| runcat(1) | mkcatdefs 명령의 출력을 gencat 명령으로 파이프합니다. |
| mkdev(1) | 시스템에 장치를 더합니다. |
| mkfont(1) | 디스플레이와 연결된 글꼴 코드를 시스템에 더합니다. |
| mkfontdir(1) | 글꼴 파일 디렉터리에서 fonts.dir 파일을 만듭니다. |
| mkgroup(1) | 새 그룹을 만듭니다. |
| mkitab(1) | /etc/inittab 파일에 레코드를 만듭니다. |
| mklv(1) | 논리 볼륨을 만듭니다. |
| mklvcopy(1) | 논리 볼륨에 사본을 더합니다. |
| mknamsv(1) | 클라이언트용으로 호스트의 TCP/IP 기반 이름 서비스를 구성합니다. |
| mknotify(1) | notify 객체 클래스에 알림 메서드 정의를 더합니다. |
| mkprtsv(1) | 호스트의 TCP/IP 기반 인쇄 서비스를 구성합니다. |
| mkps(1) | 시스템에 페이징 공간을 더합니다. |
| mkque(1) | 시스템에 프린터 큐를 더합니다. |
| mkquedev(1) | 시스템에 프린터 큐 장치를 더합니다. |
| mkserver(1) | 하위 서버 객체 클래스에 하위 서버 정의를 더합니다. |
| mkssys(1) | 하위 시스템 객체 클래스에 하위 시스템 정의를 더합니다. |
| mksysb | 나중에 다시 설치하려고 rootvg 볼륨 그룹의 마운트된 파일 시스템을 백업합니다. |
| mkszfile | 다시 설치하려고 rootvg 볼륨 그룹의 마운트된 파일 시스템 크기를 기록합니다. |
| mktcpip(1) | 호스트에서 TCP/IP를 시작하는 데 필요한 값을 설정합니다. |
| mkuser(1) | 새 사용자 계정을 만듭니다. |
| mkuser.sys(1) | 새 사용자 계정을 맞춥니다. |
| mkvg(1) | 볼륨 그룹을 만듭니다. |
| mkvirprt(1) | 가상 프린터를 만듭니다. |
| odmadd(1) | 만든 객체 클래스에 객체를 더합니다. |
| odmchange(1) | 지정한 객체 클래스에서 고른 객체의 내용을 바꿉니다. |
| odmcreate(1) | ODM 응용 프로그램 개발에 필요한 .c(소스)와 .h(포함) 파일을 만들고 빈 객체 클래스를 만듭니다. |
| odmdelete(1) | 지정한 객체 클래스에서 고른 객체를 지웁니다. |
| odmdrop(1) | 객체 클래스를 지웁니다. |
| odmget(1) | 지정한 객체 클래스에서 객체를 가져와 odmadd 입력 파일에 넣습니다. |
| odmshow(1) | 객체 클래스 정의를 화면에 보여 줍니다. |
| pwdck(1) | 로컬 인증 정보가 올바른지 확인합니다. |
| redefinevg | 장치 구성 데이터베이스에서 주어진 볼륨 그룹의 물리 볼륨 묶음을 다시 정의합니다. |
| reducevg(1) | 볼륨 그룹에서 물리 볼륨을 지웁니다. 물리 볼륨을 모두 지우면 볼륨 그룹이 삭제됩니다. |
| reorgvg(1) | 볼륨 그룹의 물리 파티션 할당을 재구성합니다. |
| restbase(1) | 부트 이미지에서 사용자 정의 정보를 복원합니다. |
| rmdel(1) | SCCS 파일에서 델타를 지웁니다. |
| rmdev(1) | 시스템에서 장치를 지웁니다. |
| rmf(1) | 폴더와 그 안의 메시지를 지웁니다. |
| rmfs(1) | 파일 시스템을 지웁니다. |
| rmgroup(1) | 그룹을 지웁니다. |
| rmitab(1) | /etc/inittab 파일의 레코드를 지웁니다. |
| rmlv(1) | 볼륨 그룹에서 논리 볼륨을 지웁니다. |
| rmlvcopy(1) | 논리 볼륨에서 사본을 지웁니다. |
| rmm(1) | 메시지를 지웁니다. |
| rmnamsv(1) | 호스트의 TCP/IP 기반 이름 서비스 구성을 해제합니다. |
| rmnotify(1) | notify 객체 클래스에서 알림 메서드 정의를 지웁니다. |
| rmprtsv(1) | 클라이언트나 서버의 인쇄 서비스 구성을 해제합니다. |
| rmps(1) | 시스템에서 페이징 공간을 지웁니다. |
| rmque(1) | 시스템에서 프린터 큐를 지웁니다. |
| rmquedev(1) | 시스템에서 프린터나 플로터 큐 장치를 지웁니다. |
| rmserver(1) | 하위 서버 객체 클래스에서 하위 서버 정의를 지웁니다. |
| rmssys(1) | 하위 시스템 객체 클래스에서 하위 시스템 정의를 지웁니다. |
| rmuser(1) | 사용자 계정을 지웁니다. |
| rmvfs(1) | /etc/vfs 파일의 항목을 지웁니다. |
| rmvirprt(1) | 가상 프린터를 지웁니다. |
| savebase(1) | ODM의 기본 사용자 정의 장치 데이터를 부트 장치에 저장합니다. |
| swapoff(1) | 페이징 공간 하나 이상을 비활성화합니다. |
| swapon(1) | 페이징과 스와핑에 쓸 장치를 더 지정합니다. |
| syncvg(1) | 최신이 아닌 논리 볼륨 사본을 동기화합니다. |
| usrck(1) | 사용자 정의가 올바른지 확인합니다. |
| varyoffvg(1) | 볼륨 그룹을 비활성화합니다. |
| varyonvg(1) | 볼륨 그룹을 활성화합니다. |
관련 개념
- 4.3 BSD와 AIX의 주요 차이
영어 원문
Commands for system administration for BSD 4.3 system managers
This list contains commands that are specifically for administering the environment for AIX.
- bosboot(1) — Initializes a boot device.
- bootlist(1) — Alters the list of boot devices (or the ordering of these devices in the list) available to the system.
- cfgmgr(1) — Configures devices by running the programs in
/etc/methodsdirectory. - chcons(1) — Redirects the system console to device or file, effective next startup
- chdev(1) — Changes the characteristics of a device
- chdisp(1) — Changes the display used by the low-function terminal (LFT) subsystem.
- checkcw(1) — Prepares constant-width text for the troff command.
- checkeq(1) — Checks documents formatted with memorandum macros.
- checkmm(1) — Checks documents formatted with memorandum macros.
- checknr(1) — Checks
nroffandtrofffiles. - chfont(1) — Changes the default font selected at boot time.
- chfs(1) — Changes attributes of a file system.
- chgroup(1) — Changes attributes for groups.
- chgrpmem(1) — Changes the administrators or members of a group.
- chhwkbd(1) — Changes the low function terminal (LFT) keyboard attributes stored in the Object Data Manager (ODM) database.
- chitab(1) — Changes records in the
/etc/inittabfile. - chkbd(1) — Changes the default keyboard map used by the low-function terminal (LFT) at system startup.
- chkey(1) — Changes your encryption key.
- chlang — Sets LANG environment variable in the
/etc/environmentfile for the next login. - chlicense(1) — There are two types of user licensing, fixed and floating. Fixed licensing is always enabled, and the number of licenses can be changed through the
-uflag. Floating licensing can be enabled or disabled (on or off) through the-fflag - chlv(1) — Changes the characteristics of a logical volume
- chnamsv(1) — Changes TCP/IP-based name service configuration on a host
- chprtsv(1) — Changes a print service configuration on a client or server machine
- chps(1) — Changes attributes of a paging space.
- chpv(1) — Changes the characteristics of a physical volume in a volume group.
- chque(1) — Changes the queue name.
- chquedev(1) — Changes the printer or plotter queue device names.
- chssys(1) — Changes a subsystem definition in the subsystem object class.
- chtcb(1) — Changes or queries the trusted computing base attribute of a file.
- chtz — Changes the system time zone information.
- chuser(1) — Changes attributes for the specified user.
- chvfs(1) — Changes entries in the
/etc/vfsfile. - chvg(1) — Sets the characteristics of a volume group.
- chvirprt(1) — Changes the attribute values of a virtual printer.
- crfs(1) — Adds a file system.
- crvfs(1) — Creates entries in the
/etc/vfsfile. - exportvg(1) — Exports the definition of a volume group from a set of physical volumes.
- extendvg(1) — Adds physical volumes to a volume group.
- grpck(1) — Verifies the correctness of a group definition.
- importvg(1) — Imports a new volume group definition from a set of physical volumes.
- lsallq(1) — Lists the names of all configured queues.
- lsallqdev(1) — Lists all configured printer and plotter queue device names within a specified queue.
- lsdisp(1) — Lists the displays currently available on the system.
- lsfont(1) — Lists the fonts available for use by the display.
- lsfs(1) — Displays the characteristics of file systems.
- lsgroup(1) — Displays the attributes of groups.
- lsitab(1) — Lists the records in the
/etc/inittabfile. - lskbd(1) — Lists the keyboard maps currently available to the low-function terminal (LFT) subsystem.
- lslicense(1) — Displays the number of fixed licenses and the status of floating licensing.
- lslpp(1) — Lists optional program products.
- lsnamsv(1) — Shows name service information stored in the database.
- lsprtsv(1) — Shows print service information stored in the database.
- lsps — Lists paging space and attributes.
- lsque(1) — Displays the queue stanza name.
- lsquedev(1) — Displays the device stanza name.
- lssrc(1) — Gets the status of a subsystem, a group of subsystems, or a subserver.
- lsuser(1) — Displays attributes of user accounts.
- lsvfs(1) — Lists entries in the
/etc/vfsfile. - mkcatdefs(1) — Preprocesses a message source file.
- runcat(1) — Pipes the output data from the mkcatdefs command to the
gencatcommand. - mkdev(1) — Adds a device to the system.
- mkfont(1) — Adds the font code associated with a display to the system.
- mkfontdir(1) — Creates a
fonts.dirfile from a directory of font files. - mkgroup(1) — Creates a new group.
- mkitab(1) — Makes records in the
/etc/inittabfile. - mklv(1) — Creates a logical volume.
- mklvcopy(1) — Adds copies to a logical volume.
- mknamsv(1) — Configures TCP/IP-based name service on a host for a client.
- mknotify(1) — Adds a notify method definition to the notify object class.
- mkprtsv(1) — Configures TCP/IP-based print service on a host.
- mkps(1) — Add an additional paging space to the system.
- mkque(1) — Adds a printer queue to the system.
- mkquedev(1) — Adds a printer queue device to the system.
- mkserver(1) — Adds a subserver definition to the subserver object class.
- mkssys(1) — Adds a subsystem definition to the subsystem object class.
- mksysb — Backs up mounted file systems in the rootvg volume group for subsequent reinstallation.
- mkszfile — Records size of mounted file systems in the rootvg volume group for reinstallation.
- mktcpip(1) — Sets the required values for starting TCP/IP on a host.
- mkuser(1) — Creates a new user account.
- mkuser.sys(1) — Customizes a new user account.
- mkvg(1) — Creates a volume group.
- mkvirprt(1) — Makes a virtual printer.
- odmadd(1) — Adds objects to created object classes.
- odmchange(1) — Changes the contents of a selected object in the specified object class.
- odmcreate(1) — Produces the
.c(source) and.h(include) files necessary for ODM application development and creates empty object classes. - odmdelete(1) — Deletes selected objects from a specified object class.
- odmdrop(1) — Removes an object class.
- odmget(1) — Retrieves objects from the specified object classes and places them into an
odmaddinput file. - odmshow(1) — Displays an object class definition on the screen.
- pwdck(1) — Verifies the correctness of local authentication information.
- redefinevg — Redefines the set of physical volumes of the given volume group in the device configuration database.
- reducevg(1) — Removes physical volumes from a volume group. When all physical volumes are removed from the volume group, the volume group is deleted.
- reorgvg(1) — Reorganizes the physical partition allocation for a volume group.
- restbase(1) — Restores customized information from the boot image.
- rmdel(1) — Removes a delta from a Source Code Control System (SCCS) file.
- rmdev(1) — Removes a device from the system.
- rmf(1) — Removes folders and the messages they contain.
- rmfs(1) — Removes a file system.
- rmgroup(1) — Removes a group.
- rmitab(1) — Removes records in the
/etc/inittabfile. - rmlv(1) — Removes logical volumes from a volume group.
- rmlvcopy(1) — Removes copies from a logical volume.
- rmm(1) — Removes messages.
- rmnamsv(1) — Unconfigures TCP/IP-based name service on a host.
- rmnotify(1) — Removes a notify method definition from the notify object class.
- rmprtsv(1) — Unconfigures a print service on a client or server machine.
- rmps(1) — Removes a paging space from the system.
- rmque(1) — Removes a printer queue from the system.
- rmquedev(1) — Removes a printer or plotter queue device from the system.
- rmserver(1) — Removes a subserver definition from the subserver object class.
- rmssys(1) — Removes a subsystem definition from the subsystem object class.
- rmuser(1) — Removes a user account.
- rmvfs(1) — Removes entries in the
/etc/vfsfile. - rmvirprt(1) — Removes a virtual printer.
- savebase(1) — Saves base customized device data in the ODM onto the boot device.
- swapoff(1) — Deactivates one or more paging space.
- swapon(1) — Specifies additional devices for paging and swapping.
- syncvg(1) — Synchronizes logical volume copies that are not current.
- usrck(1) — Verifies the correctness of a user definition.
- varyoffvg(1) — Deactivates a volume group.
- varyonvg(1) — Activates a volume group.
Related concepts
Major differences between 4.3 BSD and AIX The following is a summary of the major differences between AIX and 4.3 BSD systems.
BSD 4.3 시스템 관리자를 위한 cron
이 운영 체제의 cron 데몬은 System V Release 2의 cron 데몬과 비슷합니다.
/etc/inittab 파일의 항목이 cron 데몬을 시작합니다.
영어 원문
Cron for BSD 4.3 system managers
The cron daemon for this operating system is similar to the System V Release 2 cron daemon.
An entry in the /etc/inittab file starts the cron daemon.
BSD 4.3 시스템 관리자를 위한 장치
다음은 BSD 4.3 시스템 관리자를 위한 장치 설명입니다.
4.3 BSD 시스템에서 응용 프로그램은 다음 조건일 때만 장치에 접근할 수 있습니다.
- 장치가 물리적으로 설치돼 동작합니다.
- 장치 드라이버가 커널에 있습니다.
/dev디렉터리에 장치의 장치 특수 파일이 있습니다.
AIX에서 응용 프로그램은 다음 조건일 때만 장치에 접근할 수 있습니다.
- 장치가 물리적으로 설치돼 동작합니다.
- 장치 드라이버가 커널이나 적재된 커널 확장에 있습니다.
/dev디렉터리에 장치의 장치 특수 파일이 있습니다./etc/objrepos디렉터리의 객체 데이터베이스에 물리 구성과 맞는 장치 항목이 있습니다.
/etc/methods 디렉터리에 있는, 메서드라는 장치별 프로그램이 객체 데이터베이스를 유지합니다. 메서드는 (cfgmgr 명령으로 접근하는) 구성 관리자와 다른 명령이 호출합니다.
응용 프로그램이 더 이상 장치에 접근할 수 없으면 하드웨어 고장일 수도 있고 /etc/objrepos 디렉터리의 구성 데이터베이스가 손상됐을 수도 있습니다.
cfgmgr 명령은 /etc/objrepos 디렉터리의 구성 데이터베이스를 처리하며, 시작할 때 cfgmgr 명령(구성 관리자)이 처리합니다(원문 그대로).
다음 의사 코드는 구성 관리자의 논리를 보여 줍니다.
/* Main */
While there are rules in the Config_Rules database
{
Get the next rule and execute it
Capture stdout from the last execution
Parse_Output(stdout)
}
/* Parse Output Routine */
/* stdout will contain a list of devices found */
Parse_OutPut(stdout)
{
While there are devices left in the list
{
Lookup the device in the database
if (!defined)
Get define method from database and execute
if (! configured)
{
Get config method from database and execute
Parse_Output(stdout)
}
}
}
영어 원문
Devices for BSD 4.3 system managers
The following discusses devices for BSD 4.3 system managers.
A device on a 4.3 BSD system is accessible to an application only when:
The device is physically installed and functioning.
The driver for the device is in the kernel.
The device special files for the device exist in the
/devdirectory.
A device on AIX is accessible to an application only when:
The device is physically installed and functioning.
The driver for the device is in the kernel or in a loaded kernel extension.
The device special files for the device exist in the
/devdirectory.The object database in the
/etc/objreposdirectory contains entries for the device that match the physical configuration.
The device specific programs called methods, found in the /etc/methods directory, maintain the object database. The methods are invoked by the Configuration Manager (accessed through the cfgmgr command) and other commands.
If a device can no longer be accessed by an application program, it can mean that the hardware is faulty or it can mean that the configuration database in the /etc/objrepos directory is damaged.
The cfgmgr command processes the configuration database in the /etc/objrepos directory and is processed at startup time by the cfgmgr command (the Configuration Manager).
The pseudocode below shows the Configuration Manager logic:
(23줄짜리 예는 위 한글 본문에 그대로 실었습니다.)
BSD 4.3 시스템 관리자를 위한 UUCP
Web-based System Manager는 흔히 HDB UUCP라고 부르는 System V BNU(Basic Networking Utilities)를 제공합니다. 다음 표는 UUCP 명령과 파일입니다.
| 명령·파일 | 설명 |
|---|---|
Dialers(4) |
BNU 원격 통신 링크에 쓰는 모뎀 목록 |
Maxuuxqts(4) |
동시에 실행할 수 있는 BNU uuxqt 데몬 수 제한 |
Permissions(4) |
원격 시스템에 대한 BNU 명령 권한 지정 |
Poll(4) |
BNU 프로그램이 원격 시스템을 폴링할 때 지정 |
Systems(4) |
로컬 시스템이 통신할 수 있는 원격 컴퓨터 목록 |
| rmail(1) | BNU로 받은 원격 메일 처리 |
| uucheck(1) | BNU에 필요한 파일과 디렉터리 확인 |
| uuclean(1) | BNU 스풀 디렉터리에서 파일 제거 |
| uucleanup(1) | BNU 스풀 디렉터리에서 고른 파일 삭제 |
| uucpadm(1) | 기본 BNU 구성 정보 입력 |
| uudemon.admin(1) | BNU 파일 전송 상태를 주기적으로 알림 |
| uudemon.cleanu(1) | BNU 스풀 디렉터리와 로그 파일 정리 |
| uudemon.hour(1) | BNU 프로그램으로 원격 시스템에 파일 전송 호출 시작 |
| uudemon.poll(1) | BNU Poll 파일에 나열한 시스템 폴링 |
| uulog(1) | 시스템의 BNU 파일 전송 활동 정보 |
| uupoll(1) | 원격 BNU 시스템 폴링 강제 |
| uuq(1) | BNU 작업 큐를 보여 주고 지정한 작업 삭제 |
| uusnap(1) | 원격 시스템과의 BNU 접속 상태 표시 |
| uustat(1) | BNU 작업 상태를 알리고 제한적으로 제어 |
AIX는 4.3 BSD uuencode와 uudecode 명령도 제공합니다. HDB uugetty 명령은 지원하지 않습니다. 자세한 내용은 uuencode와 uudecode를 봅니다.
관련 정보
- BNU 파일과 디렉터리 구조
영어 원문
UUCP for BSD 4.3 system managers
Web-based System Manager provides System V Basic Networking Utilities (BNU) which are often referred to as the HDB UUCP. The following table lists lists UUCP commands and files.
Dialers(4)— Lists modems used for BNU remote communications linksMaxuuxqts(4)— Limits the number of instances of the BNU uuxqt daemons that can runPermissions(4)— Specifies BNU command permissions for remote systemsPoll(4)— Specifies when the BNU program should poll remote systems- Systems(4) — Lists remote computers with which the local system can communicate
- rmail(1) — Handles remote mail received through BNU
- uucheck(1) — Checks for files and directories required by BNU
- uuclean(1) — Removes files from the BNU spool directory
- uucleanup(1) — Deletes selected files from the BNU spooling directory
- uucpadm(1) — Enters basic BNU configuration information
- uudemon.admin(1) — Provides periodic information on the status of BNU file transfers
- uudemon.cleanu(1) — Cleans up BNU spooling directories and log files
- uudemon.hour(1) — Initiates file transport calls to remote systems using the BNU program
- uudemon.poll(1) — Polls the systems listed in the BNU Poll file
- uulog(1) — Provides information about BNU file-transfer activities on a system
- uupoll(1) — Forces a poll of a remote BNU system
- uuq(1) — Displays the BNU job queue and deletes specified jobs from the queue
- uusnap(1) — Displays the status of BNU contacts with remote systems
- uustat(1) — Reports the status of and provides limited control over BNU operations
AIX also provides the 4.3 BSD uuencode and uudecode commands. The HDB uugetty command is not supported. For information about these commands, see uuencode and uudecode.
Related information
BNU file and directory structure
BSD 4.3 시스템 관리자를 위한 파일 시스템
파일 시스템을 마운트하고 해제하는 명령은 비슷합니다.
AIX는 /etc/filesystems 파일(원문은 filesystem)로 파일 시스템 장치 정보를 나열하며, 파일 시스템을 마운트하고 해제하는 비슷한 명령이 있습니다.
/etc/filesystems 파일과 /etc/fstab 파일
4.3 BSD 시스템은 블록 장치와 마운트 지점 목록을 /etc/fstab 파일에 저장합니다. SVR4 시스템은 /etc/vfstab 파일에, AIX는 /etc/filesystems 파일에 저장합니다.
crfs, chfs, rmfs 명령이 /etc/filesystems 파일을 갱신합니다.
4.3 BSD 시스템 관리자는 /etc/filesystems 파일의 check 변수에 관심을 가질 만합니다. check 변수는 True, False, 또는 숫자로 설정할 수 있습니다. 예를 들어 /etc/filesystems 파일에 check=2를 지정할 수 있습니다. 숫자는 이 파일 시스템을 검사할 fsck 명령의 패스를 지정합니다. check 매개변수는 /etc/fstab 파일 레코드의 다섯째 필드에 해당합니다.
/etc/filesystems 파일에는 dump 빈도 매개변수가 없습니다.
AIX의 파일 시스템 지원
AIX는 여러 파일 시스템을 지원합니다.
AIX는 디스크 할당량을 지원합니다.
AIX는 디스켓을 파일 시스템으로 마운트할 수 없습니다.
AIX의 mount와 umount 명령 구문은 4.3 BSD와 SVR4판과 다릅니다. 세 시스템에서 모든 파일 시스템을 한꺼번에 마운트하고 해제하는 명령은 다음과 같습니다.
| 기능 | 이 운영 체제 구문 | 4.3 BSD 구문 | SVR4 구문 |
|---|---|---|---|
| 모든 파일 시스템 마운트 | mount all |
mount -a |
mountall |
| 모든 파일 시스템 해제 | umount all |
umount -a |
umountall |
자세한 내용은 파일 시스템 장을 봅니다.
영어 원문
File systems for BSD 4.3 system managers
Similar commands are used to mount and unmount file systems.
AIX uses the /etc/filesystem file to list file system device information, and has similar commands for mounting and unmounting file systems.
/etc/filesystems file and /etc/fstab file
4.3 BSD systems store lists of block devices and mount points in the /etc/fstab file. SVR4 systems store block devices and mount point information in /etc/vfstab file. AIX stores block device and mount points information in /etc/filesystems file.
The crfs, chfs, and rmfs commands update the /etc/filesystems file.
4.3 BSD system administrators might be interested in the check variable in the /etc/filesystems file. The check variable can be set to the value True, False, or to a number. For example, you can specify check=2 in the /etc/filesystems file. The number specifies the pass of the fsck command that will check this file system. The check parameter corresponds to the fifth field in an /etc/fstab file record.
There is no dump frequency parameter in the /etc/filesystems file.
File system support on AIX
AIX supports various file systems.
AIX supports disk quotas.
AIX does not allow mounting of diskettes as file systems.
The syntax of the mount and umount commands for AIX differs from 4.3 BSD and from SVR4 versions of these commands. The commands to mount and unmount all file systems at once are shown for all three systems in the following table:
mount and unmount Commands
| Function | Syntax for this operating system | 4.3 BSD Syntax | SVR4 Syntax |
|---|---|---|---|
| mount all file systems | mount all | mount -a | mountall |
| unmount all file systems | umount all | umount -a | umountall |
See File systems for more information.
BSD 4.3 시스템 관리자를 위한 터미널
다음은 BSD 4.3 시스템 관리자를 위한 터미널 설명입니다.
전통적으로 4.3 BSD 시스템 관리자는 /etc/ttys 파일을 고치고 init 프로그램에 HUP 신호를 보내 터미널 포트를 켜거나 끕니다.
AIX는 터미널 포트 정보를 ODM에 저장하며 init 프로그램이 /etc/inittab 파일을 읽을 때 터미널을 시작합니다. AIX에서는 Web-based System Manager Devices 응용 프로그램이나 SMIT로 터미널 포트를 구성합니다.
포트와 /dev 디렉터리의 장치 특수 파일 이름 사이에는 고정된 대응이 없습니다. 그래서 AIX가 처음인 시스템 관리자는 어느 포트를 구성해야 할지 헷갈립니다. SMIT에서 첫 번째 플래너 직렬 포트(물리 레이블 s1)는 SMIT 메뉴에서 위치 00-00-S1, 어댑터 sa0, 포트 s1로 나옵니다. 두 번째 플래너 직렬 포트(물리 레이블 s2)는 위치 00-00-S2, 어댑터 sa1, 포트 s2로 나옵니다.
포트를 켜고 끄려면 penable과 pdisable 명령을 씁니다.
termcap과 terminfo
System V처럼 이 운영 체제는 /usr/lib/terminfo/?/* 파일의 terminfo 항목을 씁니다.
4.3 BSD 시스템 사용자에게 다음 명령이 도움이 될 수 있습니다.
| 명령 | 설명 |
|---|---|
| captoinfo(1) | termcap 파일을 terminfo 파일로 바꿉니다. |
| tic(1) | terminfo 파일을 소스에서 컴파일 형식으로 번역합니다. |
이 운영 체제에는 많은 terminfo 항목의 소스가 들어 있습니다. 일부는 tic 명령으로 컴파일해야 할 수 있습니다. termcap 파일은 /lib/libtermcap/termcap.src 파일로 제공합니다.
영어 원문
Terminals for BSD 4.3 system managers
The following discusses terminals for BSD 4.3 system managers.
Traditionally, 4.3 BSD system managers enable or disable terminal ports by modifying the /etc/ttys file and sending a HUP signal to the init program.
AIX stores terminal port information in the ODM and starts terminals when the init program reads the /etc/inittab file. In AIX, use the Web-based System Manager Devices application or SMIT to configure terminal ports.
There is no fixed mapping between the port and the device special file name in the /dev directory. Consequently, it is confusing to system managers who are new to AIX which port is to be configured. When using SMIT, the first planar serial port (physically labeled s1) is referred to as location 00-00-S1, adapter sa0, and port s1 in the SMIT menus. The second planar serial port (physically labeled s2) is referred to as location 00-00-S2, adapter sa1, and port s2.
Use the penable and pdisable commands to enable and disable a port.
termcap and terminfo
Like System V, this operating system uses terminfo entries in /usr/lib/terminfo/?/* files.
Users with 4.3 BSD Systems might find the following commands helpful:
captoinfo(1)
Converts a termcap file to a terminfo file
tic(1) Translates the terminfo files from source to compiled format.
This operating system includes source for many terminfo entries. Some of these might need to be compiled with the tic command. The termcap file is provided in /lib/libtermcap/termcap.src file.
입출력 방향 바꾸기
AIX 운영 체제에서는 특정 입출력 명령과 기호로 시스템에 드나드는 데이터의 입력과 출력(I/O)을 다룰 수 있습니다.
데이터를 모을 위치를 지정해 입력을 제어할 수 있습니다. 예를 들어 키보드로 입력하는 데이터(표준 입력)나 파일에서 입력을 읽도록 지정할 수 있습니다. 데이터를 보여 주거나 저장할 곳을 지정해 출력을 제어할 수 있습니다. 출력 데이터를 화면(표준 출력)이나 파일에 쓰도록 지정할 수 있습니다.
AIX는 다중 작업 운영 체제이므로 프로세스를 서로 조합해 다루도록 설계됐습니다.
관련 개념
- 파일 관리, 파일 내용을 보여 주는 명령(pg, more, page, cat), Korn 셸이나 POSIX 셸의 입출력 방향 바꾸기
영어 원문
Input and output redirection
The AIX operating system allows you to manipulate the input and output (I/O) of data to and from your system by using specific I/O commands and symbols.
You can control input by specifying the location from which to gather data. For example, you can specify to read input while data is entered on the keyboard (standard input) or to read input from a file. You can control output by specifying where to display or store data. You can specify to write output data to the screen (standard output) or to write it to a file.
Because AIX is a multitasking operating system, it is designed to handle processes in combination with each other.
Related concepts
Administering files There are many ways to work with the files on your system. Usually you create a text file with a text editor. Commands for displaying file contents (pg, more, page, and cat commands) The pg, more, and page commands allow you to view the contents of a file and control the speed at which your files are displayed. Input and output redirection in the Korn shell or POSIX shell Before the Korn shell executes a command, it scans the command line for redirection characters. These special notations direct the shell to redirect input and output.
표준 입력, 표준 출력, 표준 오류 파일
명령이 실행을 시작할 때는 보통 표준 입력, 표준 출력, 표준 오류(오류 출력이나 진단 출력이라고도 함) 파일이 이미 열려 있다고 기대합니다.
각 파일에는 파일 기술자라는 번호가 다음과 같이 연결됩니다.
| 번호 | 파일 |
|---|---|
| 파일 기술자 0 | 표준 입력 |
| 파일 기술자 1 | 표준 출력 |
| 파일 기술자 2 | 표준 오류(진단) 출력 |
자식 프로세스는 보통 이 파일을 부모에게서 물려받습니다. 세 파일은 처음에 워크스테이션에 할당됩니다(0은 키보드, 1과 2는 디스플레이). 셸은 명령에 제어를 넘기기 전에 이 파일의 방향을 다른 곳으로 바꿀 수 있게 합니다.
명령을 입력할 때 파일 이름을 주지 않으면 키보드가 표준 입력(stdin)입니다. 명령이 끝나면 결과가 화면에 나옵니다.
화면은 표준 출력(stdout)입니다. 기본적으로 명령은 표준 입력에서 입력을 받고 결과를 표준 출력으로 보냅니다.
오류 메시지는 표준 오류(stderr)로 갑니다. 기본적으로 이것도 화면입니다.
이 기본 입출력 동작은 바꿀 수 있습니다. 파일을 입력으로 쓰고 명령 결과를 파일에 쓸 수 있습니다. 이를 입출력 방향 바꾸기라고 합니다.
보통 디스플레이 장치로 가는 명령 출력을 파일로 보낼 수 있습니다. 이를 출력 방향 바꾸기라고 합니다. 화면에서 읽기 어려울 만큼 출력이 많거나 파일을 모아 더 큰 파일을 만들 때 쓸모 있습니다.
출력 방향 바꾸기만큼 자주 쓰지는 않지만, 보통 키보드에서 오는 명령 입력도 파일에서 받도록 바꿀 수 있습니다. 이를 입력 방향 바꾸기라고 합니다. 입력 방향을 바꾸면 미리 파일을 준비해 두고 명령이 그 파일을 읽게 할 수 있습니다.
영어 원문
Standard input, standard output, and standard error files
When a command begins running, it usually expects that the following files are already open: standard input, standard output, and standard error (sometimes called error output or diagnostic output).
A number, called a file descriptor, is associated with each of these files, as follows:
- File descriptor 0 — Standard input
- File descriptor 1 — Standard output
- File descriptor 2 — Standard error (diagnostic) output
A child process normally inherits these files from its parent. All three files are initially assigned to the workstation (0 to the keyboard, 1 and 2 to the display). The shell permits them to be redirected elsewhere before control is passed to a command.
When you enter a command, if no file name is given, your keyboard is the standard input, sometimes denoted as stdin. When a command finishes, the results are displayed on your screen.
Your screen is the standard output, sometimes denoted as stdout. By default, commands take input from the standard input and send the results to standard output.
Error messages are directed to standard error, sometimes denoted as stderr. By default, this is your screen.
These default actions of input and output can be varied. You can use a file as input and write results of a command to a file. This is called input/output redirection.
The output from a command, which normally goes to the display device, can be redirected to a file instead. This is known as output redirection. This is useful when you have a lot of output that is difficult to read on the screen or when you want to put files together to create a larger file.
Though not used as much as output redirection, the input for a command, which normally comes from the keyboard, can also be redirected from a file. This is known as input redirection. Redirection of input lets you prepare a file in advance and then have the command read the file.
표준 출력 방향 바꾸기
명령 끝에 >filename 표기를 붙이면 명령의 출력이 지정한 파일 이름에 기록됩니다. > 기호를 출력 방향 바꾸기 연산자라고 합니다.
결과를 화면에 내는 명령이면 무엇이든 출력을 파일로 돌릴 수 있습니다.
영어 원문
Standard output redirection
When the notation >filename is added to the end of a command, the output of the command is written to the specified file name. The > symbol is known as the output redirection operator.
Any command that outputs its results to the screen can have its output redirected to a file.
출력을 파일로 보내기
명령 뒤에 출력 방향 바꾸기 연산자와 파일 이름을 입력하면 프로세스의 출력을 파일로 보낼 수 있습니다.
예를 들어 who 명령의 결과를 users라는 파일로 보내려면 다음을 입력합니다.
who > users
참고: users 파일이 이미 있으면 지워지고 대체됩니다. 단, ksh(Korn 셸)나 csh(C 셸)의 내장 set 명령으로 noclobber 옵션을 지정했으면 그렇지 않습니다.
users 파일의 내용을 보려면 다음을 입력합니다.
cat users
다음과 비슷한 목록이 나옵니다.
denise lft/0 May 13 08:05
marta pts/1 May 13 08:10
endrica pts/2 May 13 09:33
영어 원문
Redirecting output to a file
The output of a process can be redirected to a file by typing the command followed by the output redirection operator and file name.
For example, to redirect the results of the who command to a file named users, type the following:
who > users
Note: If the users file already exists, it is deleted and replaced, unless the noclobber option of the set built-in ksh (Korn shell) or csh (C shell) command is specified.
To see the contents of the users file, type the following:
cat users
A list similar to the following is displayed:
denise lft/0 May 13 08:05
marta pts/1 May 13 08:10
endrica pts/2 May 13 09:33
출력을 파일에 덧붙이기
명령 끝에 >> filename 표기를 붙이면 명령의 출력이 기존 데이터를 덮어쓰지 않고 지정한 파일에 덧붙습니다. >> 기호를 덧붙이기 방향 바꾸기 연산자라고 합니다.
예를 들어 file2를 file1에 덧붙이려면 다음을 입력합니다.
cat file2 >> file1
참고: file1 파일이 없으면 만들어집니다. 단, ksh나 csh의 내장 set 명령으로 noclobber 옵션을 지정했으면 그렇지 않습니다.
영어 원문
Redirecting output to append to a file
When the notation >> filename is added to the end of a command, the output of the command is appended to the specified file name, rather than writing over any existing data. The >> symbol is known as the append redirection operator.
For example, to append file2 to file1, type the following:
cat file2 >> file1
Note: If the file1 file does not exist, it is created, unless the noclobber option of the set built-in ksh (Korn shell) or csh (C shell) command is specified.
키보드 입력을 방향 바꿔 텍스트 파일 만들기
cat 명령만 쓰면 키보드로 입력한 것을 입력으로 씁니다. 이 입력을 파일로 보낼 수 있습니다.
텍스트가 끝났음을 알리려면 새 줄에서 Ctrl-D를 누릅니다.
시스템 프롬프트에서 다음을 입력합니다.
cat > filename
This is a test.
^D
영어 원문
Creating a text file with redirection from the keyboard
Used alone, the cat command uses whatever you type at the keyboard as input. You can redirect this input to a file.
Press Ctrl-D on a new line to signal the end of the text.
At the system prompt, type the following:
cat > filename
This is a test.
^D
텍스트 파일 이어 붙이기
여러 파일을 한 파일로 합칠 수 있습니다. 여러 파일을 하나로 합치는 것을 이어 붙이기(concatenation)라고 합니다.
다음 예는 file1, file2, file3을 이 순서로 덧붙인 file4를 만듭니다.
- 시스템 프롬프트에서 다음을 입력합니다.
cat file1 file2 file3 > file4
- 다음 예는 파일을 이어 붙일 때 흔히 하는 실수입니다.
cat file1 file2 file3 > file1
주의: 이 예에서 cat 명령이 file1, file2, file3의 내용을 file1에 덧붙이리라 기대할 수 있습니다. 그러나 cat 명령은 먼저 출력 파일을 만들므로 실제로는 file1의 내용을 지운 뒤 file2와 file3을 덧붙입니다.
영어 원문
Text file concatenation
You can combine multiple files into one file. Combining various files into one file is known as concatenation.
The following example creates file4, which consists of file1, file2, and file3, appended in the order below.
See the following examples:
- At the system prompt, type the following:
cat file1 file2 file3 > file4
- The following example shows a common error when concatenating files:
cat file1 file2 file3 > file1
Attention: In this example, you might expect the cat command to append the contents of file1, file2, and file3 into file1. The cat command creates the output file first, so it actually erases the contents of file1 and then appends file2 and file3 to it.
표준 입력 방향 바꾸기
명령 끝에 < filename 표기를 붙이면 명령의 입력을 지정한 파일 이름에서 읽습니다. < 기호를 입력 방향 바꾸기 연산자라고 합니다.
참고: 보통 키보드에서 입력을 받는 명령만 입력 방향을 바꿀 수 있습니다.
예를 들어 mail 명령으로 letter1 파일을 사용자 denise에게 메시지로 보내려면 다음을 입력합니다.
mail denise < letter1
영어 원문
Standard input redirection
When the notation < filename is added to the end of a command, the input of the command is read from the specified file name. The < symbol is known as the input redirection operator.
Note: Only commands that normally take their input from the keyboard can have their input redirected.
For example, to send the file letter1 as a message to user denise with the mail command, type the following:
mail denise < letter1
/dev/null 파일로 출력 버리기
/dev/null 파일은 특수 파일입니다. 늘 비어 있다는 독특한 특성이 있습니다. /dev/null로 보낸 데이터는 모두 버려집니다. 무시하고 싶은 출력을 내는 프로그램이나 명령을 실행할 때 쓸모 있습니다.
예를 들어 화면에서 입력을 받고 실행 중에 보고 싶지 않은 메시지를 내는 myprog라는 프로그램이 있다고 합시다. myscript 파일에서 입력을 읽고 표준 출력 메시지를 버리려면 다음을 입력합니다.
myprog < myscript >/dev/null
이 예에서 myprog는 myscript 파일을 입력으로 쓰고 표준 출력은 모두 버려집니다.
영어 원문
Discarding output with the /dev/null file
The /dev/null file is a special file. This file has a unique property: it is always empty. Any data sent to /dev/null is discarded. This is a useful feature when you run a program or command that generates output that you want to ignore.
For example, you have a program named myprog that accepts input from the screen and generates messages while it is running that you would rather not see on your screen. To read input from the file myscript and discard the standard output messages, type the following:
myprog < myscript >/dev/null
In this example, myprog uses the file myscript as input, and all standard output is discarded.
표준 오류와 다른 출력의 방향 바꾸기
명령은 표준 입력과 표준 출력 말고도 진단 출력이라는 오류나 상태 메시지 같은 다른 종류의 출력을 내는 경우가 많습니다. 표준 출력처럼 표준 오류 출력도 방향을 바꾸지 않으면 화면에 쓰입니다.
표준 오류나 다른 출력의 방향을 바꾸려면 파일 기술자를 씁니다. 파일 기술자는 명령이 보통 쓰는 각 입출력 파일과 연결된 번호입니다. 표준 입력과 표준 출력의 방향을 바꿀 때도 파일 기술자를 지정할 수 있습니다. 표준 입력, 출력, 오류와 연결된 번호는 다음과 같습니다.
| 번호 | 파일 |
|---|---|
| 0 | 표준 입력(키보드) |
| 1 | 표준 출력(디스플레이) |
| 2 | 표준 오류(디스플레이) |
표준 오류 출력의 방향을 바꾸려면 출력이나 덧붙이기 방향 바꾸기 기호(>나 >>) 앞에 파일 기술자 번호 2를 넣고 기호 뒤에 파일 이름을 씁니다. 예를 들어 다음 명령은 testfile.c 파일을 컴파일하는 cc 명령의 표준 오류 출력을 ERRORS 파일 끝에 덧붙입니다.
cc testfile.c 2>> ERRORS
0부터 9까지의 파일 기술자로 다른 종류의 출력도 방향을 바꿀 수 있습니다. 예를 들어 cmd 명령이 파일 기술자 9에 출력을 쓰면 다음 명령으로 그 출력을 savedata 파일로 보낼 수 있습니다.
cmd 9> savedata
명령이 출력을 여러 곳에 쓰면 각각을 따로 돌릴 수 있습니다. 명령이 표준 출력을 파일 기술자 1에, 표준 오류 출력을 파일 기술자 2에 보내고, 파일 기술자 9에 데이터 파일을 만든다고 합시다. 다음 명령행은 각 출력을 다른 파일로 보냅니다.
command > standard 2> error 9> data
영어 원문
Standard error and other output redirection
In addition to the standard input and standard output, commands often produce other types of output, such as error or status messages known as diagnostic output. Like standard output, standard error output is written to the screen unless it is redirected.
To redirect standard error or other output, use a file descriptor. A file descriptor is a number associated with each of the I/O files that a command ordinarily uses. File descriptors can also be specified to redirect standard input and standard output. The following numbers are associated with standard input, output, and error:
- 0 — Standard input (keyboard)
- 1 — Standard output (display)
- 2 — Standard error (display)
To redirect standard error output, type the file descriptor number 2 in front of the output or append redirection symbols (> or > >) and a file name after the symbol. For example, the following command takes the standard error output from the cc command where it is used to compile the testfile.c file and appends it to the end of the ERRORS file:
cc testfile.c 2>> ERRORS
Other types of output can also be redirected using the file descriptors from 0 through 9. For example, if the cmd command writes output to file descriptor 9, you can redirect that output to the savedata file with the following command:
cmd 9> savedata
If a command writes to more than one output, you can independently redirect each one. Suppose that a command directs its standard output to file descriptor 1, directs its standard error output to file descriptor 2, and builds a data file on file descriptor 9. The following command line redirects each of these outputs to a different file:
command > standard 2> error 9> data
인라인 입력(here) 문서로 방향 바꾸기
출력을 인라인 입력(here) 문서로 돌릴 수 있습니다.
명령이 다음 꼴이고
command << eofstring
eofstring이 패턴 일치 문자가 없는 문자열이면, 셸은 eofstring만 있는(앞에 탭이 올 수 있는) 줄을 읽을 때까지 뒤따르는 줄을 command의 표준 입력으로 씁니다. 첫 eofstring과 둘째 사이의 줄을 흔히 인라인 입력 문서 또는 here 문서라고 합니다. << 방향 바꾸기 문자 바로 뒤에 하이픈(-)이 오면 셸은 here 문서의 각 줄을 command에 넘기기 전에 앞쪽 탭 문자를 지웁니다.
셸은 here 문서가 든 임시 파일을 만들고, 명령에 넘기기 전에 내용에 변수와 명령 치환을 합니다. 명령 치환 안 명령행의 일부인 파일 이름에는 패턴 일치를 합니다. 치환을 모두 막으려면 eofstring의 아무 문자나 따옴표 처리합니다.
command << \eofstring
here 문서는 별도 파일에 두는 것보다 셸 프로시저 안에 두는 편이 편한 적은 양의 입력 데이터(편집기 스크립트 등)에 특히 쓸모 있습니다. 예를 들어 다음을 입력할 수 있습니다.
cat <<- xyz
This message will be shown on the
display with leading tabs removed.
xyz
관련 개념
- Korn 셸이나 POSIX 셸의 입출력 방향 바꾸기
영어 원문
Redirecting output to inline input (here) documents
You can redirect output to inline input (here) documents.
If a command is in the following form:
command << eofstring
and eofstring is any string that does not contain pattern-matching characters, then the shell takes the subsequent lines as the standard input of command until the shell reads a line consisting of only eofstring (possibly preceded by one or more tab characters). The lines between the first eofstring and the second are frequently referred to as an inline input document, or a here document. If a hyphen (-) immediately follows the << redirection characters, the shell strips leading tab characters from each line of the here document before it passes the line to command.
The shell creates a temporary file containing the here document and performs variable and command substitution on the contents before passing the file to the command. It performs pattern matching on file names that are part of command lines in command substitutions. To prohibit all substitutions, quote any character of the eofstring:
command << \eofstring
The here document is especially useful for a small amount of input data that is more conveniently placed in the shell procedure rather than kept in a separate file (such as editor scripts). For example, you could type the following:
cat <<- xyz
This message will be shown on the
display with leading tabs removed.
xyz
Related concepts
Input and output redirection in the Korn shell or POSIX shell Before the Korn shell executes a command, it scans the command line for redirection characters. These special notations direct the shell to redirect input and output.
파이프와 필터로 방향 바꾸기
두 개 이상의 명령을 이어 한 명령의 표준 출력을 다른 명령의 표준 입력으로 쓸 수 있습니다. 이렇게 이은 명령 묶음을 파이프라인이라고 합니다.
명령을 잇는 연결을 파이프라고 합니다. 파이프를 쓰면 한 가지 일만 하는 명령 여럿을 강력한 명령 하나로 묶을 수 있습니다. 파이프라인으로 한 명령의 출력을 다른 명령의 입력이 되게 할 수 있습니다. 명령은 파이프(|) 기호로 잇습니다.
다른 명령에서 입력을 받아 고친 뒤 결과를 표준 출력으로 보내는 명령을 필터라고 합니다. 필터는 혼자 쓸 수도 있지만 파이프라인에서 특히 쓸모 있습니다. 가장 흔한 필터는 다음과 같습니다.
- sort
- more
- pg
다음 예를 봅니다.
- ls 명령은 현재 디렉터리 내용을 한 줄기 스크롤 데이터로 화면에 씁니다. 한 화면이 넘으면 일부 데이터가 보이지 않게 됩니다. 내용을 화면 단위로 보려면 파이프라인으로 ls 명령의 출력을 화면 출력 형식을 제어하는 pg 명령으로 보냅니다. 예를 들어 다음을 입력합니다.
ls | pg
이 예에서 ls 명령의 출력이 pg 명령의 입력이 됩니다. 다음 화면으로 가려면 Enter를 누릅니다. 파이프라인은 한 방향(왼쪽에서 오른쪽)으로만 동작합니다. 파이프라인의 각 명령은 별도 프로세스로 실행되며 모든 프로세스가 동시에 실행될 수 있습니다. 읽을 입력이 없거나 다음 프로세스로 가는 파이프가 가득 차면 프로세스가 잠시 멈춥니다.
- 파이프를 쓰는 다른 예는 grep 명령입니다. grep 명령은 파일에서 특정 패턴의 문자열이 든 줄을 찾습니다. 7월에 만들거나 고친 모든 파일을 보려면 다음을 입력합니다.
ls -l | grep Jul
이 예에서 ls 명령의 출력이 grep 명령의 입력이 됩니다.
영어 원문
Redirecting output using pipes and filters
You can connect two or more commands so that the standard output of one command is used as the standard input of another command. A set of commands connected this way is known as a pipeline.
The connection that joins the commands is known as a pipe. Pipes are useful because they let you tie many single-purpose commands into one powerful command. You can direct the output from one command to become the input for another command using a pipeline. The commands are connected by a pipe (|) symbol.
When a command takes its input from another command, modifies it, and sends its results to standard output, it is known as a filter. Filters can be used alone, but they are especially useful in pipelines. The most common filters are as follows:
sort
more
pg
See the following examples:
- The ls command writes the contents of the current directory to the screen in one scrolling data stream. When more than one screen of information is presented, some data is lost from view. To control the output so the contents display screen by screen, you can use a pipeline to direct the output of the ls command to the pg command, which controls the format of output to the screen. For example, type the following:
ls | pg
In this example, the output of the ls command becomes the input for the pg command. Press Enter to continue to the next screen. Pipelines operate in one direction only (left to right). Each command in a pipeline runs as a separate process, and all processes can run at the same time. A process pauses when it has no input to read or when the pipe to the next process is full.
- Another example of using pipes is with the grep command. The grep command searches a file for lines that contain strings of a certain pattern. To display all your files created or modified in July, type the following:
ls -l | grep Jul
In this example, the output of the ls command becomes the input for the grep command.
프로그램 출력을 보이면서 파일에 복사하기(tee 명령)
tee 명령은 파이프와 함께 써서 표준 입력을 읽은 뒤 프로그램의 출력을 표준 출력에 쓰고 동시에 지정한 파일에 복사합니다. 출력을 바로 보면서 나중에 쓰려고 저장할 때 tee 명령을 씁니다.
예를 들어 다음을 입력합니다.
ps -ef | tee program.ps
ps -ef 명령의 표준 출력을 디스플레이 장치에 보여 주는 동시에 program.ps 파일에 사본을 저장합니다. program.ps 파일이 이미 있으면 내장 set 명령의 noclobber 옵션을 지정하지 않은 한 지워지고 대체됩니다.
예를 들어 명령의 출력을 보면서 기존 파일에 저장하려면 다음을 입력합니다.
ls -l | tee -a program.ls
ls -l의 표준 출력을 디스플레이 장치에 보여 주는 동시에 program.ls 파일 끝에 사본을 덧붙입니다.
시스템은 다음과 비슷한 정보를 보여 주며, program.ls 파일에도 같은 정보가 들어 있습니다.
-rw-rw-rw- 1 jones staff 2301 Sep 19 08:53 161414
-rw-rw-rw- 1 jones staff 6317 Aug 31 13:17 def.rpt
-rw-rw-rw- 1 jones staff 5550 Sep 10 14:13 try.doc
전체 구문은 Commands Reference, Volume 5의 tee 명령을 봅니다.
영어 원문
Displaying program output and copying to a file (tee command)
The tee command, used with a pipe, reads standard input, then writes the output of a program to standard output and simultaneously copies it into the specified file or files. Use the tee command to view your output immediately and at the same time, store it for future use.
For example, type the following:
ps -ef | tee program.ps
This displays the standard output of the ps -ef command on the display device, and at the same time, saves a copy of it in the program.ps file. If the program.ps file already exists, it is deleted and replaced unless the noclobber option of the set built-in command is specified.
For example, to view and save the output from a command to an existing file:
ls -l | tee -a program.ls
This displays the standard output of ls -l at the display device and at the same time appends a copy of it to the end of the program.ls file.
The system displays information similar to the following, and the program.ls file contains the same information:
-rw-rw-rw- 1 jones staff 2301 Sep 19 08:53 161414
-rw-rw-rw- 1 jones staff 6317 Aug 31 13:17 def.rpt
-rw-rw-rw- 1 jones staff 5550 Sep 10 14:13 try.doc
See the tee command in the Commands Reference, Volume 5 for the complete syntax.
화면 지우기(clear 명령)
clear 명령으로 화면의 메시지와 키보드 입력을 비웁니다.
프롬프트에서 다음을 입력합니다.
clear
시스템은 화면을 지우고 프롬프트를 보여 줍니다.
영어 원문
Clearing your screen (clear command)
Use the clear command to empty the screen of messages and keyboard input.
At the prompt, type the following:
clear
The system clears the screen and displays the prompt.
표준 출력에 메시지 보내기
echo 명령으로 화면에 메시지를 보여 줍니다.
예를 들어 표준 출력에 메시지를 쓰려면 프롬프트에서 다음을 입력합니다.
echo Please insert diskette . . .
다음 메시지가 나옵니다.
Please insert diskette . . .
예를 들어 패턴 일치 문자와 함께 echo 명령을 쓰려면 프롬프트에서 다음을 입력합니다.
echo The back-up files are: *.bak
시스템은 The back-up files are: 메시지 뒤에 현재 디렉터리에서 .bak으로 끝나는 파일 이름을 보여 줍니다.
영어 원문
Sending a message to standard output
Use the echo command to display messages on the screen.
For example, to write a message to standard output, at the prompt, type the following:
echo Please insert diskette . . .
The following message is displayed:
Please insert diskette . . .
For example, to use the echo command with pattern-matching characters, at the prompt, type the following:
echo The back-up files are: *.bak
The system displays the message The back-up files are: followed by the file names in the current directory ending with .bak.
파일에 텍스트 한 줄 덧붙이기(echo 명령)
echo 명령을 덧붙이기 방향 바꾸기 연산자와 함께 써서 파일에 텍스트 한 줄을 더합니다.
예를 들어 프롬프트에서 다음을 입력합니다.
echo Remember to back up mail files by end of week.>>notes
notes 파일 끝에 Remember to back up mail files by end of week. 메시지를 더합니다.
영어 원문
Appending a single line of text to a file (echo command)
Use the echo command, used with the append redirection operator, to add a single line of text to a file.
For example, at the prompt, type the following:
echo Remember to back up mail files by end of week.>>notes
This adds the message Remember to back up mail files by end of week. to the end of the file notes.
화면을 파일로 복사하기(capture와 script 명령)
VT100 터미널을 흉내 내는 capture 명령으로 터미널에 출력된 모든 것을 지정한 파일에 복사합니다. script 명령은 VT100 터미널을 흉내 내지 않고 터미널에 출력된 모든 것을 지정한 파일에 복사합니다.
두 명령 모두 터미널 대화 기록을 인쇄할 때 쓸모 있습니다.
예를 들어 VT100을 흉내 내며 터미널 화면을 잡으려면 프롬프트에서 다음을 입력합니다.
capture screen.01
시스템은 다음과 비슷한 정보를 보여 줍니다.
Capture command is started. The file is screen.01.
Use ^P to dump screen to file screen.01.
You are now emulating a vt100 terminal.
Press Any Key to continue.
데이터를 입력하고 화면 내용을 덤프한 뒤 Ctrl-D를 누르거나 exit를 입력하고 Enter를 눌러 capture 명령을 멈춥니다. 시스템은 다음과 비슷한 정보를 보여 줍니다.
Capture command is complete. The file is screen.01.
You are NO LONGER emulating a vt100 terminal.
cat 명령으로 파일 내용을 봅니다.
예를 들어 터미널 화면을 잡으려면 프롬프트에서 다음을 입력합니다.
script
시스템은 다음과 비슷한 정보를 보여 줍니다.
Script command is started. The file is typescript.
이제 화면에 나오는 모든 것이 typescript 파일에 복사됩니다.
script 명령을 멈추려면 Ctrl-D를 누르거나 exit를 입력하고 Enter를 누릅니다. 시스템은 다음과 비슷한 정보를 보여 줍니다.
Script command is complete. The file is typescript.
cat 명령으로 파일 내용을 봅니다.
전체 구문은 Commands Reference의 capture와 script 명령을 봅니다.
영어 원문
Copying your screen to a file (capture and script commands)
Use the capture command, which emulates a VT100 terminal, to copy everything printed on your terminal to a file that you specify. Use the script command to copy everything printed on your terminal to a file that you specify, without emulating a VT100 terminal.
Both commands are useful for printing records of terminal dialogs.
For example, to capture the screen of a terminal while emulating a VT100, at the prompt, type the following:
capture screen.01
The system displays information similar to the following:
Capture command is started. The file is screen.01.
Use ^P to dump screen to file screen.01.
You are now emulating a vt100 terminal.
Press Any Key to continue.
After entering data and dumping the screen contents, stop the capture command by pressing Ctrl-D or typing exit and pressing Enter. The system displays information similar to the following:
Capture command is complete. The file is screen.01.
You are NO LONGER emulating a vt100 terminal.
Use the cat command to display the contents of your file.
For example, to capture the screen of a terminal, at the prompt, type the following:
script
The system displays information similar to the following:
Script command is started. The file is typescript.
Everything displayed on the screen is now copied to the typescript file.
To stop the script command, press Ctrl-D or type exit and press Enter. The system displays information similar to the following:
Script command is complete. The file is typescript.
Use the cat command to display the contents of your file.
See the capture and script commands in Commands Reference for the complete syntax.
화면에 큰 글자로 텍스트를 보여 주는 명령(banner 명령)
banner 명령은 ASCII 문자를 화면에 큰 글자로 보여 줍니다.
출력의 각 줄은 숫자(또는 대문자나 소문자) 10자까지입니다.
예를 들어 프롬프트에서 다음을 입력합니다.
banner GOODBYE!
시스템은 화면에 GOODBYE!를 큰 글자로 보여 줍니다.
영어 원문
Command to display text in large letters on your screen (banner command)
The banner command displays ASCII characters to your screen in large letters.
Each line in the output can be up to 10 digits (or uppercase or lowercase characters) in length.
For example, at the prompt, type the following:
banner GOODBYE!
The system displays GOODBYE! in large letters on your screen.
입출력 방향 바꾸기 명령 요약
다음은 입출력 방향 바꾸기에 쓰는 명령입니다.
| 명령·기호 | 설명 |
|---|---|
> |
표준 출력 방향 바꾸기 |
< |
표준 입력 방향 바꾸기 |
>> |
출력을 파일에 덧붙이기 |
| 파이프 기호 | 파이프와 필터로 방향 바꾸기 |
| banner | ASCII 문자열을 큰 글자로 표준 출력에 씁니다. |
| capture | 터미널 화면을 파일로 덤프할 수 있게 합니다. |
| clear | 터미널 화면을 지웁니다. |
| echo | 문자열을 표준 출력에 씁니다. |
| script | 터미널 입출력을 파일로 복사할 수 있게 합니다. |
| tee | 프로그램의 표준 출력을 보여 주고 파일에 복사합니다. |
영어 원문
Command summary for input and output redirection
The following are commands for input and output redirection.
>— “Standard output redirection” on page 333<— “Standard input redirection” on page 334> >— “Redirecting output to append to a file” on page 333 “Redirecting output using pipes and filters” on page 335- banner — Writes ASCII character strings in large letters to standard output
- capture — Allows terminal screens to be dumped to a file
- clear — Clears the terminal screen
- echo — Writes character strings to standard output
- script — Allows terminal input and output to be copied to a file
- tee — Displays the standard output of a program and copies it into a file