學習UNIX - 系列I,,en,學習UNIX,,en,UNIX是最流行和最可靠的操作系統之一,,en,學習UNIX對於開發人員來說非常重要,,en,學習UNIX操作系統的命令和概念非常重要,,en,在這個系列中,,en,我們試圖總結UNIX的重要概念及其用法,,en,希望你會喜歡閱讀本文,,en,我們將提出更多系列文章來介紹UNIX操作系統的其他主題,,en,什麼是UNIX,,en,UNIX是一個操作系統,,en,操作系統由充當計算機和最終用戶之間的鏈接的程序組成,,en,有哪些不同的UNIX變體可用,,en,市場上可以使用的各種UNIX變體是Solaris UNIX,,en,AIX,,en,UP UNIX,,en,BSD等,,en,UNIX操作系統的三個部分是什麼?,,en,內核有三個部分,,en

UNIX

Learning UNIX

介紹: UNIX is one of the most popular and reliable OS. So, learning UNIX is very important for the developers. 特別, learning the commands and concepts of the UNIX OS is very important. In this series, we have tried to summarize the important concepts of UNIX and their usage. Hope you will enjoy reading this. We will come up some more series to cover other asserts of UNIX OS.







1: What is UNIX?

Answer: UNIX is an operating system. Operating system consists of programs that act as a link between the computer and the end user.

2: What are the different UNIX variants available?
Answer:
Various UNIX variants available in the market are Solaris UNIX, AIX, UP UNIX, BSD etc.

3: What are the three parts in UNIX operating system?
Answer:
Three parts are kernel, 標準實用程序和系統配置文件,,en,什麼是內核,,en,核心,,en,是UNIX操作系統的核心,,en,它與硬件交互,,en,管理記憶,,en,安排任務,也進行文件管理,,en,什麼是貝殼,,en,貝殼,,en,是一個處理用戶請求的實用程序,,en,shell解釋命令並調用用戶請求的程序,,en,什麼是命令和實用程序,,en,有各種命令和實用程序可供日常使用,,en,很少有例子像cp,,en,MV,,en,貓和grep等,,en,UNIX中的文件和目錄是什麼,,en,UNIX中的所有數據都組織成文件,文件再次組織到目錄中,,en,這些目錄被組織到文件系統中,,en,你如何啟動UNIX系統,,en,當你打開電源,,en,系統自動啟動並提示您登錄,,en.

4: What is kernel?
Answer:kernel is the core of the UNIX operating system. It interacts with the hardware, manages memory, schedule tasks and also does the file management.

5: What is shell?
Answer:
shell is a utility that processes user requests. The shell interprets the command and calls the program requested by the user.

6: What are Commands and Utilities?
Answer:
There are various command and utilities available for day to day use. Few examples are like cp, mv, cat and grep etc.

7: What are Files and Directories in UNIX?
Answer:
All data in UNIX is organized into files and files are again organized into directories. These directories are organized into file system.

8: How do you bootup UNIX system?
Answer:
When you turn on the power, the system starts booting up automatically and prompts you for log in.

9: 如何列出所有文件或目錄,,en,使用ls命令列出所有文件或目錄,,en,'whoami是什麼,,en,命令,,en,此命令基本上列出了與當前登錄名相關聯的帳戶名,,en,命名一些UNIX命令來關閉系統,,en,有些命令'停止了,,en,“關機,,en,和'關機,,en,UNIX中可用的三個不同文件是什麼,,en,普通文件有三種不同的文件,,en,目錄和特殊文件,,en,哪個文件用於訪問硬件,,en,特殊文件用於訪問硬盤驅動器等硬件,,en,CD-ROM驅動器,,en,調製解調器等,,en,UNIX中的元字符是什麼,,en,UNIX將某些特殊字符識別為命令指令,,en,這些特殊字符稱為'元字符',如'*',,en,'等等,,en,UNIX中的隱藏文件是什麼,,en?
Answer:
Use ls command to list out all the files or directories.

10: What does ‘whoami’ command do?
Answer:
This command basically lists the associated account name with the current login.







11: Name some UNIX commands to shutdown the system.
Answer:
Some commands are ‘halt’, ‘poweroffand ‘shutdown.

12: What are the three different files available in UNIX?
Answer:
Three different files are Ordinary Files, Directories and Special Files.

13: Which file is used to access hardware?
Answer:
Special files are used to access hardware such as hard drives, CD-ROM drives, modems etc.

14: What are Meta characters in UNIX?
Answer:
UNIX recognizes certain special characters as command directives. These special characters are known as ‘meta characters’ like ‘*’,’?’ etc.

15: What are hidden files in UNIX?
Answer:
UNIX使用大多數這些隱藏文件來存儲配置信息,,en,哪個編輯器在UNIX中最常用於創建文件,,en,'vi,,en,editor用於在任何UNIX系統上創建普通文件,,en,您只需要提供以下命令,,en,用戶,,en,vi文件名,,en,哪個命令用於顯示文件的內容,,en,那隻貓,,en,command用於查看文件的內容,,en,以下是查看文件內容的簡單示例,,en,貓文件名,,en,UNIX中的三個流是什麼,,en,三個流是標準輸入,,en,稱為標準輸入,,en,標準輸出,,en,稱為標準輸出,,en,和斯特德爾,,en,稱為標準誤差,,en,什麼是'主目錄',,en,這是您第一次登錄時的目錄,,en.

