mirror of
https://github.com/LCTT/TranslateProject.git
synced 2024-12-26 21:30:55 +08:00
Merge branch 'master' of https://github.com/LCTT/TranslateProject into translating
This commit is contained in:
commit
f237fb1260
@ -1,39 +1,40 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (geekpi)
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: reviewer: (wxy)
|
||||
[#]: publisher: (wxy)
|
||||
[#]: url: (https://linux.cn/article-12552-1.html)
|
||||
[#]: subject: (Microsoft uses AI to boost its reuse, recycling of server parts)
|
||||
[#]: via: (https://www.networkworld.com/article/3570451/microsoft-uses-ai-to-boost-its-reuse-recycling-of-server-parts.html)
|
||||
[#]: author: (Andy Patrizio https://www.networkworld.com/author/Andy-Patrizio/)
|
||||
|
||||
微软利用 AI 提升服务器部件的重复使用和回收
|
||||
微软利用 AI 提升服务器部件的重复使用和回收率
|
||||
======
|
||||
准备好在提到数据中心设备时,听到更多的"循环"一词。
|
||||
|
||||
> 准备好在提到数据中心设备时,听到更多的“循环”一词。
|
||||
|
||||
![](https://img.linux.net.cn/data/attachment/album/202008/25/234108f8yz3c3la8xw18mn.jpg)
|
||||
|
||||
微软正在将人工智能引入到对数百万台服务器进行分类的任务中,以确定哪些部件可以回收,在哪里回收。
|
||||
|
||||
新计划要求在微软全球各地的数据中心建立所谓的循环中心,在那里,人工智能算法将用于从退役的服务器或其他硬件中分拣零件,并找出哪些零件可以在园区内重新使用。
|
||||
新计划要求在微软全球各地的数据中心建立所谓的“<ruby>循环中心<rt>Circular Center</rt></ruby>”,在那里,人工智能算法将用于从退役的服务器或其他硬件中分拣零件,并找出哪些零件可以在园区内重新使用。
|
||||
|
||||
微软表示,它的数据中心有超过 300 万台服务器和相关硬件,一台服务器的平均寿命约为 5 年。另外,微软正在全球范围内扩张,所以其服务器数量应该会增加。
|
||||
|
||||
循环中心就是要快速整理库存,而不是让过度劳累的员工疲于奔命。微软计划到 2025 年将服务器部件的重复使用率提高 90%。微软总裁 Brad Smith 在宣布这一举措的一篇[博客][2]中写道:“利用机器学习,我们将对退役的服务器和硬件进行现场处理。我们会将那些可以被我们以及客户重复使用和再利用的部件进行分类,或者出售。“
|
||||
循环中心就是要快速整理库存,而不是让过度劳累的员工疲于奔命。微软计划到 2025 年将服务器部件的重复使用率提高 90%。微软总裁 Brad Smith 在宣布这一举措的一篇[博客][2]中写道:“利用机器学习,我们将对退役的服务器和硬件进行现场处理。我们会将那些可以被我们以及客户重复使用和再利用的部件进行分类,或者出售。”
|
||||
|
||||
Smith 指出,如今,关于废物的数量、质量和类型,以及废物的产生地和去向,都没有一致的数据。例如,关于建造和拆除废物的数据并不一致,我们要一个标准化的方法,有更好的透明度和更高的质量。
|
||||
|
||||
他写道:”如果没有更准确的数据,几乎不可能了解运营决策的影响,设定什么目标,如何评估进展,以及废物去向方法的行业标准“。
|
||||
他写道:“如果没有更准确的数据,几乎不可能了解运营决策的影响,设定什么目标,如何评估进展,以及废物去向方法的行业标准。”
|
||||
|
||||
根据微软的说法,阿姆斯特丹数据中心的一个试点循环中心减少了停机时间,并增加了服务器和网络部件的可用性,供其自身再利用和供应商回购。它还降低了将服务器和硬件运输到处理设施的成本,从而降低了碳排放。
|
||||
根据微软的说法,阿姆斯特丹数据中心的一个循环中心试点减少了停机时间,并增加了服务器和网络部件的可用性,供其自身再利用和供应商回购。它还降低了将服务器和硬件运输到处理设施的成本,从而降低了碳排放。
|
||||
|
||||
”循环经济“一词正在科技界流行。它是基于服务器硬件的循环利用,将那些已经使用了几年但仍可用的设备重新投入到其他地方服务。ITRenew 是[我在几个月前介绍过][3]的一家二手超大规模服务器的转售商,它对这个词很感兴趣。
|
||||
“<ruby>循环经济<rt>circular economy</rt></ruby>”一词正在科技界流行。它是基于服务器硬件的循环利用,将那些已经使用了几年但仍可用的设备重新投入到其他地方服务。ITRenew 是[我在几个月前介绍过][3]的一家二手超大规模服务器的转售商,它对这个词很感兴趣。
|
||||
|
||||
该公司表示,首批微软循环中心将建在新的主要数据中心园区或地区。它计划最终将这些中心添加到已经存在的园区中。
|
||||
|
||||
微软曾明确表示要在 2030 年之前实现”碳负排放“,而这只是几个项目之一。近日,微软宣布在其位于盐湖城的系统开发者实验室进行了一项测试,用一套 250kW 的氢燃料电池系统为一排服务器机架连续供电 48 小时,微软表示这是以前从未做过的事情。
|
||||
微软曾明确表示要在 2030 年之前实现“碳负排放”,而这只是其中几个项目之一。近日,微软宣布在其位于盐湖城的系统开发者实验室进行了一项测试,用一套 250kW 的氢燃料电池系统为一排服务器机架连续供电 48 小时,微软表示这是以前从未做过的事情。
|
||||
|
||||
微软首席基础设施工程师 Mark Monroe 在一篇[博客][4]中写道:”这是我们所知道的最大的以氢气运行的计算机备用电源系统,而且它的连续测试时间最长。“他说,近年来氢燃料电池的价格大幅下降,现在已经成为柴油发电机的可行替代品,但燃烧更清洁。
|
||||
|
||||
加入 [Facebook][5] 和 [LinkedIn][6] 上的 Network World 社区,就热门话题发表评论。
|
||||
微软首席基础设施工程师 Mark Monroe 在一篇[博客][4]中写道:“这是我们所知道的最大的以氢气运行的计算机备用电源系统,而且它的连续测试时间最长。”他说,近年来氢燃料电池的价格大幅下降,现在已经成为柴油发电机的可行替代品,但燃烧更清洁。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
@ -42,7 +43,7 @@ via: https://www.networkworld.com/article/3570451/microsoft-uses-ai-to-boost-its
|
||||
作者:[Andy Patrizio][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/) 荣誉推出
|
||||
|
@ -1,42 +1,39 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (geekpi)
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: reviewer: (wxy)
|
||||
[#]: publisher: (wxy)
|
||||
[#]: url: (https://linux.cn/article-12549-1.html)
|
||||
[#]: subject: (Use GNU on Windows with MinGW)
|
||||
[#]: via: (https://opensource.com/article/20/8/gnu-windows-mingw)
|
||||
[#]: author: (Seth Kenlon https://opensource.com/users/seth)
|
||||
|
||||
使用 Mingw 在 Windows 上使用 GNU
|
||||
======
|
||||
在 Windows 上安装 GNU 编译器集合和其他 GNU 组件来启用 GNU Autotools。
|
||||
![Windows][1]
|
||||
|
||||
如果你是使用 Windows 的黑客,你不需要专有应用来编译代码。借助 [Minimalist GNU for Windows][2](MinGW) 项目,你可以下载并安装 [GNU 编译器集合][3] (GCC) 以及其他几个基本 GNU 组件,以在 Windows 计算机上启用 [GNU Autotools][4]。
|
||||
> 在 Windows 上安装 GNU 编译器集合(gcc)和其他 GNU 组件来启用 GNU Autotools。
|
||||
|
||||
![](https://img.linux.net.cn/data/attachment/album/202008/25/085619rr331p13shpt6htp.jpg)
|
||||
|
||||
如果你是一名使用 Windows 的黑客,你不需要专有应用来编译代码。借助 [Minimalist GNU for Windows][2](MinGW)项目,你可以下载并安装 [GNU 编译器集合(GCC)][3]以及其它几个基本的 GNU 组件,以在 Windows 计算机上启用 [GNU Autotools][4]。
|
||||
|
||||
### 安装 MinGW
|
||||
|
||||
安装 MinGW 的最简单方法是通过 mingw-get,它是一个图形用户界面 (GUI) 应用,可帮助你选择要安装哪些组件,并让它们保持最新。要运行它,请从项目主页[下载 `mingw-get-setup.exe`][5]。像你安装其他 exe 一样,在向导中单击完成安装。
|
||||
安装 MinGW 的最简单方法是通过 mingw-get,它是一个图形用户界面 (GUI) 应用,可帮助你选择要安装哪些组件,并让它们保持最新。要运行它,请从项目主页[下载 mingw-get-setup.exe][5]。像你安装其他 EXE 一样,在向导中单击完成安装。
|
||||
|
||||
![Installing mingw-get][6]
|
||||
|
||||
(Seth Kenlon, [CC BY-SA 4.0][7])
|
||||
|
||||
### 在 Windows 上安装 GCC
|
||||
|
||||
目前为止,你只安装了一个程序,或者更准确地说,一个专用的_包管理器_称为 mingw-get。启动 mingw-get 选择要在计算机上安装的 MinGW 项目应用。
|
||||
目前为止,你只安装了一个程序,或者更准确地说,一个称为 mingw-get 的专用的*包管理器*。启动 mingw-get 选择要在计算机上安装的 MinGW 项目应用。
|
||||
|
||||
首先,从应用菜单中选择 **mingw-get** 启动它。
|
||||
首先,从应用菜单中选择 mingw-get 启动它。
|
||||
|
||||
![Installing GCC with MinGW][8]
|
||||
|
||||
(Seth Kenlon, [CC BY-SA 4.0][7])
|
||||
|
||||
要安装 GCC,请单击 GCC 和 G++ 包来标记要安装 GNU C、C++ 编译器。要完成此过程,请从 mingw-get 窗口左上角的**安装**菜单中选择**应用更改**。
|
||||
|
||||
安装 GCC 后,你可以使用完整路径在 [PowerShell][9] 中运行它:
|
||||
|
||||
|
||||
```
|
||||
PS> C:\MinGW\bin\gcc.exe --version
|
||||
gcc.exe (MinGW.org GCC Build-x) x.y.z
|
||||
@ -45,20 +42,18 @@ Copyright (C) 2019 Free Software Foundation, Inc.
|
||||
|
||||
### 在 Windows 上运行 Bash
|
||||
|
||||
虽然它自称 “minimalist”(最小化),但 MinGW 还提供一个可选的 [Bourne shell][10]命令行解释器,称为 MSYS(它代表最小系统)。它是微软的 `cmd.exe` 和 PowerShell 的替代方案,它默认是 Bash。除了是(正当的)最流行的 shell 之一外,Bash 在将开源应用移植到 Windows 平台时很有用,因为许多开源项目都假定了 [POSIX][11] 环境。
|
||||
虽然它自称 “minimalist”(最小化),但 MinGW 还提供一个可选的 [Bourne shell][10] 命令行解释器,称为 MSYS(它代表<ruby>最小系统<rt>Minimal System</rt></ruby>)。它是微软的 `cmd.exe` 和 PowerShell 的替代方案,它默认是 Bash。除了是(自然而然的)最流行的 shell 之一外,Bash 在将开源应用移植到 Windows 平台时很有用,因为许多开源项目都假定了 [POSIX][11] 环境。
|
||||
|
||||
你可以在 mingw-get GUI 或 PowerShell 内安装 MSYS:
|
||||
|
||||
|
||||
```
|
||||
`PS> mingw-get install msys`
|
||||
PS> mingw-get install msys
|
||||
```
|
||||
|
||||
要尝试 Bash,请使用完整路径启动它:
|
||||
|
||||
|
||||
```
|
||||
PS> C:\MinGW\msys/1.0/bin/bash.exe
|
||||
PS> C:\MinGW\msys/1.0/bin/bash.exe
|
||||
bash.exe-$ echo $0
|
||||
"C:\MinGW\msys/1.0/bin/bash.exe"
|
||||
```
|
||||
@ -71,53 +66,46 @@ bash.exe-$ echo $0
|
||||
|
||||
![Edit your env][13]
|
||||
|
||||
(Seth Kenlon, [CC BY-SA 4.0][7])
|
||||
这将打开“首选项”窗口。点击窗口底部附近的“环境变量”按钮。
|
||||
|
||||
这将打开“首选项”窗口。点击窗口底部附近的**环境变量**按钮。
|
||||
在“环境变量”窗口中,双击底部面板中的“路径”选区。
|
||||
|
||||
在**环境变量**窗口中,双击底部面板中的**路径**选择。
|
||||
|
||||
在**编辑环境变量**窗口中,单击右侧的**新增**按钮。创建一个新条目 **C:\MinCW\msys\1.0\bin**,然后单击 **OK**。以相同的方式创建第二条 **C:\MinGW\bin**,然后单击 **OK**。
|
||||
在“编辑环境变量”窗口中,单击右侧的“新增”按钮。创建一个新条目 `C:\MinCW\msys\1.0\bin`,然后单击 “确定”。以相同的方式创建第二条 `C:\MinGW\bin`,然后单击 “确定”。
|
||||
|
||||
![Set your env][14]
|
||||
|
||||
(Seth Kenlon, [CC BY-SA 4.0][7])
|
||||
|
||||
在每个首选项窗口中接受这些更改。你可以重启计算机以确保所有应用都检测到新变量,或者只需重启 PowerShell 窗口。
|
||||
|
||||
从现在开始,你可以调用任何 MinGW 命令而不指定完整路径,因为完整路径位于 PowerShell 继承的 Windows 系统的 `%PATH%` 环境变量中。
|
||||
|
||||
### Hello world
|
||||
|
||||
你已经完成设置,因此对新的 MinGW 系统进行小测试。如果你是 [Vim][15] 用户,请启动它,然后输入下面的 “hello world” 代码:
|
||||
|
||||
你已经完成设置,因此可以对新的 MinGW 系统进行小测试。如果你是 [Vim][15] 用户,请启动它,然后输入下面的 “hello world” 代码:
|
||||
|
||||
```
|
||||
#include <stdio.h>
|
||||
#include <iostream>
|
||||
#include <stdio.h>
|
||||
#include <iostream>
|
||||
|
||||
using namespace std;
|
||||
|
||||
int main() {
|
||||
cout << "Hello open source." << endl;
|
||||
return 0;
|
||||
cout << "Hello open source." << endl;
|
||||
return 0;
|
||||
}
|
||||
```
|
||||
|
||||
将文件保存为 `hello.cpp`,然后使用 GCC 的 C++ 组件编译文件:
|
||||
|
||||
|
||||
```
|
||||
`PS> gcc hello.cpp --output hello`
|
||||
PS> gcc hello.cpp --output hello
|
||||
```
|
||||
|
||||
最后,运行它:
|
||||
|
||||
|
||||
```
|
||||
PS> .\a.exe
|
||||
PS> .\a.exe
|
||||
Hello open source.
|
||||
PS>
|
||||
PS>
|
||||
```
|
||||
|
||||
MinGW 的内容远不止我在这里所能介绍的。毕竟,MinGW 打开了一个完整的开源世界和定制代码的潜力,因此请充分利用它。对于更广阔的开源世界,你还可以[试试 Linux][16]。当所有的限制都被消除后,你会惊讶于可能的事情。但与此同时,请试试 MinGW,并享受 GNU 的自由。
|
||||
@ -129,7 +117,7 @@ via: https://opensource.com/article/20/8/gnu-windows-mingw
|
||||
作者:[Seth Kenlon][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/) 荣誉推出
|
||||
|
@ -1,5 +1,5 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (JunJie957)
|
||||
[#]: translator: ( )
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
|
212
sources/tech/20200825 11 ways to list and sort files on Linux.md
Normal file
212
sources/tech/20200825 11 ways to list and sort files on Linux.md
Normal file
@ -0,0 +1,212 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: ( )
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (11 ways to list and sort files on Linux)
|
||||
[#]: via: (https://www.networkworld.com/article/3572590/11-ways-to-list-and-sort-files-on-linux.html)
|
||||
[#]: author: (Sandra Henry-Stocker https://www.networkworld.com/author/Sandra-Henry_Stocker/)
|
||||
|
||||
11 ways to list and sort files on Linux
|
||||
======
|
||||
Linux commands can provide details on files and show options for customizing file listings, but can also reach as deeply into a file system as you care to look.
|
||||
Thinkstock
|
||||
|
||||
There are many ways to list files and display information about them on Linux systems. This post reviews a number of commands that provide details on files and provides options for customizing your file listings to meet your needs.
|
||||
|
||||
Most of the commands list files within individual directories while others reach as deeply into a file system as you care to look.
|
||||
|
||||
The primary command for listing files is, of course, **ls**. This command, however, has an extensive number of options for finding and listing just the files you want to see. Plus, there's always **find** for helping with very specific file searches.
|
||||
|
||||
### Listing files by name
|
||||
|
||||
The easiest way to list files by name is simply to list them using the **ls** command. Listing files by name (alphanumeric order) is, after all, the default. You can choose the **ls** (no details) or **ls -l** (lots of details) to determine your view.
|
||||
|
||||
```
|
||||
$ ls | head -6
|
||||
8pgs.pdf
|
||||
Aesthetics_Thank_You.pdf
|
||||
alien.pdf
|
||||
Annual_Meeting_Agenda-20190602.pdf
|
||||
bigfile.bz2
|
||||
bin
|
||||
$ ls -l | head -6
|
||||
-rw-rw-r-- 1 shs shs 10886 Mar 22 2019 8pgs.pdf
|
||||
-rw-rw-r-- 1 shs shs 284003 May 11 2019 Aesthetics_Thank_You.pdf
|
||||
-rw-rw-r-- 1 shs shs 38282 Jan 24 2019 alien.pdf
|
||||
-rw-rw-r-- 1 shs shs 97358 May 19 2019 Annual_Meeting_20190602.pdf
|
||||
-rw-rw-r-- 1 shs shs 18115234 Apr 16 17:36 bigfile.bz2
|
||||
drwxrwxr-x 4 shs shs 8052736 Jul 10 13:17 bin
|
||||
```
|
||||
|
||||
Pipe the output of **ls** to the **more** command if you want to review your listing a screenful at a time.
|
||||
|
||||
### Listing files in reverse name order
|
||||
|
||||
To reverse the listing of files by name, add the **-r** (reverse) option. This will be like turning the normal listing upside down.
|
||||
|
||||
```
|
||||
$ ls -r
|
||||
$ ls -lr
|
||||
```
|
||||
|
||||
### Listing files by file extension
|
||||
|
||||
The **ls** command doesn’t analyze file types by content, but works with file names. There is, however, a command option that can list files by extension. If you add the **-X** option, **ls** will sort files by name within each extension category. For example, it will list files without extensions first (in alphanumeric order) followed by files with extensions like .1, .bz2, .c and so on.
|
||||
|
||||
### Listing directories only
|
||||
|
||||
By default, the **ls** command will show both files and directories. If you want to list _only_ directories, you can use the **-d** option. You will get a listing like this one:
|
||||
|
||||
```
|
||||
$ ls -d */
|
||||
1/ backups/ modules/ projects/ templates/
|
||||
2/ html/ patches/ public/ videos/
|
||||
bin/ new/ private/ save/
|
||||
```
|
||||
|
||||
### Listing files by size
|
||||
|
||||
If you want to list files in size order, add the **-S** option. Note, however, that this won't actually show you the sizes (along with other file details) unless you also add the **-l** (long listing) option. When listing files by size, it's generally helpful to see that the command is doing what you asked. Notice that the default is to show the largest files first. Add the **-r** option to reverse this (i.e., **ls -lSr**).
|
||||
|
||||
```
|
||||
$ ls -lS
|
||||
total 959492
|
||||
-rw-rw-r-- 1 shs shs 357679381 Sep 19 2019 sav-linux-free-9.tgz
|
||||
-rw-rw-r-- 1 shs shs 103270400 Apr 16 17:38 bigfile
|
||||
-rw-rw-r-- 1 shs shs 79117862 Oct 5 2019 Nessus-8.7.1-ubuntu1110_amd64.deb
|
||||
```
|
||||
|
||||
### Listing files by owner
|
||||
|
||||
If you want to list files by owner (e.g., in a shared directory), you can pass the output of the **ls** command to **sort** and pick out the owner column by adding **-k3** to sort on the third field.
|
||||
|
||||
```
|
||||
$ ls -l | sort -k3 | more
|
||||
total 56
|
||||
-rw-rw-r-- 1 dory shs 0 Aug 23 12:27 tasklist
|
||||
drwx------ 2 gdm gdm 4096 Aug 21 17:12 tracker-extract-files.121
|
||||
srwxr-xr-x 1 root root 0 Aug 21 17:12 ntf_listenerc0c6b8b4567
|
||||
drwxr-xr-x 2 root root 4096 Aug 21 17:12 hsperfdata_root
|
||||
^
|
||||
|
|
||||
```
|
||||
|
||||
In fact, you can sort on any field this way (e.g., year). Just be careful to add an “n” – **-k5n** – if you’re sorting on a field which is numeric or you'll be sorting in alphanumeric order. This sorting technique is useful for sorting file contents as well, not just listing files.
|
||||
|
||||
### Listing files by age
|
||||
|
||||
Use the **-t** option to list files in order of age – how new they are. Add the **-r** option to get the most recently updated files showing up last in the list. I use this alias to show me a list of the files that I’ve most recently updated:
|
||||
|
||||
```
|
||||
$ alias recent='ls -ltr | tail -8'
|
||||
```
|
||||
|
||||
Note that file change and modification times are different. The **-c** (change) and **-t** (modification) options will not always give the same results. If you change permissions on a file and nothing else, **-c** will put that files at the top of the **ls** output while **-t** will not. If you’re curious about the difference, look at the output of the **stat** command.
|
||||
|
||||
```
|
||||
$ stat ckacct
|
||||
File: ckacct
|
||||
Size: 200 Blocks: 8 IO Block: 4096 regular file
|
||||
Device: 801h/2049d Inode: 829041 Links: 1
|
||||
Access: (0750/-rwxr-x---) Uid: ( 1000/ shs) Gid: ( 1000/ shs)
|
||||
Access: 2020-08-20 16:10:11.063015008 -0400
|
||||
Modify: 2020-08-17 07:26:34.579922297 -0400 <== content changes
|
||||
Change: 2020-08-24 09:36:51.699775940 -0400 <== content or permissions changes
|
||||
Birth: -
|
||||
```
|
||||
|
||||
### Listing files by group
|
||||
|
||||
To sort files by the associated groups, you can pass the output from a long listing to the **sort** command and tell it to sort on column 4.
|
||||
|
||||
```
|
||||
$ ls -l | sort -k4
|
||||
```
|
||||
|
||||
### Listing files by access date
|
||||
|
||||
To list files by access date (most recently accessed first), use the **-ltu** options. The "u" enforces the "by access date" listing order.
|
||||
|
||||
```
|
||||
$ ls -ltu
|
||||
total 959500
|
||||
-rwxr-x--- 1 shs shs 200 Aug 24 09:42 ckacct <== most recently used
|
||||
-rw-rw-r-- 1 shs shs 1335 Aug 23 17:45 lte
|
||||
```
|
||||
|
||||
### Listing multiple files on a single line
|
||||
|
||||
Sometimes a condensed file listing is more appropriate for the task at hand. The **ls** command even has options for that. To list files on as few lines as possible, you can use **\--format=comma** to separate file names with commas as in this command:
|
||||
|
||||
```
|
||||
$ ls --format=comma
|
||||
1, 10, 11, 12, 124, 13, 14, 15, 16pgs-landscape.pdf, 16pgs.pdf, 17, 18, 19,
|
||||
192.168.0.4, 2, 20, 2018-12-23_OoS_2.pdf, 2018-12-23_OoS.pdf, 20190512_OoS.pdf,
|
||||
'2019_HOHO_application working.pdf' …
|
||||
```
|
||||
|
||||
Prefer white space? Use **\--format=across** instead.
|
||||
|
||||
```
|
||||
$ ls --format=across z*
|
||||
z zip zipfiles zipfiles1.bat zipfiles2.bat
|
||||
zipfiles3.bat zipfiles4.bat zipfiles.bat zoom_amd64.deb zoomap.pdf
|
||||
zoom-mtg
|
||||
```
|
||||
|
||||
### Adding depth to your searches
|
||||
|
||||
While **ls** generally lists files in a single directory, you can choose instead to recursively list files by using the **-R** options, delving into the entire depth of directories:
|
||||
|
||||
```
|
||||
$ ls -R zzzzz | grep -v "^$"
|
||||
zzzzz:
|
||||
zzzz
|
||||
zzzzz/zzzz:
|
||||
zzz
|
||||
zzzzz/zzzz/zzz:
|
||||
zz
|
||||
zzzzz/zzzz/zzz/zz:
|
||||
z
|
||||
zzzzz/zzzz/zzz/zz/z:
|
||||
sleeping
|
||||
```
|
||||
|
||||
Alternately, you can use a **find** command with a limited or unlimited depth specification. In this command, we instruct the **find** command to look in only three levels of directories:
|
||||
|
||||
```
|
||||
$ find zzzzz -maxdepth 3
|
||||
zzzzz
|
||||
zzzzz/zzzz
|
||||
zzzzz/zzzz/zzz
|
||||
zzzzz/zzzz/zzz/zz
|
||||
```
|
||||
|
||||
### Choosing ls vs find
|
||||
|
||||
When you need to list files that meet a very selective list of requirements, the **find** command is probably a better tool to use than **ls**.
|
||||
|
||||
Unlike **ls**, the **find** command looks as deeply as possible unless you constrain it. It also has many other options and an **-exec** command that allows you to take some specific action once you find the files you’re looking for.
|
||||
|
||||
### Wrap-Up
|
||||
|
||||
The **ls** command has a lot of options for listing files. Check them out. You might find some that you’ll love.
|
||||
|
||||
Join the Network World communities on [Facebook][1] and [LinkedIn][2] to comment on topics that are top of mind.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://www.networkworld.com/article/3572590/11-ways-to-list-and-sort-files-on-linux.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.facebook.com/NetworkWorld/
|
||||
[2]: https://www.linkedin.com/company/network-world
|
@ -0,0 +1,161 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (geekpi)
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (OnionShare: An Open-Source Tool to Share Files Securely Over Tor Network)
|
||||
[#]: via: (https://itsfoss.com/onionshare/)
|
||||
[#]: author: (Ankush Das https://itsfoss.com/author/ankush/)
|
||||
|
||||
OnionShare: An Open-Source Tool to Share Files Securely Over Tor Network
|
||||
======
|
||||
|
||||
_**Brief: OnionShare is a free and open-source tool that utilizes the Tor network to share files securely and anonymously.**_
|
||||
|
||||
You might have already come across a lot of online services to share files securely but it may not be completely anonymous.
|
||||
|
||||
Also, you do have to rely on a centralized service to share your files and if the service decides to shut down like [Firefox Send][1] — you can’t really depend on it to safely share files all the time.
|
||||
|
||||
All things considered, OnionShare is an amazing open-source tool that lets you share files using the [Tor Onion service][2]. It should be an amazing alternative to all the cloud file sharing services.
|
||||
|
||||
Let’s take a look at what it offers and how it works.
|
||||
|
||||
![][3]
|
||||
|
||||
### OnionShare: Share files anonymously over Tor
|
||||
|
||||
[OnionShare][4] is an interesting open-source tool that’s available for Linux, Windows, and macOS.
|
||||
|
||||
It lets you securely share files directly from your computer to the receiver without revealing your identity in the process. You don’t have to sign up for any account — nor does it rely on any centralized storage service.
|
||||
|
||||
It is basically peer-to-peer over the Tor network. The receiver only needs to have a [Tor browser][5] to download/upload files to your computer. I’d also recommend you to go through our [Tor guide][6] to explore more about it if you’re curious.
|
||||
|
||||
Let’s take a look at the features.
|
||||
|
||||
### Features of OnionShare
|
||||
|
||||
For an average user who just wants security and anonymity, there’s no tweak required. However, you do have some advanced options if you need.
|
||||
|
||||
* Cross-platform support (Windows, macOS, and Linux)
|
||||
* Send files
|
||||
* Receive files
|
||||
* Command-line options
|
||||
* Publish onion sites
|
||||
* Ability to use bridges (if your tor connection isn’t working)
|
||||
* Ability to use a persistent URL for sharing (advanced users)
|
||||
* Stealth mode (more secure)
|
||||
|
||||
|
||||
|
||||
You can go through the [official user guide][7] on GitHub to learn more about them.
|
||||
|
||||
### Installing OnionShare on Linux
|
||||
|
||||
You should find OnionShare listed in your software center to get it installed. If it’s not there, you can add the PPA using the commands below on Ubuntu-based distros:
|
||||
|
||||
```
|
||||
sudo add-apt-repository ppa:micahflee/ppa
|
||||
sudo apt update
|
||||
sudo apt install -y onionshare
|
||||
```
|
||||
|
||||
If you’re looking to install it on other Linux distributions, you can visit the [official website][4] for installation instructions on Fedora and build instructions as well.
|
||||
|
||||
[Download OnionShare][4]
|
||||
|
||||
### How does OnionShare Work?
|
||||
|
||||
After you get it installed, everything is pretty self-explanatory and easy-to-use. But, if you want a heads up, let me show you how it works.
|
||||
|
||||
Once, it loads up and connects to the Tor network
|
||||
|
||||
#### Sharing a File
|
||||
|
||||
![][8]
|
||||
|
||||
You just have to add the file(s) that you want to share from your computer and then click on “**Start sharing**“.
|
||||
|
||||
Once you’re done, the status at the bottom-right should say “**Sharing**” and an **OnionShare address** will be generated (copied to clipboard automatically) as shown in the image below:
|
||||
|
||||
![][9]
|
||||
|
||||
All the receiver needs now is the OnionShare address that should look like this:
|
||||
|
||||
```
|
||||
http://onionshare:[email protected]
|
||||
```
|
||||
|
||||
And, a Tor browser to start downloading the files.
|
||||
|
||||
It’s worth noting that once the download completes (file transfer is done), the file sharing stops. You will also be notified of the same when that happens.
|
||||
|
||||
So, if you have to share it again or with someone else, you will have to re-share it and send the new OnionShare address to the receiver.
|
||||
|
||||
#### Allow Receiving Files
|
||||
|
||||
If you want to generate a URL that lets someone upload files directly to your computer (be careful with whom you share it), you can just click on the **Receive Files** tab after you launch OnionShare.
|
||||
|
||||
![][10]
|
||||
|
||||
You just have to click on the “**Start Receive Mode**” button to get started. Next, you will get an OnionShare address (just like while sharing a file).
|
||||
|
||||
The receiver has to access it using the Tor browser and start uploading files. Here’s how it should look like:
|
||||
|
||||
![][11]
|
||||
|
||||
Even though you will be notified of the file transfer when someone is uploading to your computer, you need to manually stop the receiving mode when you’re done.
|
||||
|
||||
#### Downloading/Uploading Files
|
||||
|
||||
Considering that you have a Tor browser installed, you just need to hit the OnionShare address in the URL address, confirm log in (press OK) and here’s how it should look like:
|
||||
|
||||
![][12]
|
||||
|
||||
Similarly, when you get an address to upload files, it should look like this:
|
||||
|
||||
![][13]
|
||||
|
||||
#### Publish Onion Sites
|
||||
|
||||
You can simply add the files to host a static onion website if you want. Of course, just because it’s peer-to-peer connection, it’ll be very slow to load up while it transfers every file from your computer.
|
||||
|
||||
![][14]
|
||||
|
||||
I tried using a [free template][15] to test it out and it works great (but very slow). So, it may depend on your network connection.
|
||||
|
||||
### **Wrapping Up**
|
||||
|
||||
In addition to all the features mentioned above, you can also use the command line and opt for some advanced tweaks if needed.
|
||||
|
||||
OnionShare is indeed an impressive open-source tool that makes it easy to share files anonymously without needing any special tweaks.
|
||||
|
||||
Have you tried OnionShare yet? Is there something similar to this that you know of? Let me know in the comments below!
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://itsfoss.com/onionshare/
|
||||
|
||||
作者:[Ankush Das][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://itsfoss.com/author/ankush/
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://itsfoss.com/firefox-send/
|
||||
[2]: https://community.torproject.org/onion-services/
|
||||
[3]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/08/onionshare-screenshot.jpg?resize=800%2C629&ssl=1
|
||||
[4]: https://onionshare.org/
|
||||
[5]: https://itsfoss.com/install-tar-browser-linux/
|
||||
[6]: https://itsfoss.com/tor-guide/
|
||||
[7]: https://github.com/micahflee/onionshare/wiki
|
||||
[8]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/08/onionshare-share.png?resize=800%2C604&ssl=1
|
||||
[9]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/08/onionshare-file-shared.jpg?resize=800%2C532&ssl=1
|
||||
[10]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/08/onionshare-receive-files.jpg?resize=800%2C655&ssl=1
|
||||
[11]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/08/onionshare-receive-mode.jpg?resize=800%2C529&ssl=1
|
||||
[12]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/08/onionshare-download.jpg?resize=800%2C499&ssl=1
|
||||
[13]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/08/onionshare-upload.jpg?resize=800%2C542&ssl=1
|
||||
[14]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/08/onionshare-onion-site.jpg?resize=800%2C366&ssl=1
|
||||
[15]: https://www.styleshout.com/free-templates/kards/
|
Loading…
Reference in New Issue
Block a user