linux 文件浏览器_浏览Linux文件系统
linux 文件瀏覽器
你為什么要學習? (Why would you want to learn?)
Linux is probably the most used operating system when it comes to development. For a developer, Linux provides all the required tools. Learning how to navigate the Linux file system can really benefit if you plan on using Linux as your primary operating system or for development purpose. The Linux command line is a very powerful tool that makes it easy and fast to access files on the system.
在開發方面,Linux可能是最常用的操作系統。 對于開發人員,Linux提供了所有必需的工具。 如果計劃將Linux用作主要操作系統或用于開發目的,那么學習如何導航Linux文件系統將真正受益。 Linux命令行是一個非常強大的工具,可以輕松快速地訪問系統上的文件。
Linux文件系統 (The Linux File System)
Linux organizes its files in a hierarchical directory structure. The files are organized in a tree-like manner. The directories may contain files and other directories. The first directory in the Linux file system is the root directory (named as a /). The root directory is the parent of all other directories in the file system. It contains files and sub-directories, which contain more files and sub-directories and so on.
Linux以分層目錄結構組織其文件。 這些文件以樹狀方式組織。 這些目錄可能包含文件和其他目錄。 Linux文件系統中的第一個目錄是根目錄 (名為/ )。 根目錄是文件系統中所有其他目錄的父目錄。 它包含文件和子目錄,其中包含更多文件和子目錄,依此類推。
Fig. 1: The contents of Root Directory.
圖1:根目錄的內容。
基本命令 (Basic Commands)
1) pwd: print the name of the current working directory on the terminal
1)pwd:在終端上打印當前工作目錄的名稱
To check which directory we are currently working in, we can use the "pwd" command. This command prints the absolute path of the current/working directory.
要檢查我們當前在哪個目錄中,可以使用“ pwd”命令 。 此命令顯示當前/工作目錄的絕對路徑。
When we log in to the system, our current working directory is set to our home directory. Each user is assigned its own home directory where he writes his files.
當我們登錄到系統時,我們當前的工作目錄被設置為我們的主目錄 。 每個用戶都被分配有自己的主目錄,他在其中寫入文件。
2) ls: list the contents of the current working directory
2)ls:列出當前工作目錄的內容
To see what files we have in the current working directory we can use the "ls" command.
要查看當前工作目錄中有哪些文件,可以使用“ ls”命令 。
3) cd: change directory
3)cd:更改目錄
To change our current working directory we use "cd" command. To change the current working directory type "cd" followed by the pathname of the new directory to which you want to go. A pathname is a route that we take to reach a particular directory. Pathnames can be specified in two ways:
要更改當前的工作目錄,請使用“ cd”命令 。 要更改當前的工作目錄,請鍵入“ cd”,后跟要轉到的新目錄的路徑名。 路徑名是我們到達特定目錄所采用的路由。 可以通過兩種方式指定路徑名 :
Absolute Pathnames
絕對路徑名
An absolute pathname begins with the root directory and follows the tree structure until the path to the desired directory is reached. For example, if I want to reach the directory bin in the usr directory which is a part of the root directory, the absolute pathname would be "/usr/bin".
絕對路徑名從根目錄開始,并遵循樹結構,直到到達所需目錄的路徑為止。 例如,如果我想到達usr目錄(它是根目錄的一部分)中的目錄bin ,則絕對路徑名為“ / usr / bin” 。
Relative Pathnames
相對路徑名
Unlike absolute pathnames which start from the root directory, Relative pathnames start from the working directory. Linux uses two particular symbols to represent the current directory and its parent directory in the file system. These are the "." and ".." symbols.
與絕對路徑名從根目錄開始不同,相對路徑名從工作目錄開始。 Linux使用兩個特殊的符號表示文件系統中的當前目錄及其父目錄。 這些是“。” 和“ ..”符號。
The "." symbol refers to the working directory and the ".." symbol refers to the parent directory of the working directory. Let's see this.
“。” 符號是工作目錄, “ ..”符號是工作目錄的父目錄。 讓我們看看這個。
pwd : /usr/bin
密碼:/ usr / bin
Let's change our working directory i.e., /usr/bin to its parent directory which is /usr. We can do this as:
讓我們將工作目錄(即/ usr / bin)更改為其父目錄/ usr 。 我們可以這樣做:
(a) Using absolute pathname
(a)使用絕對路徑名
(b) Using relative pathname
(b)使用相對路徑名
主目錄的快捷方式 (A shortcut to home directory)
The "~" symbol represents the home directory of the user. So we can use this symbol to directly go to the home directory or list its contents with ls.
“?”符號代表用戶的主目錄。 因此,我們可以使用該符號直接轉到主目錄或使用ls列出其內容。
Summing Up
加起來
In this article we saw how shell treats the Linux File System. We also learned about absolute and relative pathnames and the basic commands that are used move about the file system.
在本文中,我們了解了shell如何處理Linux文件系統 。 我們還了解了絕對路徑名和相對路徑名以及在文件系統中使用的基本命令 。
翻譯自: https://www.includehelp.com/linux/navigating-linux-file-system.aspx
linux 文件瀏覽器
總結
以上是生活随笔為你收集整理的linux 文件浏览器_浏览Linux文件系统的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: sql判断数据库类型数据_SQL数据类型
- 下一篇: Scala懒惰瓦尔