16: Which editor is most commonly used in UNIX to create file?
Answer:
The ‘vi’ editor is used to create ordinary files on any UNIX system. You simply need to give following command:

[User]$ vi filename

17: Which command is used to display content of a file?
Answer:
The ‘cat’ command is used to see the content of a file. Following is the simple example to see the content of a file.

[User]$ cat filename

18: What are the three streams in UNIX?
Answer: Three streams are stdin (referred to as standard input), stdout (referred to as standard output) and stderr (referred to as standard error).

19: What is ‘Home Directory’?
Answer:
This is the directory where you will find yourself when you first login.

20: UNIX系統中可用於文件的不同類型的權限是什麼,,en,這三個權限是'所有者權限',,en,組權限,,en,和另一個,,en,世界,,en,權限“,,en,UNIX中有哪些不同的訪問模式,,en,UNIX中有三種訪問模式,,en,讀,,en,授予閱讀能力,,en,寫,,en,授予修改/刪除文件內容的功能,,en,執行,,en,授予將文件作為程序運行的權限,,en,哪個命令用於更改文件/目錄權限,,en,'chmod',,en,改變模式,,en,命令用於更改權限,,en,有兩種方法可以使用chmod符號模式和絕對模式,,en,描述更改文件所有者/組的命令,,en,'chown',,en,改變所有者,,en,命令用於更改文件的所有者,,en,'chgrp',,en,改變組,,en?
Answer:
The three permissions are ‘Owner permissions’,’ Group permissions’ and the ‘Other (world) permissions’.

21: What are the different access modes in UNIX?
Answer:
There are three access modes available in UNIX.
Read (Grants the capability to read)

Write (Grants the capability to modify/remove the content of a file)

Execute (Grants to run a file as a program)

22: Which command is used to change the file/directory permission?
Answer: The ‘chmod’ (change mode) command is used to change the permission. There are two ways to use chmod symbolic mode and absolute mode.

23: Describe the commands to change the owner/group of a file.
Answer: The ‘chown'(change owner) command is used to change the owner of a file. And ‘chgrp'(change group) 命令用於更改文件組,,en,什麼是'.profile文件,,en,在UNIX中,,en,'.profile,,en,文件由UNIX計算機的系統管理員維護,,en,它包含該系統上所有用戶所需的所有shell初始化信息,,en,什麼是PS1和PS2變量,,en,shell顯示為命令提示符的字符存儲在PS1變量和默認的輔助提示符中,,en,大於號,,en,存儲在PS2變量中,,en,哪個UNIX命令用於執行文件的次要格式化,,en,'pr,,en,命令用於在終端屏幕或打印機上進行文件的次要格式化,,en,你什麼時候使用'lp'和'lpr'命令,,en,命令'lp,,en,或'lpr,,en.

24: What is ‘.profile File’ in UNIX?
Answer: The ‘.profile’ file is maintained by the system administrator of the UNIX machine. It contains all the shell initialization information required by all users on that system.

25: What are PS1 and PS2 variable?
Answer: The characters that the shell displays as your command prompt are stored in PS1 variable and the default secondary prompt’ >’ (the greater than sign) is stored in PS2 variable.

26: Which UNIX command is used to do the minor formatting of files?
Answer: The ‘pr’ command is used to do the minor formatting of files on the terminal screen or for a printer.

27: When do you use ‘lp’ and ‘lpr’ Commands?
Answer:
The command ‘lp’ or ‘lpr’ 用於在紙上打印文件而不是屏幕顯示,,en,我們可以使用UNIX命令發送電子郵件,,en,UNIX'郵件,,en,命令用於發送和接收電子郵件,,en,以下是發送電子郵件的語法,,en,郵件,,en,主題,,en,c cc-addr,,en,b bcc-addr,,en,到地址,,en,什麼是'管道,,en,在UNIX'管道',,en,可以定義為兩個或多個命令之間的連接器,,en,它用於使一個程序的輸出成為下一個程序的輸入,,en,什麼是'過濾器,,en,有些時候程序從一個程序中獲取輸入,,en,對該輸入執行一些操作,,en,然後將結果寫入標準輸出,,en,這被稱為'過濾器',,en,什麼是'grep,,en,'grep,,en,command用於在一個或多個文件中搜索具有特定模式的行,,en.

28: Can we use UNIX command to send email?
Answer:
UNIX ‘mail’ command is used to send and receive email.

Here is the syntax to send an email:

[User]$mail [-s subject] [-c cc-addr] [-b bcc-addr] to-addr

29: What is ‘pipe’ in UNIX?
Answer:
In UNIX ‘pipe'(|) can be defined as a connector between two or more commands. It is used so that the output from one program becomes the input of the next program.







30: What is ‘filter’ in UNIX?
Answer:
Some time a program takes its input from one program, performs some operation on that input, and then writes the result to the standard output. This is known as ‘filter’.

31: What is ‘grep’ Command?

Answer: The ‘grep’ command is used to search a file or files for lines that have a certain pattern. grep的最簡單用法是尋找由單個單詞組成的模式,,en,什麼'排序,,en,'排序,,en,命令用於按字母順序或數字順序排列文本行,,en,在UNIX中運行進程的兩種方法是什麼?,,en,啟動流程的兩種方式,,en,運行一個命令,,en,是'前景過程,,en,和'背景過程,,en,如何在UNIX中停止進程,,en,可以以各種方式停止過程,,en,發送CTRL,,en,C鍵擊,,en,默認的中斷字符,,en,將退出該命令,但當進程在前台模式下運行時它會起作用,,en,如果進程在後台模式下運行,那麼首先需要使用'ps'命令獲取其作業ID,然後使用'kill'命令終止進程,,en,什麼是'殭屍,,en.

32: What does ‘sort’ command do?
Answer:
The ‘sort’ command is used to arrange lines of text alphabetically or numerically.

33: What are the two ways to run a process in UNIX?
Answer:
The two ways to start a process (run a command) are ‘Foreground Processes’ and ‘Background Processes’

34: How do you stop a process in UNIX?
Answer:
A process can be stopped in various ways. Sending a CTRL + C keystroke (the default interrupt character) will exit the command but it works when the process is running in foreground mode. If a process is running in background mode then first you need to get its Job ID using ‘ps’ command and then use ‘kill’ command to kill the process.

35: What is ‘Zombie’ process?
Answer:
甚至在殺死一個進程後的某個時間,,en,'ps'列表仍然可以顯示具有Z狀態的進程,,en,這是一個殭屍,,en,或者已經不復存在,,en,過程,這意味著該過程已經死亡,沒有被使用,,en,什麼是'守護進程,,en,與系統相關的後台進程稱為“守護進程”,,en,這些進程使用來自其他進程的root和services請求的權限運行,,en,什麼是'頂級'命令,,en,頂端,,en,命令是一個非常有用的工具,,en,它可以快速顯示按各種標準排序的流程,,en,什麼是'工作ID,,en,和'進程ID',,en,'工作ID,,en,用於操縱後台和暫停的進程,,en,此編號與進程ID不同,因為它較短,所以使用它,,en,什麼是'ping,,en,效用,,en,'ping,,en, a ‘ps’ listing may still show the process with a Z state. This is a zombie, or defunct, process which means the process is dead and not being used.

36: What is ‘Daemon’ process?
Answer:
System related background processes are known as ‘Daemons’. These processes are run with the permissions of root and services requests from other processes.

37: What is ‘top ‘command?
Answer:
The ‘top’ command is a very useful tool. It quickly shows processes sorted by various criteria.

38: What is ‘Job ID’ and ‘Process ID’?
Answer:
The ‘Job ID’ is used to manipulate background and suspended processes. This number is different from the process ID and is used because it is shorter.

39: What is ‘ping’ utility?
Answer:
The ‘ping’ 命令用於向網絡上可用的主機發送echo請求,,en,使用此命令可以檢查遠程主機是否響應良好,,en,什麼是'ftp,,en,命令'ftp,,en,代表'文件傳輸協議',,en,此實用程序用於將文件從一台計算機上載並下載到另一台計算機,,en,什麼是'telnet,,en,'Telnet,,en,實用程序用於允許一個站點的計算機用戶建立連接,,en,登錄,然後在另一個站點的計算機上進行工作,,en,什麼是'手指,,en,手指,,en,命令用於顯示給定主機上可以是本地或遠程用戶的信息,,en,有時'手指,,en,出於安全原因,在其他系統上禁用,,en,什麼是'VIM',,en. Using this command you can check if your remote host is responding well or not.

40: What is ‘ftp ‘ utility?
Answer: The command ‘ftp’ stands for ‘File Transfer Protocol’. This utility is used to upload and download your file from one computer to another computer.

41: What is ‘telnet’ utility?
Answer:
The ‘Telnet’ utility is used to allow a computer user at one site to make a connection, login and then conduct work on a computer at another site.

42: What is ‘finger’ utility?
Answer:
The ‘finger’ command is used to display information about users on a given host which can be either local or remote.

Sometime ‘finger’ is disabled on other systems for security reasons.

43: What is ‘VIM’?
Answer: 有一個改進版的'vi'編輯器可用,稱為VIM,,en,VIM代表'Vi Improved',,en,Linux的,,en,貝殼,,en,UNIX,,en. Here VIM stands for ‘Vi Improved’.







 

標籤:
============================================= ============================================== 在亞馬遜上購買最佳技術書籍,en,電工CT Chestnutelectric,en
============================================== ---------------------------------------------------------------- electrician ct chestnutelectric
error

Enjoy this blog? Please spread the word :)

Follow by Email
LinkedIn
LinkedIn
Share