Raspberry Pi_Kor_16.2.3 Text 파일 생성

16.2.3 Text 파일 생성

Raspberry Pi에서 text 파일을 생성하는 방법은 여러가지가 있다. Shell Terminal에서 생성하는 방법도 있고, Desktop window에서 처리하는 방법도 있다.

Shell Terminal에서 text 파일을 생성하는 방법에는 다음의 여러 가지를 이용할 수 있다.

Raspberry Pi_Kor_10.7.3 프로그램 background/foreground 실행

10.7.3 프로그램 background/foreground 실행

통상 우리가 명령을 실행할 때는 하나의 명령이 완료되면 다음 명령을 실행하는 방식으로 작업을 진행해 간다. 이렇게 진행하는 방식을 우리는 foreground방식이라고 한다. 이 방식에서는 하나의 작업을 진행하는 도중에는 다른 명령을 입력할 수가 없다. Pi 시스템에서는 특별한 지시를 하지 않으면, 항상 foreground 방식으로 명령을 실행하게 된다.

시스템에서 실행하는 작업 중에는 짧은 시간에 종료되는 것도 있지만, 작업시간이 꽤 오래 걸리는 작업이 있을 수도 있다. 이렇게 오래 걸리는 작업이 있는 경우, 그 작업이 완료된 이후에 다른 작업을 시작할 수도 있지만, 다음에 하고자 하는 작업이 현재 진행중인 작업과 연관관계가 없는 경우, 현재 작업이 완료되는 것을 기다리지 않고, 곧바로 작업을 시작할 수도 있다.

Raspberry Pi_Kor_10.7.2 “;” 명령 – 복수 명령의 연속 실행

10.7.2 “;” 명령 – 복수 명령의 연속 실행

Linux에서는 처리하고자 하는 여러 개의 명령이 있을 경우 이를 한꺼번에 입력하여 모두 처리할 수 있는 방법을 제공한다. 이렇게 여러 개의 명령을 한꺼번에 실행하기 위해서는 다음과 같이 각각의 명령을 “;” 로 연결한다.

[명령 형식]

exec-command ; exec-command

Raspberry Pi_Kor_10.6.2 “||” 명령 – “or” 형식의 명령 실행

10.6.2 “||” 명령 – “or” 형식의 명령 실행

이 명령은 이전 명령이 정상적으로 종료되지 못한 경우에 다음 명령을 처리해주고, 두 명령의 최종 처리 결과에 따라 or 연산방식으로 exit status를 설정해 준다.

[명령 형식]

||

Raspberry Pi_Kor_10.6.1 “&&” 명령 – “and” 형식의 명령 실행

10.6 선택적 실행 처리 관련 명령

통상적으로 어떤 명령이 정상 처리되면 exit status가 zero로 설정되는데, 이것을 True라고 판단하며, 반대로 정상 처리되지 않으면 non-zero 값이 설정되는데, 이를 False로 처리한다.

10.6.1 “&&” 명령 – “and” 형식의 명령 실행

이 명령은 처음 명령이 정상적으로 종료된 경우에 다음 명령을 처리해주고, 두 명령의 최종 처리 결과에 따라 and 연산방식으로 exit status를 설정해 준다.

Raspberry Pi_Eng_10.7.3 Executing Program on Background/Foreground

10.7.3 Executing Program on Background/Foreground

Normally when we execute a command, after one command is completed, the next command is executed. We call this method of processing the foreground mode. In this way, another command can not be entered while you are working on one operation. The Raspberry Pi system always executes the command in foreground mode unless any special instruction is not issued.

Some of the tasks that you perform on the system may end in a short time, but there may be work that takes quite a while. If you have a job that takes a long time, you can start another job after it finishes, but if the next job to process is not related to the current processing job, it is possible to start the next job immediately without waiting for the current processing job to finish.

Raspberry Pi_Eng_10.7.2 “;” Command – Execute Multiple Commands Successively

10.7.2 “;” Command – Execute Multiple Commands Successively

Linux provides a way to enter and process all the commands at once, if you have multiple commands to process. To execute several commands at once in this way, link each command with the “;” command as follows.

Raspberry Pi_Eng_10.6.2 “||” Command – Execute Command by “or” Method

Original Book Contents
10.6.2 “||” Command – Execute Command by “or” Method

This command processes the next command when the first command does not processed normally, and sets the exit status by “or” operation according to the final processing result of the both commands.

Raspberry Pi_Eng_10.6.1 “&&” Command – Execute Command by “and” Method

10.6 Commands Related to Selective Execution

Normally, when a command is processed normally, the exit status is set to zero, which is ㅅtreated as “True”. On the other hand, if the command is not processed normally, the exit status is set to a non-zero value, which is treated as “False”.

10.6.1 “&&” Command – Execute Command by “and” Method

This command processes the next command if the first command is processed normally, and sets the exit status by “and” operation according to the final processing result of the both commands.

Raspberry Pi_Eng_16.2.3 Creating Text File

16.2.3 Creating Text File

There are many ways to create a text file in Raspberry Pi. There is a method to create it from the Shell Terminal, and a method to process it from the Desktop window.

There are several ways to create simple text files from the Shell Terminal as shown below: