mirror of
https://github.com/LCTT/TranslateProject.git
synced 2024-12-23 21:20:42 +08:00
Merge remote-tracking branch 'LCTT/master'
This commit is contained in:
commit
1b61f74673
@ -1,8 +1,8 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (geekpi)
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: reviewer: (wxy)
|
||||
[#]: publisher: (wxy)
|
||||
[#]: url: (https://linux.cn/article-11374-1.html)
|
||||
[#]: subject: (How to put an HTML page on the internet)
|
||||
[#]: via: (https://jvns.ca/blog/2019/09/06/how-to-put-an-html-page-on-the-internet/)
|
||||
[#]: author: (Julia Evans https://jvns.ca/)
|
||||
@ -10,19 +10,21 @@
|
||||
如何在互联网放置 HTML 页面
|
||||
======
|
||||
|
||||
![](https://img.linux.net.cn/data/attachment/album/201909/22/234957mmzoie1imufsuwea.jpg)
|
||||
|
||||
我喜欢互联网的一点是在互联网放置静态页面是如此简单。今天有人问我该怎么做,所以我想我会快速地写下来!
|
||||
|
||||
### 只是一个 HTML 页面
|
||||
|
||||
我的所有网站都只是静态 HTML 和 CSS。我的网页设计技巧相对不高(<https://wizardzines.com>是我自己开发的最复杂的网站),因此保持我所有的网站相对简单意味着我可以做一些改变/修复,而不会花费大量时间。
|
||||
我的所有网站都只是静态 HTML 和 CSS。我的网页设计技巧相对不高(<https://wizardzines.com> 是我自己开发的最复杂的网站),因此保持我所有的网站相对简单意味着我可以做一些改变/修复,而不会花费大量时间。
|
||||
|
||||
因此,我们将在此文章中采用尽可能简单的方式 - 只需一个 HTML 页面。
|
||||
因此,我们将在此文章中采用尽可能简单的方式 —— 只需一个 HTML 页面。
|
||||
|
||||
### HTML 页面
|
||||
|
||||
我们要放在互联网上的网站只是一个名为 `index.html` 的文件。你可以在 <https://github.com/jvns/website-example> 找到它,它是一个 Github 仓库,其中只包含一个文件。
|
||||
|
||||
HTML 文件中包含一些 CSS,使其看起来不那么无聊,部分复制自< https://example.com>。
|
||||
HTML 文件中包含一些 CSS,使其看起来不那么无聊,部分复制自 <https://example.com>。
|
||||
|
||||
### 如何将 HTML 页面放在互联网上
|
||||
|
||||
@ -32,22 +34,19 @@ HTML 文件中包含一些 CSS,使其看起来不那么无聊,部分复制
|
||||
2. 将 index.html 复制到你自己 neocities 站点的 index.html 中
|
||||
3. 完成
|
||||
|
||||
|
||||
|
||||
上面的 index.html 页面位于 [julia-example-website.neocities.com][2] 中,如果你查看源代码,你将看到它与 github 仓库中的 HTML 相同。
|
||||
上面的 `index.html` 页面位于 [julia-example-website.neocities.com][2] 中,如果你查看源代码,你将看到它与 github 仓库中的 HTML 相同。
|
||||
|
||||
我认为这可能是将 HTML 页面放在互联网上的最简单的方法(这是一次回归 Geocities,它是我在 2003 年制作我的第一个网站的方式):)。我也喜欢 Neocities (像 [glitch][3],我也喜欢)它能实验、学习,并有乐趣。
|
||||
|
||||
### 其他选择
|
||||
|
||||
这绝不是唯一简单的方式 - 在你推送 Git 仓库时,Github pages 和 Gitlab pages 以及 Netlify 都将会自动发布站点,并且它们都非常易于使用(只需将它们连接到你的 github 仓库即可)。我个人使用 Git 仓库的方式,因为 Git 没有东西让我感到紧张 - 我想知道我实际推送的页面发生了什么更改。但我想你如果第一次只想将 HTML/CSS 制作的站点放到互联网上,那么 Neocities 就是一个非常好的方法。
|
||||
|
||||
这绝不是唯一简单的方式,在你推送 Git 仓库时,Github pages 和 Gitlab pages 以及 Netlify 都将会自动发布站点,并且它们都非常易于使用(只需将它们连接到你的 GitHub 仓库即可)。我个人使用 Git 仓库的方式,因为 Git 不会让我感到紧张,我想知道我实际推送的页面发生了什么更改。但我想你如果第一次只想将 HTML/CSS 制作的站点放到互联网上,那么 Neocities 就是一个非常好的方法。
|
||||
|
||||
如果你不只是玩,而是要将网站用于真实用途,那么你或许会需要买一个域名,以便你将来可以更改托管服务提供商,但这有点不那么简单。
|
||||
|
||||
### 这是学习 HTML 的一个很好的起点
|
||||
|
||||
如果你熟悉在 Git 中编辑文件,同时想练习 HTML/CSS 的话,我认为将它放在网站中是一个有趣的方式!我真的很喜欢它的简单性 - 实际上这只有一个文件,所以没有其他花哨的东西需要去理解。
|
||||
如果你熟悉在 Git 中编辑文件,同时想练习 HTML/CSS 的话,我认为将它放在网站中是一个有趣的方式!我真的很喜欢它的简单性 —— 实际上这只有一个文件,所以没有其他花哨的东西需要去理解。
|
||||
|
||||
还有很多方法可以复杂化/扩展它,比如这个博客实际上是用 [Hugo][4] 生成的,它生成了一堆 HTML 文件并放在网络中,但从基础开始总是不错的。
|
||||
|
||||
@ -58,7 +57,7 @@ via: https://jvns.ca/blog/2019/09/06/how-to-put-an-html-page-on-the-internet/
|
||||
作者:[Julia Evans][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[geekpi](https://github.com/geekpi)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
校对:[wxy](https://github.com/wxy)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
@ -0,0 +1,55 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (Morisun029)
|
||||
[#]: reviewer: (wxy)
|
||||
[#]: publisher: (wxy)
|
||||
[#]: url: (https://linux.cn/article-11375-1.html)
|
||||
[#]: subject: (Microsoft brings IBM iron to Azure for on-premises migrations)
|
||||
[#]: via: (https://www.networkworld.com/article/3438904/microsoft-brings-ibm-iron-to-azure-for-on-premises-migrations.html)
|
||||
[#]: author: (Andy Patrizio https://www.networkworld.com/author/Andy-Patrizio/)
|
||||
|
||||
Skytap 和微软将 IBM 机器搬到了 Azure
|
||||
======
|
||||
|
||||
> 微软再次证明了其摒弃了“非我发明”这一态度来支持客户。
|
||||
|
||||
![](https://images.idgesg.net/images/article/2019/05/cso_microsoft_azure_backups_cloud_computing_binary_data_transfer_by_just_super_gettyimages-1003878434_3x2_2400x1600-100796537-large.jpg)
|
||||
|
||||
当微软将 Azure 作为其 Windows 服务器操作系统的云计算版本发布时,它并没有使其成为仅支持 Windows 系统的版本,它还支持 Linux 系统,并且在短短几年内[其 Linux 实例的数量现在已经超过了Windows 实例的数量][1]。
|
||||
|
||||
很高兴看到微软终于摆脱了这种长期以来非常有害的“非我发明”态度,该公司的最新举动确实令人惊讶。
|
||||
|
||||
微软与一家名为 Skytap 的公司合作,以在 Azure 云服务上提供 IBM Power9 实例,可以在 Azure 云内运行基于 Power 的系统,该系统将与其已有的 Xeon 和 Epyc 实例一同作为 Azure 的虚拟机(VM)。
|
||||
|
||||
Skytap 是一家有趣的公司。它由华盛顿大学的三位教授创立,专门研究本地遗留硬件的云迁移,如 IBM System I 或 Sparc 的云迁移。该公司在西雅图拥有一个数据中心,以 IBM 的硬件运行 IBM 的 PowerVM 管理程序,并且对在美国和英格兰的 IBM 数据中心提供主机托管。
|
||||
|
||||
该公司的座右铭是快速迁移,然后按照自己的节奏进行现代化。因此,它专注于帮助一些企业将遗留系统迁移到云,然后实现应用程序的现代化,这也是它与微软合作的目的。Azure 将通过为企业提供平台来提高传统应用程序的价值,而无需花费巨额费用重写一个新平台。
|
||||
|
||||
Skytap 提供了预览,可以看到使用 Skytap 上的 DB2 提升和扩展原有的 IBM i 应用程序以及通过 Azure 的物联网中心进行扩展时可能发生的情况。该应用程序无缝衔接新旧架构,并证明了不需要完全重写可靠的 IBM i 应用程序即可从现代云功能中受益。
|
||||
|
||||
### 迁移到 Azure
|
||||
|
||||
根据协议,微软将把 IBM 的 Power S922 服务器部署在一个未声明的 Azure 区域。这些机器可以运行 PowerVM 管理程序,这些管理程序支持老式 IBM 操作系统以及 Linux 系统。
|
||||
|
||||
Skytap 首席执行官<ruby>布拉德·希克<rt>Brad Schick</rt></ruby>在一份声明中说道:“通过先替换旧技术来迁移上云既耗时又冒险。……Skytap 的愿景一直是通过一些小小的改变和较低的风险实现企业系统到云平台的迁移。与微软合作,我们将为各种遗留应用程序迁移到 Azure 提供本地支持,包括那些在 IBM i、AIX 和 Power Linux 上运行的程序。这将使企业能够通过使用 Azure 服务进行现代化来延长传统系统的寿命并增加其价值。”
|
||||
|
||||
随着基于 Power 应用程序的现代化,Skytap 随后将引入 DevOps CI/CD 工具链来加快软件的交付。迁移到 Azure 的 Skytap 上后,客户将能够集成 Azure DevOps,以及 Power 的 CI/CD 工具链,例如 Eradani 和 UrbanCode。
|
||||
|
||||
这些听起来像是迈出了第一步,但这意味着以后将会实现更多,尤其是在应用程序迁移方面。如果它仅在一个 Azure 区域中,听起来好像它们正在对该项目进行测试和验证,并可能在今年晚些时候或明年进行扩展。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://www.networkworld.com/article/3438904/microsoft-brings-ibm-iron-to-azure-for-on-premises-migrations.html
|
||||
|
||||
作者:[Andy Patrizio][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[Morisun029](https://github.com/Morisun029)
|
||||
校对:[wxy](https://github.com/wxy)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://www.networkworld.com/author/Andy-Patrizio/
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://www.openwall.com/lists/oss-security/2019/06/27/7
|
||||
[2]: https://www.networkworld.com/article/3119362/hybrid-cloud/how-to-make-hybrid-cloud-work.html#tk.nww-fsb
|
||||
[3]: https://www.facebook.com/NetworkWorld/
|
||||
[4]: https://www.linkedin.com/company/network-world
|
@ -0,0 +1,58 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: ( )
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (Samsung introduces SSDs it claims will 'never die')
|
||||
[#]: via: (https://www.networkworld.com/article/3440026/samsung-introduces-ssds-it-claims-will-never-die.html)
|
||||
[#]: author: (Andy Patrizio https://www.networkworld.com/author/Andy-Patrizio/)
|
||||
|
||||
Samsung introduces SSDs it claims will 'never die'
|
||||
======
|
||||
New fail-in-place technology in Samsung's SSDs will allow the chips to gracefully recover from chip failure.
|
||||
Samsung
|
||||
|
||||
[Solid-state drives][1] (SSDs) operate by writing to cells within the chip, and after so many writes, the cell eventually dies off and can no longer be written to. For that reason, SSDs have more actual capacity than listed. A 1TB drive, for example, has about 1.2TB of capacity, and as chips die off from repeated writes, new ones are brought online to keep the 1TB capacity.
|
||||
|
||||
But that's for gradual wear. Sometimes SSDs just up and die completely, and without warning after a whole chip fails, not just a few cells. So Samsung is trying to address that with a new generation of SSD memory chips with a technology it calls fail-in-place (FIP).
|
||||
|
||||
**Also read: [Inside Hyperconvergence: Combining compute, storage and networking][2]**
|
||||
|
||||
FIP technology allows a drive to cope with a failure by working around the dead chip and allowing the SSD to keep operating and just not using the bad chip. You will have less storage, but in all likelihood that drive will be replaced anyway, so this helps prevent data loss.
|
||||
|
||||
FIP also scans the data for any damage before copying it to the remaining NAND, which would be the first time I've ever seen a SSD with built-in data recovery.
|
||||
|
||||
### Built-in virtualization and machine learning technology
|
||||
|
||||
The new Samsung SSDs come with two other software innovations. The first is built-in virtualization technology, which allows a single SSD to be divided up into up to 64 smaller drives for a virtual environment.
|
||||
|
||||
The second is V-NAND machine learning technology, which helps to "accurately predict and verify cell characteristics, as well as detect any variation among circuit patterns through big data analytics," as Samsung put it. Doing so means much higher levels of performance from the drive.
|
||||
|
||||
As you can imagine, this technology is aimed at enterprises and large-scale data centers, not consumers. All told, Samsung is launching 19 models of these new SSDs called under the names PM1733 and PM1735.
|
||||
|
||||
**[ [Get certified as an Apple Technical Coordinator with this seven-part online course from PluralSight.][3] ]**
|
||||
|
||||
The PM1733 line features six models in a 2.5-inch U.2 form factor, offering storage capacity of between 960GB and 15.63TB, as well as four HHHL card-type drives with capacity ranging from 1.92TB to 30.72TB of storage. Each drive is guaranteed for one drive writes per day (DWPD) for five years. In other words, the warranty is good for writing the equivalent of the drive's total capacity once per day every day for five years.
|
||||
|
||||
The PM1735 drives have lower capacity, maxing out at 12.8TB, but they are far more durable, guaranteeing three DWPD for five years. Both drives support PCI Express 4, which has double the throughput of the widely used PCI Express 3. The PM1735 offers nearly 14 times the sequential performance of a SATA-based SSD, with 8GB/s for read operations and 3.8GB/s for writes.
|
||||
|
||||
Join the Network World communities on [Facebook][4] and [LinkedIn][5] to comment on topics that are top of mind.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://www.networkworld.com/article/3440026/samsung-introduces-ssds-it-claims-will-never-die.html
|
||||
|
||||
作者:[Andy Patrizio][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://www.networkworld.com/author/Andy-Patrizio/
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://www.networkworld.com/article/3326058/what-is-an-ssd.html
|
||||
[2]: https://www.idginsiderpro.com/article/3409019/inside-hyperconvergence-combining-compute-storage-and-networking.html
|
||||
[3]: https://pluralsight.pxf.io/c/321564/424552/7490?u=https%3A%2F%2Fwww.pluralsight.com%2Fpaths%2Fapple-certified-technical-trainer-10-11
|
||||
[4]: https://www.facebook.com/NetworkWorld/
|
||||
[5]: https://www.linkedin.com/company/network-world
|
79
sources/talk/20190921 How spicy should a jalapeno be.md
Normal file
79
sources/talk/20190921 How spicy should a jalapeno be.md
Normal file
@ -0,0 +1,79 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: ( )
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (How spicy should a jalapeno be?)
|
||||
[#]: via: (https://opensource.com/article/19/9/how-spicy-should-jalapeno-be)
|
||||
[#]: author: (Peter Webb https://opensource.com/users/peterwebbhttps://opensource.com/users/mgifford)
|
||||
|
||||
How spicy should a jalapeno be?
|
||||
======
|
||||
Open source agriculture engages students in becoming problem solvers for
|
||||
the future.
|
||||
![Jalapenos][1]
|
||||
|
||||
Everyone has opinions and preferences, especially when it comes to food. To establish a criterion when answering "How spicy should a jalapeño be?." the Scoville Heat Scale was developed as a standard to measure spiciness. This scale allows people to communicate and share information about how spicy we like our peppers.
|
||||
|
||||
Similarly, open source technology standards, such as USB, I2C, MQTT, and others, were developed to enable global compatibility. Furthermore, open source hardware platforms have enabled communities to “speak the same language” without reinventing the wheel. For example, Raspberry Pi makes it easy for people to use their hardware as a baseline and then add onto it. This has created a revolution in many industries by enabling individuals, startups, and large corporations to apply hardware and software to complex problems without having to design them from the ground up.
|
||||
|
||||
### MARSfarm: Using food to engage students in STEM
|
||||
|
||||
[MARSfarm][2] is a program that aims to increase students’ engagement with science, technology, engineering, and math (STEM) by relating agriculture to real-life problems, such as growing more food with fewer resources.
|
||||
|
||||
MARSfarm’s goal is to provide [engaging material to inspire individuals and students][3] to collaborate on solving big problems, like how we can sustainably survive on another planet, while simultaneously improving the food system here on our own planet. We do this by tying together the world of food and technology and enabling users to choose things like how spicy they want the jalapeño they are growing to be. More importantly, we want to alter other compounds besides spiciness (known as capsaicin by chemists), like Vitamin K, which is a concern for those who lack access to fresh fruits and vegetables, such as an astronaut living on Mars. With standardized open source hardware and software as a base, a user can focus on whatever unique objectives they have for their own “garden” while retaining the benefits of a larger community.
|
||||
|
||||
### The importance of open source and standards
|
||||
|
||||
When trying to define standards with food, there is no “right” answer. Food is very personal and influenced by socioeconomic factors as well as (perhaps most importantly) geographical region.
|
||||
|
||||
We designed MARSfarm using open source principles to allow teachers to customize and add to the hardware and software in their classrooms. To make it more familiar and approachable, we tried to leverage existing standardized software and hardware platforms. By sticking with common software languages like Python and HTML and hardware like the Raspberry Pi, we reduce the potential barriers to entry for users who could be intimidated by a project of this magnitude. Other hardware we use, like PVC, Mylar, and full-spectrum LEDs, are globally accessible from brick-and-mortar storefronts and online retailers that adhere to industry standards to ensure consistency throughout the community.
|
||||
|
||||
By keeping our hardware and software standard, we can also create a marketplace where users can exchange “recipes” for growing food. Similar to how [Thingverse][4] has enabled anyone with a 3D printer to make just about anything—without having to be an engineer—simply by exchanging CAD files, we want to enable our users to find climate recipes from around the world and grow them—without having to be a botanist. The way to achieve this is by having a large number of people growing the same plant but with different climate factors. The more data that is aggregated, the better we’ll understand how different climate factors affect things like taste and the time it takes a plant to grow.
|
||||
|
||||
We also enlisted the support of open source agricultural projects like the [Open Agriculture Initiative][5] at the MIT Media Lab, where we’ve found many other individuals passionate about applying technology to optimize food. Another consistent source of innovation in agriculture has been NASA, which has achieved [record harvests and been a point of collaboration][6] between universities and countries for decades.
|
||||
|
||||
### Building a _food computer_
|
||||
|
||||
Open source communities thrive when they’re applied to something both significant and personal. There is perhaps nothing more personal than the food we consume, the literal fuel that powers us.
|
||||
|
||||
Until very recently, even within the last decade, many plants could not be grown in certain regions due to lack of available light, which is the most fundamental input a plant requires for its most basic process, photosynthesis. With the advent of technologies like LEDs, organizations (other than NASA) can afford to grow just about anything, anywhere, within the bounds of what the market demands and will pay for.
|
||||
|
||||
As we continue living far away from where our food is produced, we continue to understand it less and less. When we forget our personal connection to food, we risk damaging not only our health but our communities and the planet where our species lives. To mitigate this risk, MARSfarm leads projects like the [$300 Food Computer][7], which makes indoor growing systems more affordable and accessible. These types of projects also put more of this technology in more classrooms. The more that individuals and students work with these projects, the more data we’ll have, and the better we will understand the best ways to grow our food.
|
||||
|
||||
In fact, the improvement in lighting technology has been so dramatic that consumer products like [Aerogarden][8] have empowered thousands of individuals to grow edible plants at home, not only on their windowsills but on their countertops where there is no access to natural light.
|
||||
|
||||
Because of these leaps in technology, we’re developing a world where there are “libraries” of plants that can be “forked” onto devices to be grown by anyone. If you’d like to get started, please to visit our [GitHub][9] where we host software for all of our ongoing projects.
|
||||
|
||||
### Help spread the word
|
||||
|
||||
We need your help to expose as many students as possible to the wonders of applying open source technology to agriculture. Please share this with at least one teacher you know and any students who have a passion for STEM. MARSfarm is actively working with open source contributors, recruiting employees, and conducting beta tests in schools.
|
||||
|
||||
* * *
|
||||
|
||||
_For more information about what the farmers of tomorrow are doing with open tools and principles today, watch the video [Farming for the Future][3]._
|
||||
|
||||
Co-authored by John Whitehead . For many people spring means a return to the bounty of fresh, local...
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/19/9/how-spicy-should-jalapeno-be
|
||||
|
||||
作者:[Peter Webb][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://opensource.com/users/peterwebbhttps://opensource.com/users/mgifford
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/jalepeno.jpg?itok=R_LWPTlm (Jalapenos)
|
||||
[2]: https://marsfarm.io/
|
||||
[3]: https://www.redhat.com/en/open-source-stories/farming-for-the-future
|
||||
[4]: https://www.thingiverse.com/
|
||||
[5]: https://forum.openag.media.mit.edu/
|
||||
[6]: https://ntrs.nasa.gov/archive/nasa/casi.ntrs.nasa.gov/20150015991.pdf
|
||||
[7]: https://marsfarm.io/home/community/mvp-food-computer/
|
||||
[8]: https://www.aerogarden.com/
|
||||
[9]: https://github.com/futureag
|
@ -1,103 +0,0 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (geekpi)
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (How to freeze and lock your Linux system (and why you would want to))
|
||||
[#]: via: (https://www.networkworld.com/article/3438818/how-to-freeze-and-lock-your-linux-system-and-why-you-would-want-to.html)
|
||||
[#]: author: (Sandra Henry-Stocker https://www.networkworld.com/author/Sandra-Henry_Stocker/)
|
||||
|
||||
How to freeze and lock your Linux system (and why you would want to)
|
||||
======
|
||||
What it means to freeze a terminal window and lock a screen -- and how to manage these activities on your Linux system.
|
||||
Sandra Henry-Stocker
|
||||
|
||||
How you freeze and "thaw out" a screen on a Linux system depends a lot on what you mean by these terms. Sometimes “freezing a screen” might mean freezing a terminal window so that activity within that window comes to a halt. Sometimes it means locking your screen so that no one can walk up to your system when you're fetching another cup of coffee and type commands on your behalf.
|
||||
|
||||
In this post, we'll examine how you can use and control these actions.
|
||||
|
||||
**[ Two-Minute Linux Tips: [Learn how to master a host of Linux commands in these 2-minute video tutorials][1] ]**
|
||||
|
||||
### How to freeze a terminal window on Linux
|
||||
|
||||
You can freeze a terminal window on a Linux system by typing **Ctrl+S** (hold control key and press "s"). Think of the "s" as meaning "start the freeze". If you continue typing commands after doing this, you won't see the commands you type or the output you would expect to see. In fact, the commands will pile up in a queue and will be run only when you reverse the freeze by typing **Ctrl+Q**. Think of this as "quit the freeze".
|
||||
|
||||
One easy way to view how this works is to use the date command and then type **Ctrl+S**. Then type the date command again and wait a few minutes before typing **Ctrl+Q**. You'll see something like this:
|
||||
|
||||
```
|
||||
$ date
|
||||
Mon 16 Sep 2019 06:47:34 PM EDT
|
||||
$ date
|
||||
Mon 16 Sep 2019 06:49:49 PM EDT
|
||||
```
|
||||
|
||||
The gap between the two times shown will indicate that the second date command wasn't run until you unfroze your window.
|
||||
|
||||
Terminal windows can be frozen and unfrozen whether you're sitting at the computer screen or running remotely using a tool such as PuTTY.
|
||||
|
||||
And here's a little trick that can come in handy. If you see that a terminal window appears to be inactive, one possibility is that you or someone else inadvertently typed **Ctrl+S**. In any case, entering **Ctrl+Q** just in case this resolves the problem is not a bad idea.
|
||||
|
||||
### How to lock your screen
|
||||
|
||||
To lock your screen before you leave your desk, either **Ctrl+Alt+L** or **Super+L** (i.e., holding down the Windows key and pressing L) should work. Once your screen is locked, you will have to enter your password to log back in.
|
||||
|
||||
### Automatic screen locking on Linux systems
|
||||
|
||||
While best practice suggests that you lock your screen whenever you are about to leave your desk, Linux systems usually automatically lock after a period of no activity. The timing for "blanking" a screen (making it go dark) and actually locking the screen (requiring a login to use it again) depend on settings that you can set to your personal preferences.
|
||||
|
||||
To change how long it takes for your screen to go dark when using GNOME screensaver, open your settings window and select **Power** and then **Blank screen**. You can choose times between 1 and 15 minutes or never. To select how long after the blanking the screen locks, go to settings, select **Privacy** and then **Blank screen.** Settings should include 1, 2, 3, 5 and 30 minutes or one hour.
|
||||
|
||||
### How to lock your screen from the command line
|
||||
|
||||
If you are using Gnome screensaver, you can also lock the screen from the command line using this command:
|
||||
|
||||
```
|
||||
gnome-screensaver-command -l
|
||||
```
|
||||
|
||||
That's a lowercase L for "lock".
|
||||
|
||||
### How to check your lockscreen state
|
||||
|
||||
You can also use the gnome screensaver command to check whether your screen is locked,. With the **\--query** option, the command tells you whether screen is currently locked (i.e., active). With the --time option, it tells you how long the lock has been in effect. Here's an sample sctipt:
|
||||
|
||||
```
|
||||
#!/bin/bash
|
||||
|
||||
gnome-screensaver-command --query
|
||||
gnome-screensaver-command --time
|
||||
```
|
||||
|
||||
Running the script will show output like this:
|
||||
|
||||
```
|
||||
$ ./check_lockscreen
|
||||
The screensaver is active
|
||||
The screensaver has been active for 1013 seconds.
|
||||
```
|
||||
|
||||
#### Wrap-up
|
||||
|
||||
Freezing your terminal window is easy if you remember the proper control sequences. For screen locking, how well it works depends on the controls you put in place for yourself or whether you're comfortable working with the defaults.
|
||||
|
||||
**[ Also see: [Invaluable tips and tricks for troubleshooting Linux][2] ]**
|
||||
|
||||
Join the Network World communities on [Facebook][3] and [LinkedIn][4] to comment on topics that are top of mind.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://www.networkworld.com/article/3438818/how-to-freeze-and-lock-your-linux-system-and-why-you-would-want-to.html
|
||||
|
||||
作者:[Sandra Henry-Stocker][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://www.networkworld.com/author/Sandra-Henry_Stocker/
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://www.youtube.com/playlist?list=PL7D2RMSmRO9J8OTpjFECi8DJiTQdd4hua
|
||||
[2]: https://www.networkworld.com/article/3242170/linux/invaluable-tips-and-tricks-for-troubleshooting-linux.html
|
||||
[3]: https://www.facebook.com/NetworkWorld/
|
||||
[4]: https://www.linkedin.com/company/network-world
|
@ -1,5 +1,5 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: ( )
|
||||
[#]: translator: (geekpi)
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
|
@ -1,142 +0,0 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: ( )
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (How to Remove (Delete) Symbolic Links in Linux)
|
||||
[#]: via: (https://www.2daygeek.com/remove-delete-symbolic-link-softlink-linux/)
|
||||
[#]: author: (Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/)
|
||||
|
||||
How to Remove (Delete) Symbolic Links in Linux
|
||||
======
|
||||
|
||||
You may have the opportunity to create or remove symbolic links on Linux.
|
||||
|
||||
If yes, do you know how to do it?
|
||||
|
||||
Have you already done that? Are you aware of that?
|
||||
|
||||
If yes then there is no problem. If not, don’t worry, we are here to help you with this.
|
||||
|
||||
This can be done using the rm and unlink commands.
|
||||
|
||||
### What is Symbolic Link?
|
||||
|
||||
A symbolic link, also known as a symlink or soft link, is a special type of file that points to another file or directory in Linux.
|
||||
|
||||
It’s similar to a shortcut in Windows.
|
||||
|
||||
It can point to a file or a directory on the same or a different filesystem or partition.
|
||||
|
||||
In general Symbolic links are used to link libraries. Also, used to link log files and folders on mounted NFS (Network File System) shares.
|
||||
|
||||
### What is rm Command?
|
||||
|
||||
The **[rm command][1]** is used to remove files or directories. This is very dangerous and be cautious every time you use the rm command.
|
||||
|
||||
### What is unlink Command?
|
||||
|
||||
The unlink command is used to remove the specified file. It is already installed as it is part of the GNU Gorutils.
|
||||
|
||||
### 1) How to Remove Symbolic Link Files Using the rm Command
|
||||
|
||||
The rm command is one of the most frequently used commands in Linux. Furthermore, it allows us to remove the symbolic links as described below.
|
||||
|
||||
```
|
||||
# rm symlinkfile
|
||||
```
|
||||
|
||||
Always use the rm command with the “-i” switch to understand what is being done.
|
||||
|
||||
```
|
||||
# rm -i symlinkfile1
|
||||
rm: remove symbolic link ‘symlinkfile1’? y
|
||||
```
|
||||
|
||||
It also allows us to remove multiple symbolic links at once.
|
||||
|
||||
```
|
||||
# rm -i symlinkfile2 symlinkfile3
|
||||
|
||||
rm: remove symbolic link ‘symlinkfile2’? y
|
||||
rm: remove symbolic link ‘symlinkfile3’? y
|
||||
```
|
||||
|
||||
### 1a) How to Remove Symbolic Link Directories Using the rm Command
|
||||
|
||||
This is like removing a symbolic link file.
|
||||
|
||||
Use the below command to remove Symbolic Link directory.
|
||||
|
||||
```
|
||||
# rm -i symlinkdir
|
||||
|
||||
rm: remove symbolic link ‘symlinkdir’? y
|
||||
```
|
||||
|
||||
Use the below command to remove multiple Symbolic Link directory.
|
||||
|
||||
```
|
||||
# rm -i symlinkdir1 symlinkdir2
|
||||
|
||||
rm: remove symbolic link ‘symlinkdir1’? y
|
||||
rm: remove symbolic link ‘symlinkdir2’? y
|
||||
```
|
||||
|
||||
If you add _**“/”**_ trailing slash at the end, the symbolic link directory cannot be deleted. If you add, you get an error.
|
||||
|
||||
```
|
||||
# rm -i symlinkdir/
|
||||
|
||||
rm: cannot remove ‘symlinkdir/’: Is a directory
|
||||
```
|
||||
|
||||
You may need to add the **“-r”** switch to deal with the above problem. If you add this, it will delete the contents of the target directory, while it will not delete the symbolic link directory.
|
||||
|
||||
```
|
||||
# rm -ri symlinkdir/
|
||||
|
||||
rm: descend into directory ‘symlinkdir/’? y
|
||||
rm: remove regular file ‘symlinkdir/file4.txt’? y
|
||||
rm: remove directory ‘symlinkdir/’? y
|
||||
rm: cannot remove ‘symlinkdir/’: Not a directory
|
||||
```
|
||||
|
||||
### 2) How to Remove Symbolic Links Using the unlink Command
|
||||
|
||||
The unlink command deletes a given file. It accepts only a single file at a time.
|
||||
|
||||
To delete symbolic link file
|
||||
|
||||
```
|
||||
# unlink symlinkfile
|
||||
```
|
||||
|
||||
To delete symbolic link directory
|
||||
|
||||
```
|
||||
# unlink symlinkdir2
|
||||
```
|
||||
|
||||
If you append the _**“/”**_ trailing slash at the end, you cannot remove the symbolic link directory using the unlink command.
|
||||
|
||||
```
|
||||
# unlink symlinkdir3/
|
||||
|
||||
unlink: cannot unlink ‘symlinkdir3/’: Not a directory
|
||||
```
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://www.2daygeek.com/remove-delete-symbolic-link-softlink-linux/
|
||||
|
||||
作者:[Magesh Maruthamuthu][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://www.2daygeek.com/author/magesh/
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://www.2daygeek.com/linux-remove-files-directories-folders-rm-command/
|
@ -1,57 +0,0 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (Morisun029)
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (Microsoft brings IBM iron to Azure for on-premises migrations)
|
||||
[#]: via: (https://www.networkworld.com/article/3438904/microsoft-brings-ibm-iron-to-azure-for-on-premises-migrations.html)
|
||||
[#]: author: (Andy Patrizio https://www.networkworld.com/author/Andy-Patrizio/)
|
||||
|
||||
微软将 IBM 大型机迁移至 Azure
|
||||
======
|
||||
微软再次证明了其摒弃“非我发明”这一态度来支持客户。
|
||||
微软/ Just_Super / 盖蒂图片社
|
||||
|
||||
当微软将 Azure 作为其 Windows 操作系统基于云计算的版本发布时,它并没有使其成为仅支持 Windows 系统的版本。 它还支持 Linux 系统,并且在短短几年内 [Linux 实例的数量现在已经超过了Windows 实例的数量][1].
|
||||
|
||||
很高兴看到微软终于摆脱了这种长期以来非常有害的“非我发明”态度,该公司的最新举动确实令人惊讶。
|
||||
|
||||
微软与一家名为 Skytap 的公司合作,为 Azure 上的 IBM Power9 处理器提供在 Azure 内部运行的基于 Power的系统,该系统将与其已经提供的 Xeon 和 Epy c服务器共同作为 Azure 的虚拟机(VM)。
|
||||
|
||||
|
||||
**推荐阅读: [如何使混合云工作][2]**
|
||||
|
||||
Skytap 是一家有趣的公司。它由华盛顿大学的三位教授创立,专门研究旧式本地硬件的云迁移,如 IBM I 或 Sparc处理器的云迁移。该公司在其家乡西雅图拥有一个数据中心,以 IBM 的硬件运行IBM 的 Power 虚拟机管理程序,并且对在美国和英格兰的IBM 数据中心提供主机托管。
|
||||
|
||||
该公司的座右铭是快速迁移,然后按照自己的节奏进行现代化。因此,它专注于帮助一些企业将数据源系统迁移到云,然后实现应用程序的现代化,这也是它与微软合作的目的。 Azure 将通过为企业提供平台来提高传统应用程序的价值,而无需花费巨额费用重写一个新平台。
|
||||
|
||||
Skytap 可以预览在 Skytap 上使用 DB2 提升和扩展原有 IBM i 应用程序以及通过 Azure 的物联网中心进行扩充时可能发生的情况。该应用程序无缝衔接新旧架构,并正明了不需要完全重写可靠的 IBM i 应用程序即可从现代云功能中受益。
|
||||
|
||||
|
||||
### 迁移到 Azure
|
||||
|
||||
根据协议,微软将把IBM 的Power S922 服务器部署在未声明的 Azure 区域。 这些机器可以运行 Power 虚拟机的管理程序,这些管理程序支持原有IBM 操作系统以及 Linux 系统。
|
||||
|
||||
Skytap 首席执行官布拉德•希克(Brad Schick)在一份声明中说道:“ 通过先替换旧技术到云上既耗时又冒险。” “ Skytap的愿景一直是通过一些小小的改变和较低的风险实现企业系统到云平台的迁移。与微软合作,我们将为各种旧版应用程序迁移到 Azure 提供本地支持,包括那些在 IBM i,AIX 和 Linux Power 上运行的程序。这将使企业能够通过使用 Azure 服务进行现代化来延长传统系统的寿命并增加其价值。”
|
||||
|
||||
随着基于 Power 应用程序的现代化,Skytap 随后将引入开发运维持续集成/持续交付工具链来加快软件的交付。 迁移到 Azure 上后,客户将能够集成 Azure 的开发运维,以及 Power 的持续集成/持续交付工具链,例如 Eradani 和 UrbanCode。
|
||||
|
||||
这些听起来像是迈出了第一步,但这意味着以后将会实现更多,尤其是在应用程序迁移方面。如果仅在一个 Azure 区域中,听起来好像它们正在对该项目进行测试和验证,并可能在今年晚些时候或明年进行扩展。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://www.networkworld.com/article/3438904/microsoft-brings-ibm-iron-to-azure-for-on-premises-migrations.html
|
||||
|
||||
作者:[Andy Patrizio][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[Morisun029](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://www.networkworld.com/author/Andy-Patrizio/
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://www.openwall.com/lists/oss-security/2019/06/27/7
|
||||
[2]: https://www.networkworld.com/article/3119362/hybrid-cloud/how-to-make-hybrid-cloud-work.html#tk.nww-fsb
|
||||
[3]: https://www.facebook.com/NetworkWorld/
|
||||
[4]: https://www.linkedin.com/company/network-world
|
@ -0,0 +1,96 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (geekpi)
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (How to freeze and lock your Linux system (and why you would want to))
|
||||
[#]: via: (https://www.networkworld.com/article/3438818/how-to-freeze-and-lock-your-linux-system-and-why-you-would-want-to.html)
|
||||
[#]: author: (Sandra Henry-Stocker https://www.networkworld.com/author/Sandra-Henry_Stocker/)
|
||||
|
||||
如何冻结和锁定你的 Linux 系统(以及为何你会希望做)
|
||||
======
|
||||
冻结终端窗口并锁定屏幕意味着什么 - 以及如何在 Linux 系统上管理这些活动。
|
||||
|
||||
如何在 Linux 系统上冻结和“解冻”屏幕,很大程度上取决于这些术语的含义。有时“冻结屏幕”可能意味着冻结终端窗口,以便该窗口内的活动停止。有时它意味着锁定屏幕,这样就没人可以在你去拿一杯咖啡时,走到你的系统旁边代替你输入命令了。
|
||||
|
||||
在这篇文章中,我们将研究如何使用和控制这些操作。
|
||||
|
||||
### 如何在 Linux 上冻结终端窗口
|
||||
|
||||
你可以输入 **Ctrl+S**(按住 Ctrl 键和 “s” 键)冻结 Linux 系统上的终端窗口。把 “s” 想象成“开始冻结” (start the freeze)。如果在此操作后继续输入命令,那么你不会看到输入的命令或你希望看到的输出。实际上,命令将堆积在一个队列中,并且只有在通过输入 **Ctrl+Q** 解冻时才会运行。把它想象成“退出冻结” (quit the freeze)。
|
||||
|
||||
查看其工作的一种简单方式是使用 date 命令,然后输入 **Ctrl+S**。接着再次输入 date 命令并等待几分钟后再次输入 **Ctrl+Q**。你会看到这样的情景:
|
||||
|
||||
```
|
||||
$ date
|
||||
Mon 16 Sep 2019 06:47:34 PM EDT
|
||||
$ date
|
||||
Mon 16 Sep 2019 06:49:49 PM EDT
|
||||
```
|
||||
|
||||
这两次时间显示的差距表示第二次的 date 命令直到你解冻窗口时才运行。
|
||||
|
||||
无论你是坐在计算机屏幕前还是使用 PuTTY 等工具远程运行,终端窗口都可以冻结和解冻。
|
||||
|
||||
这有一个可以派上用场的小技巧。如果你发现终端窗口似乎处于非活动状态,那么可能是你或其他人无意中输入了 **Ctrl+S**。无论如何,输入 **Ctrl+Q** 来尝试解决不妨是个不错的办法。
|
||||
|
||||
### 如何锁定屏幕
|
||||
|
||||
要在离开办公桌前锁定屏幕,请按住 **Ctrl+Alt+L** 或 **Super+L**(即按住 Windows 键和 L 键)。屏幕锁定后,你必须输入密码才能重新登录。
|
||||
|
||||
### Linux 系统上的自动屏幕锁定
|
||||
|
||||
虽然最佳做法建议你在即将离开办公桌时锁定屏幕,但 Linux 系统通常会在一段时间没有活动后自动锁定。 “消隐”屏幕(使其变暗)并实际锁定屏幕(需要登录才能再次使用)的时间取决于你个人首选项中的设置。
|
||||
|
||||
要更改使用 GNOME 屏幕保护程序时屏幕变暗所需的时间,请打开设置窗口并选择 **Power** 然后 **Blank screen**。你可以选择 1 到 15 分钟或从不变暗。要选择屏幕变暗后锁定所需时间,请进入设置,选择 **Privacy**,然后选择**Blank screen**。设置应包括 1、2、3、5 和 30 分钟或一小时。
|
||||
|
||||
### 如何在命令行锁定屏幕
|
||||
|
||||
如果你使用的是 Gnome 屏幕保护程序,你还可以使用以下命令从命令行锁定屏幕:
|
||||
|
||||
```
|
||||
gnome-screensaver-command -l
|
||||
```
|
||||
|
||||
这里是小写的 L,代表“锁定”。
|
||||
|
||||
### 如何检查锁屏状态
|
||||
|
||||
你还可以使用 gnome-screensaver 命令检查屏幕是否已锁定。使用 **\--query** 选项,该命令会告诉你屏幕当前是否已锁定(即处于活动状态)。使用 --time 选项,它会告诉你锁定生效的时间。这是一个示例脚本:
|
||||
|
||||
```
|
||||
#!/bin/bash
|
||||
|
||||
gnome-screensaver-command --query
|
||||
gnome-screensaver-command --time
|
||||
```
|
||||
|
||||
运行脚本将会输出:
|
||||
|
||||
```
|
||||
$ ./check_lockscreen
|
||||
The screensaver is active
|
||||
The screensaver has been active for 1013 seconds.
|
||||
```
|
||||
|
||||
#### 总结
|
||||
|
||||
如果你记住了正确的控制方式,那么锁定终端窗口是很简单的。对于屏幕锁定,它的效果取决于你自己的设置,或者你是否习惯使用默认设置。
|
||||
|
||||
在 [Facebook][3] 和 [LinkedIn][4] 上加入 Network World 社区,来评论最新主题。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://www.networkworld.com/article/3438818/how-to-freeze-and-lock-your-linux-system-and-why-you-would-want-to.html
|
||||
|
||||
作者:[Sandra Henry-Stocker][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[geekpi](https://github.com/geekpi)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://www.networkworld.com/author/Sandra-Henry_Stocker/
|
||||
[b]: https://github.com/lujun9972
|
||||
[3]: https://www.facebook.com/NetworkWorld/
|
||||
[4]: https://www.linkedin.com/company/network-world
|
@ -0,0 +1,142 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (arrowfeng)
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (How to Remove (Delete) Symbolic Links in Linux)
|
||||
[#]: via: (https://www.2daygeek.com/remove-delete-symbolic-link-softlink-linux/)
|
||||
[#]: author: (Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/)
|
||||
|
||||
在 Linux 中怎样移除(删除)符号链接
|
||||
======
|
||||
|
||||
你可能有时需要在 Linux 上创建或者删除符号链接。
|
||||
|
||||
如果有,你知道该怎样做吗?
|
||||
|
||||
之前你做过吗?你踩坑没有?
|
||||
|
||||
如果你踩过坑,那没什么问题。如果还没有,别担心,我们将在这里帮助你。
|
||||
|
||||
使用 rm 和 unlink 命令就能完成移除(删除)符号链接的操作。
|
||||
|
||||
### 什么是符号链接?
|
||||
|
||||
符号链接又称 symlink 或者 软链接,它是一种特殊的文件类型,在 Linux 中该文件指向另一个文件或者目录。
|
||||
|
||||
它类似于 Windows 中的快捷方式。
|
||||
|
||||
它能在相同或者不同的文件系统或分区中指向一个文件或着目录。
|
||||
|
||||
符号链接通常用来链接库文件。它也可用于链接日志文件和在 NFS (网络文件系统)上的文件夹。
|
||||
|
||||
### 什么是 rm 命令?
|
||||
|
||||
这个 **[rm command][1]** 被用来移除文件和目录。它非常危险,你每次使用 rm 命令的时候要非常小心。
|
||||
|
||||
### 什么是 unlink 命令?
|
||||
|
||||
unlink 命令被用来移除特殊的文件。它被作为 GNU Gorutils 的一部分安装了。
|
||||
|
||||
### 1) 使用 rm 命令怎样移除符号链接文件
|
||||
|
||||
rm 命令是在 Linux 中使用最频繁的命令,它允许我们像下列描述那样去移除符号链接。
|
||||
|
||||
```
|
||||
# rm symlinkfile
|
||||
```
|
||||
|
||||
始终将 rm 命令与 “-i” 一起使用以了解正在执行的操作。
|
||||
|
||||
```
|
||||
# rm -i symlinkfile1
|
||||
rm: remove symbolic link ‘symlinkfile1’? y
|
||||
```
|
||||
|
||||
它允许我们一次移除多个符号链接
|
||||
|
||||
```
|
||||
# rm -i symlinkfile2 symlinkfile3
|
||||
|
||||
rm: remove symbolic link ‘symlinkfile2’? y
|
||||
rm: remove symbolic link ‘symlinkfile3’? y
|
||||
```
|
||||
|
||||
### 1a) 使用 rm 命令怎样移除符号链接目录
|
||||
|
||||
这像移除符号链接文件那样。
|
||||
|
||||
使用下列命令移除符号链接目录。
|
||||
|
||||
```
|
||||
# rm -i symlinkdir
|
||||
|
||||
rm: remove symbolic link ‘symlinkdir’? y
|
||||
```
|
||||
|
||||
使用下列命令移除多个符号链接目录。
|
||||
|
||||
```
|
||||
# rm -i symlinkdir1 symlinkdir2
|
||||
|
||||
rm: remove symbolic link ‘symlinkdir1’? y
|
||||
rm: remove symbolic link ‘symlinkdir2’? y
|
||||
```
|
||||
|
||||
如果你增加 _**“/”**_ 在结尾,这个符号链接目录将不会被删除。如果你加了,你将得到一个错误。
|
||||
|
||||
```
|
||||
# rm -i symlinkdir/
|
||||
|
||||
rm: cannot remove ‘symlinkdir/’: Is a directory
|
||||
```
|
||||
|
||||
你可以增加 **“-r”** 去处理上述问题。如果你增加这个参数,它将会删除目标目录下的内容,并且它不会删除这个符号链接文件。
|
||||
|
||||
```
|
||||
# rm -ri symlinkdir/
|
||||
|
||||
rm: descend into directory ‘symlinkdir/’? y
|
||||
rm: remove regular file ‘symlinkdir/file4.txt’? y
|
||||
rm: remove directory ‘symlinkdir/’? y
|
||||
rm: cannot remove ‘symlinkdir/’: Not a directory
|
||||
```
|
||||
|
||||
### 2) 使用 unlink 命令怎样移除符号链接
|
||||
|
||||
unlink 命令删除指定文件。它一次仅接受一个文件。
|
||||
|
||||
删除符号链接文件
|
||||
|
||||
```
|
||||
# unlink symlinkfile
|
||||
```
|
||||
|
||||
删除符号链接目录
|
||||
|
||||
```
|
||||
# unlink symlinkdir2
|
||||
```
|
||||
|
||||
如果你增加 _**“/”**_ 在结尾,你不能使用 unlink 命令删除符号链接目录
|
||||
|
||||
```
|
||||
# unlink symlinkdir3/
|
||||
|
||||
unlink: cannot unlink ‘symlinkdir3/’: Not a directory
|
||||
```
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://www.2daygeek.com/remove-delete-symbolic-link-softlink-linux/
|
||||
|
||||
作者:[Magesh Maruthamuthu][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[arrowfeng](https://github.com/arrowfeng)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://www.2daygeek.com/author/magesh/
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://www.2daygeek.com/linux-remove-files-directories-folders-rm-command/
|
Loading…
Reference in New Issue
Block a user