linux 文档操作,Linux学习之文档操作
8種機械鍵盤軸體對比
本人程序員,要買一個寫代碼的鍵盤,請問紅軸和茶軸怎么選?
The Linux Command Line 學習翻譯
mkdir
The mkdir command is used to create directories.It works like this:
mkdir命令是用來創建目錄的,這樣使用:mkdir directory…
A note on notation: When three periods follow an argument in the description of a command(as above),it means that the argument can be repeated,thus:
注意表示法:當遇見一個后面有三個圓點的命令(如上所示),這表示那個參數可以重復:tmp mkdir max
? tmp ls
a.json max server.js
? tmp mkdir max1 max2 max3
? tmp ls
a.json max1 reade_file.js
clone_obj.js max2 server.js
getIp.js max3
cp
The cp command copies files or directories. It can be used two different ways:
cp命令,復制文檔或目錄,它有兩種使用方法:cp file1 file2
to copy the single file or directory “file1” to file or directory “file2” and :
復制單個文檔或目錄,和:cp file… directory
to copy multiple files(either files or directories)into a direcotory.
復制多個文檔或目錄到一個目錄下。
mv
The mv command performs both file moving and file renaming, depending on how it is used. In erther case,the original filename no longer exists after the operation. mv is used in much the same way as cp:
mv命令可執行文檔移動以及文檔重命名兩種任務,這依賴于如何使用它。任何一種情況下,在此操作之下原始文檔都將不再存在。mv命令使用方法同cp一樣:mv file1 file2
mv file1 file2 file3 code
rm
The rm command is used to remove(delete) files and directories:
rm命令用來刪除文檔或者目錄:rm file…
OptionsOptionmeaning-r –recursiverecursive operation
-f –forceforce operation
ln
The ln command is used to create either hard or symbolic links. It is used in one of two ways:
ln命令用來創建硬鏈接,也可以創建符號鏈接。可以用其中一種方法使用它:ln file link
to create a hard link, and:
創建硬鏈接,和:
to create a aymbolic link “item” is erther a file or a directory.
創建符號鏈接,“item”可以是一個文檔或是一個目錄。
hard link
Hard links are the original Unix way of creating links, compared to symbolic links, which are more modern. By default, every file has a single hard link that gives the file its name. When we create a hard link, we create an additional directory entry for a file. Hard links have two important limitations:
硬鏈接最初是Unix創建的一種鏈接方式,和符號鏈接比起來,而符號鏈接更加現代.在默認方式下,每個文檔有一個硬鏈接,這個硬鏈接就是文檔的別名。當我們創建一個硬鏈接時,我們也就為這個文檔創建一個額外的入口。硬鏈接有兩個重要的局限性:A hard link cannot reference a file outside its own file system. This means a link may not reference a file that is not on the same dis partition as the link itself.
A hard link may not reference a directory.
一個硬鏈接不能關聯一個它所在文檔系統之外的文檔。這是說一個鏈接不能關聯與鏈接本身不再同一個磁盤分區上的文檔。
一個硬鏈接不能關聯一個目錄。
symbolic link
Symbolic links were created to overcome the limitations of hard links. Symbolic links work by creating a special type of file that contains a text pointer to the referenced file or directory.In this regard, they operate in much the same way as a Windows shortcut though of course, they predate the Windows feature by many years.
符號鏈接的創建是為了克服硬鏈接的局限性。符號鏈接通過創建一個包含指向關聯的文檔或目錄的文本指針的特別的文檔類型來工作。在這一方面,他們和Windows的快捷方式差不多,當然,符號鏈接早于Windows的快捷方式很多年。
A file pointed to by a symbolic link, and the symbolic link itself are largely indistinguishable from one another. For example, if you write some something to symbolic link, the referenced file is also written to. However when you delete a symbolic link, only the link is deleted, not the file itself. If the file is deleted before the symbolic link, the link will continue to exist, but will point to nothing. In this case, the link is said to be broken. In many implementations, the ls command will display broken links in a distinguishing color, such as red, to reveal their presence.
一個符號鏈接指向一個文檔,而這個符號鏈接本身與其他的符號鏈接幾乎沒有區別。比如,如果你向一個符號鏈接里寫入一些東西,那么關聯的文檔也會被寫入。然而當你刪除一個符號鏈接時,僅僅這個鏈接被刪除,不會影響到文檔本身。如果這個文檔在符號鏈接之前被刪除了,這個鏈接將會繼續存在,但不會指向任何東西。這種情況下,這個鏈接被稱為壞鏈接。在許多實現中,ls命令會以可區分的顏色來顯示這些壞鏈接,比如紅色,來顯示他們的存在。
總結
以上是生活随笔為你收集整理的linux 文档操作,Linux学习之文档操作的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: linux ssh密钥对,Mac使用ss
- 下一篇: linux 命令 抛后台,在后台运行Li