Merge pull request #8 from LCTT/master

update 0803
This commit is contained in:
SamMa 2021-08-03 09:09:00 +08:00 committed by GitHub
commit 1419472753
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
10 changed files with 873 additions and 316 deletions

View File

@ -1,139 +0,0 @@
[#]: subject: (Reading and writing files with Python)
[#]: via: (https://opensource.com/article/21/7/read-write-files-python)
[#]: author: (Seth Kenlon https://opensource.com/users/seth)
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
Reading and writing files with Python
======
Every programming language handles data files differently. Here's how
Python does it.
![Hands on a keyboard with a Python book ][1]
Some data is meant to be temporary, stored in RAM while an application is running, and then forgotten. Some data, however, is meant to be persistent. It's stored on a hard drive for later use, and it's often the stuff that a user cares about the most. For programmers, it's very common to write code to read and write files, but every language handles this task a little differently. This article demonstrates how to handle data files with Python.
### Install Python
On Linux, you probably already have Python installed. If not, you can install it from your distribution's software repository. For instance, on CentOS Stream or RHEL:
```
`$ sudo dnf install python3`
```
On macOS, you can install Python from [MacPorts][2] or [Homebrew][3]. On Windows, you can install Python from [Chocolatey][4].
Once you have Python installed, open your favorite text editor and get ready to code.
### Writing data to a file with Python
If you need to write data to a file, there are three steps to remember:
1. Open
2. Write
3. Close
This is exactly the same sequence of steps you use when writing code, editing photos, or doing almost anything on a computer. First, you open the document you want to edit, then you make some edits, and then you close the document.
In Python, that translates to this process:
```
f = open('example.txt', 'w')
f.write('hello world')
f.close()
```
In this example, the first line opens a file in **write** mode. The file is represented as the variable `f`, which is an arbitrary choice. I use `f` because it seems to be common in Python code, but any valid variable name works just as well.
There are different modes in which you can open a file:
* **w** to write
* **r+** to read and write
* **a** to append only
The second line of the example writes data to the file. The data written in this example is plain text, but you can write any kind of data.
The final line closes the file.
### Writing data using the 'with' syntax
There's a shorter way to write data into a file, and this method can be useful for quick file interactions. It doesn't leave the file open, so you don't have to remember to call the **close()** function. Instead, it uses the **with** syntax:
```
with open('example.txt', 'a') as f:
    f.write('hello open source')
```
### Reading data in from a file with Python
If you (or your user, by way of your application) have placed data into a file, and your code needs to retrieve it, then you want to read a file. Similar to writing, the logic is:
1. Open
2. Read
3. Close
Again, this logic flow mirrors what you already know from just using a computer (or a paperback book, for that matter). To read a document, you open it, read it, and then close it. In computer terms, "opening" a file means to load it into memory.
In practice, a text file contains more than one line. For example, maybe your code needs to read a configuration file, saved game data, or the lyrics to your band's next song. Just as you don't read an entire physical book the very moment you open it, your code must parse a file it has loaded into memory. So, you probably need to iterate over the file's contents.
```
f = open('example.tmp', 'r')
for line in f:
    print(line)
f.close()
```
In the first line of this example code, you open a file in **read** mode. The file is represented by the variable `f`, but just like when you open files for writing, the variable name is arbitrary. There's nothing special about `f`; it's just the shortest possible way to represent the word "file," so it tends to be used a lot by Python programmers.
In the second line, you reserve `line`, which is yet another arbitrary variable name, to represent each line of `f`. This tells Python to iterate, line by line, over the file's contents and print each line to your output (in this case, the terminal or [IDLE][5]).
### Reading a file using the 'with' syntax
As with writing data, there's a shorter method of reading data from files using the **with** syntax. This doesn't require you to call the **call()** function, so it can be convenient for quick interactions.
```
with open('example.txt', 'r') as f:
    for line in f:
        print(line)
```
### Files and Python
There are more ways to write data to files using Python, and many ways to format text you write to files using [JSON, YAML, TOML][6], and more. There's also a very nice built-in method for creating and maintaining an [SQLite][7] database and many libraries to handle any number of file formats, including [graphics][8], audio, video, and more.
--------------------------------------------------------------------------------
via: https://opensource.com/article/21/7/read-write-files-python
作者:[Seth Kenlon][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/seth
[b]: https://github.com/lujun9972
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/python-programming-code-keyboard.png?itok=fxiSpmnd (Hands on a keyboard with a Python book )
[2]: https://opensource.com/article/20/11/macports
[3]: https://opensource.com/article/20/6/homebrew-mac
[4]: https://opensource.com/article/20/3/chocolatey
[5]: https://opensource.com/article/17/10/python-101#idle
[6]: https://opensource.com/article/21/6/parse-configuration-files-python
[7]: https://opensource.com/article/21/2/sqlite3-cheat-sheet
[8]: https://opensource.com/article/19/3/python-image-manipulation-tools

View File

@ -1,164 +0,0 @@
[#]: subject: (How to Upgrade to Debian 11 from Debian 10)
[#]: via: (https://www.debugpoint.com/2021/07/upgrade-debian-11-from-debian-10/)
[#]: author: (Arindam https://www.debugpoint.com/author/admin1/)
[#]: collector: (lujun9972)
[#]: translator: (geekpi)
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
How to Upgrade to Debian 11 from Debian 10
======
This guide explains the steps to upgrade debian 11 from debian 10.
[Debian][1] releases are rare. Because it is often a multi-year effort from the community. That is why Debian is truly universal operating system and rock solid stability wise.
[Debian 11][2], code named Bullseye, officially releases soon. On July 15, 2021, Debian 11 went to complete freeze, which means the release is imminent. Although the official date is not finalized, but you can install or upgrade to Debian 11 from Debian 10 right now.
This is how.
### Pre-Requisites
* The upgrade process is very straightforward. However, it is a good practice to take certain pre-cautions. Specially if you are upgrading a server.
* Take backup of your system, including all important data and files.
* Try to disable/remove any external repositories (PPA) you may have added over the time. You can enable them after upgrade one-by-one.
* Close all the running applications.
* Stop any running services that you may have enabled. You can start them via [systemctl][3] after upgrade is complete. This includes web server, SSH server, FTP server or any other servers.
* Make sure you have stable internet connection.
* And have sufficient downtime of your system. Because depending on your system configuration, a Debian version upgrade takes time ~ between 1.5 hours to 2 hours.
### Upgrade Debian 10 Buster to 11 Bullseye Linux
* Make sure your system is up-to-date, and your package list is up-to-date.
```
sudo apt update && sudo apt upgrade
```
* Install the gcc-8-base package using the below command. This is required because, historically it has been seen, that upgrade fails because of certain dependencies which included in the below package.
```
sudo apt install gcc-8-base
```
![upgrade debian system check][4]
* Open the /etc/apt/sources.list and update with bullseye repositories, by commenting the Debian 10 buster packages.
* Comment out all the buster repo by “#” at the beginning of the lines.
![Comment the Debian 10 lines][5]
* Add the following lines at the end of the file.
```
deb http://deb.debian.org/debian bullseye main contrib non-free
deb http://deb.debian.org/debian bullseye-updates main contrib non-free
deb http://security.debian.org/debian-security bullseye-security main
deb http://ftp.debian.org/debian bullseye-backports main contrib non-free
```
![Add Debian 11 lines][6]
* Press Ctrl + O to save the file and Ctrl + X to exit nano.
* Update the system repository list once to verify the addition of the repositories.
```
sudo apt update
```
* If the above command doesnt give any error, then you have successfully added the bullseye repo.
* Now, start the upgrade process by running the below command. The download size is around 1.2 GB for a base installation. That may be different based on your system config.
```
sudo apt full-upgrade
```
![Debian upgrade start][7]
* This command takes time. But do not leave the system unattended. Because upgrade process requires various inputs during the course of upgrade.
![lib6 config][8]
![sudoers file][9]
* Once it is completed, you can restart the system using
```
systemctl reboot
```
* After reboot, run the following commands to make sure your system is up-to-date, and you cleaned up all the unnecessary packages that is not required anymore.
```
sudo apt --purge autoremove
```
* If all goes well, you should be seeing the Debian 11 bullseye. You can verify the version using the below command:
```
cat /etc/os-release
```
![Debian 11 after upgrade][10]
### Closing Notes
I hope this guide helps you to upgrade your system to Debian 11 bullseye. If you face any issues, let me know using the comment box below.
[][11]
SEE ALSO:   Debian 11 bullseye - Default Theme Revealed
* * *
--------------------------------------------------------------------------------
via: https://www.debugpoint.com/2021/07/upgrade-debian-11-from-debian-10/
作者:[Arindam][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.debugpoint.com/author/admin1/
[b]: https://github.com/lujun9972
[1]: https://www.debian.org/
[2]: https://www.debugpoint.com/2021/05/debian-11-features/
[3]: https://www.debugpoint.com/2020/12/systemd-systemctl-service/
[4]: https://www.debugpoint.com/blog/wp-content/uploads/2021/07/upgrade-debian-system-check-1024x503.jpeg
[5]: https://www.debugpoint.com/blog/wp-content/uploads/2021/07/Cpmment-the-Debian-10-lines-1024x636.jpeg
[6]: https://www.debugpoint.com/blog/wp-content/uploads/2021/07/Add-Debian-11-lines-1024x635.jpeg
[7]: https://www.debugpoint.com/blog/wp-content/uploads/2021/07/Debian-upgrade-start-1024x226.jpeg
[8]: https://www.debugpoint.com/blog/wp-content/uploads/2021/07/lib6-config-1024x195.jpeg
[9]: https://www.debugpoint.com/blog/wp-content/uploads/2021/07/sudoers-file.jpeg
[10]: https://www.debugpoint.com/blog/wp-content/uploads/2021/07/Debian-11-after-upgrade.jpeg
[11]: https://www.debugpoint.com/2020/11/debian-11-bullseye-theme/

View File

@ -2,7 +2,7 @@
[#]: via: (https://fedoramagazine.org/command-line-quick-tips-wc-sort-sed-and-tr/)
[#]: author: (mahesh1b https://fedoramagazine.org/author/mahesh1b/)
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: translator: (perfiffer)
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )

View File

@ -0,0 +1,80 @@
[#]: subject: (Use the Linux terminal to see what files are on your computer)
[#]: via: (https://opensource.com/article/21/8/linux-list-files)
[#]: author: (Seth Kenlon https://opensource.com/users/seth)
[#]: collector: (lujun9972)
[#]: translator: (piaoshi)
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
Use the Linux terminal to see what files are on your computer
======
Learn how to use the ls command to list files in the terminal with this
Linux tutorial.
![List files on your computer][1]
To list files on a computer with a graphical interface, you usually open a file manager (**Files** on Linux, **Finder** on MacOS, **Windows Explorer** on Windows), and look at the files.
To list files in a terminal, you use the **ls** command to list all files in the current directory. The **pwd** commands tells you what directory you're currently in.
```
$ pwd
/home/tux
$ ls
example.txt
Documents
Downloads
Music
Pictures
Templates
Videos
```
You can view hidden files with the **\--all** option:
```
$ pwd
/home/tux
$ ls --all
.               Downloads
..              .local
.bashrc         Music
.config         Pictures
example.txt     Templates
Documents       Videos
```
As you can see, the first items listed are dots. The single dot is actually a meta location meaning _the folder you are currently in_. The two dots indicate that you can move back from this location. That is, you are in a folder in another folder. Once you start moving around within your computer, you can use that information to create shortcuts for yourself or to increase the specificity of your paths.
### Files and folders and how to tell the difference
You may notice that it's hard to tell a file from a folder. Some Linux distributions have some nice colors set up so that all folders are blue and the files are white and binary files are pink or green, and so on. If you don't see those colors, you can try **ls --color**. If you're color blind or on a display that doesn't provide colors, you can alternately use the **\--classify** option:
```
$ pwd
/home/tux/Downloads
$ ls --classify
android-info.txt
cheat/
test-script.sh*
```
As you can see, folders are given a trailing slash (`/`) to denote that they are steps within your file system. Binary entities, like zip files and executable programs, are indicated swith an asterisk (`*`).
--------------------------------------------------------------------------------
via: https://opensource.com/article/21/8/linux-list-files
作者:[Seth Kenlon][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/seth
[b]: https://github.com/lujun9972
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/ch01.svg__0.png?itok=98wPcbAc (List files on your computer)

View File

@ -0,0 +1,249 @@
[#]: subject: (Use OpenCV on Fedora Linux part 1)
[#]: via: (https://fedoramagazine.org/use-opencv-on-fedora-linux-part-1/)
[#]: author: (Onuralp SEZER https://fedoramagazine.org/author/thunderbirdtr/)
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
Use OpenCV on Fedora Linux part 1
======
![][1]
Cover image excerpted from Starry Night by [Vincent van Gogh][2], Public domain, via Wikimedia Commons
The technology world changes daily and the demands for computer vision, artificial intelligence, and machine learning are increasing. The technology that allows computers and mobile phones to see their surroundings is called [computer vision][3]. Work on re-creating a human eye started in the 50s. Since then, computer vision technology has come a long way. Computer vision has already made its way to our mobile phones via different applications. This article will introduce [OpenCV][4] on Fedora Linux.
### **What is OpenCV?**
> OpenCV (Open Source Computer Vision Library) is an open-source computer vision and machine learning software library. OpenCV was built to provide a common infrastructure for computer vision applications and to accelerate the use of machine perception in the commercial products. It has more than 2500 optimized algorithms, which includes a comprehensive set of both classic and state-of-the-art computer vision and machine learning algorithms. These algorithms can be used to detect and recognize faces, identify objects, classify human actions in videos and establish markers to overlay it with augmented reality and much more.
>
> [opencv.org about][5]
### Install OpenCV on Fedora Linux
To get started with OpenCV, install it from the Fedora Linux repositories.
```
$ sudo dnf install opencv opencv-contrib opencv-doc python3-opencv python3-matplotlib python3-numpy
```
**Note:** On Fedora Silverblue or CoreOs, Python 3.9 is part of the core commit. Layer OpenCV and required tools with: _rpm-ostree install opencv opencv-doc python3-opencv python3-matplotlib python3-numpy_.
Next, enter the following commands in a terminal to verify that OpenCV is installed (user input shown in bold).
```
$ python
Python 3.9.6 (default, Jul 16 2021, 00:00:00)
[GCC 11.1.1 20210531 (Red Hat 11.1.1-3)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import cv2 as cv
>>> print( cv.__version__ )
4.5.2
>>> exit()
```
The current OpenCV version should be displayed when you enter the _print_ command as shown above. This indicates that OpenCV and the Python-OpenCV libraries have been installed successfully.
Additionally, if you want to take notes and write code with Jupyter Notebook and learn more about data science tools, check out the earlier Fedora Magazine article: [_Jupyter and Data Science in Fedora_][6].
### Get started with OpenCV
After installation is complete, load a sample image using Python and the OpenCV libraries (press the **S** key to save a copy of the image in _png_ format and finish the program):
```
$ cp /usr/share/opencv4/samples/data/starry_night.jpg .
$ python starry_night.py
```
Contents of _starry_night.py_:
```
import cv2 as cv
import sys
img = cv.imread(cv.samples.findFile("starry_night.jpg"))
if img is None:
sys.exit("Could not read the image.")
cv.imshow("Display window", img)
k = cv.waitKey(0)
if k == ord("s"):
cv.imwrite("starry_night.png", img)
```
![][7]
Gray-scale the image by adding the parameter **0** to the _cv.imread_ function as shown below.
```
img = cv.imread(cv.samples.findFile("starry_night.jpg"),0)
```
![][8]
These are some alternative values that can be used for the second parameter of the _cv.imread_ function.
* **cv2.IMREAD_GRAYSCALE** or **0:** Load the image in grayscale mode.
* **cv2.IMREAD_COLOR** or **1:** Load the image in color mode. Any transparency in the image will be removed. This is the default.
* **cv2.IMREAD_UNCHANGED** or **-1:** Load the image unaltered; including alpha channel.
#### Display image attributes using OpenCV
Image attributes include the number of rows, columns, and channels; the type of image data; the number of pixels; etc. Suppose you wanted to access the images shape and its datatype. This is how you would do it:
```
import cv2 as cv
img = cv.imread(cv.samples.findFile("starry_night.jpg"))
print("Image size is", img.shape)
print("Data type of image is", img.dtype)
Image size is (600, 752, 3)
Data type of image is uint8
print(f"Image 2D numpy array \n {img}")
Image 2D numpy array
[[[0 0 0]
[0 0 0]
[0 0 0]
...
[0 0 0]
[0 0 0]
[0 0 0]]
[[0 0 0]
[0 0 0]
[0 0 0]
...
```
* **img.shape:** return a tuple of the number of rows, columns, and channels (if it is a color image)
* **img.dtype:** return the datatype of the image
Next display image with Matplotlib:
```
import cv2 as cv
import matplotlib.pyplot as plt
img = cv.imread(cv.samples.findFile("starry_night.jpg"),0)
plt.imshow(img)
plt.show()
```
![][9]
#### What happened?
The image was read in as a gray-scale image, however it wont necessarily display in gray-scale when using Matplotlibs _imshow_ fucntion. This is because the _imshow_ function uses a different color map by default. To specify that a gray-scale color map should be used, set the second parameter of the _imshow_ function to _cmap=gray_ as shown below.
```
plt.imshow(img,cmap='gray')
```
![][10]
This problem is also going to happen when opening a picture in color mode because Matplotlib expects the image in RGB (red, green, blue) format whereas OpenCV stores images in BGR (blue, green, red) format. For correct display, you need to reverse the channels of the BGR image.
```
import cv2 as cv
import matplotlib.pyplot as plt
img = cv.imread(cv.samples.findFile("starry_night.jpg"),cv.IMREAD_COLOR)
fig, (ax1, ax2) = plt.subplots(1,2)
ax1.imshow(img)
ax1.set_title('BGR Colormap')
ax2.imshow(img[:,:,::-1])
ax2.set_title('Reversed BGR Colormap(RGB)')
plt.show()
```
![][11]
#### Splitting and merging color channels
```
import cv2 as cv
import matplotlib.pyplot as plt
img = cv.imread(cv.samples.findFile("starry_night.jpg"),cv.IMREAD_COLOR)
b,g,r = cv.split(img)
fig,ax = plt.subplots(2,2)
ax[0,0].imshow(r,cmap='gray')
ax[0,0].set_title("Red Channel");
ax[0,1].imshow(g,cmap='gray')
ax[0,1].set_title("Green Channel");
ax[1,0].imshow(b,cmap='gray')
ax[1,0].set_title("Blue Channel");
# Merge the individual channels into a BGR image
imgMerged = cv.merge((b,g,r))
# Show the merged output
ax[1,1].imshow(imgMerged[:,:,::-1])
ax[1,1].set_title("Merged Output");
plt.show()
```
![][12]
* **cv2.split:** Divide a multi-channel array into several single-channel arrays.
* **cv2.merge:** Merge several arrays to make a single multi-channel array. All the input matrices must have the same size.
**Note:** Images with more white have a higher density of color. Contrarily, images with more black have a lower density of color. In the above example the red color has the lowest density.
#### Converting to different color spaces
The _cv2.cvtColor_ function converts an input image from one color space to another. When transforming between the RGB and BGR color spaces, the order of the channels should be specified explicitly (_RGB2BGR_ or _BGR2RGB_). **Note that the default color format in OpenCV is often referred to as RGB but it is actually BGR (the bytes are reversed).** So the first byte in a standard (24-bit) color image will be an 8-bit blue component, the second byte will be green, and the third byte will be red. The fourth, fifth, and sixth bytes would then be the second pixel (blue, then green, then red), and so on.
```
import cv2 as cv
import matplotlib.pyplot as plt
img = cv.imread(cv.samples.findFile("starry_night.jpg"),cv.IMREAD_COLOR)
img_rgb = cv.cvtColor(img, cv.COLOR_BGR2RGB)
plt.imshow(img_rgb)
plt.show()
```
![][13]
### Further information
More details on OpenCV are available in the [online documentation][14].
Thank you.
--------------------------------------------------------------------------------
via: https://fedoramagazine.org/use-opencv-on-fedora-linux-part-1/
作者:[Onuralp SEZER][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://fedoramagazine.org/author/thunderbirdtr/
[b]: https://github.com/lujun9972
[1]: https://fedoramagazine.org/wp-content/uploads/2021/08/starry-night-1-816x345.jpg
[2]: https://commons.wikimedia.org/wiki/File:Van_Gogh_-_Starry_Night_-_Google_Art_Project.jpg
[3]: https://en.wikipedia.org/wiki/Computer_vision
[4]: https://en.wikipedia.org/wiki/OpenCV
[5]: https://opencv.org/about/
[6]: https://fedoramagazine.org/jupyter-and-data-science-in-fedora/
[7]: https://fedoramagazine.org/wp-content/uploads/2021/06/image.png
[8]: https://fedoramagazine.org/wp-content/uploads/2021/06/image-1.png
[9]: https://fedoramagazine.org/wp-content/uploads/2021/06/image-2.png
[10]: https://fedoramagazine.org/wp-content/uploads/2021/06/image-3.png
[11]: https://fedoramagazine.org/wp-content/uploads/2021/06/image-4.png
[12]: https://fedoramagazine.org/wp-content/uploads/2021/06/image-5.png
[13]: https://fedoramagazine.org/wp-content/uploads/2021/06/image-7.png
[14]: https://docs.opencv.org/4.5.2/index.html

View File

@ -0,0 +1,127 @@
[#]: subject: (How to Install Google Chrome on Linux Mint [Beginners Tip])
[#]: via: (https://itsfoss.com/install-chrome-linux-mint/)
[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/)
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
How to Install Google Chrome on Linux Mint [Beginners Tip]
======
This should be a really simple topic but I am writing this because I see so many websites recommending strange command line steps for installing Google Chrome on Linux Mint. That would work but thats unnecessarily complicated, specially for beginners not familiar with the command line.
In reality, you dont need to go terminal way at all. All you have to do is to go to Google Chromes website and download the installer file for Ubuntu and install it.
Let me detail the steps for your understanding.
### Installing Google Chrome on Linux Mint
Go to the website of Google Chrome.
[Google Chrome Website][1]
Youll see a “Download Chrome” button here. Click on it.
![Download Chrome for Linux][2]
It will show you two option for downloading Chrome on Linux. Go with the Debian/Ubuntu option and hit the “Accept and Install” button.
![Select Debian/Ubuntu option for Chrome package on Mint][3]
Before starting the download, Firefox asks you if you want to open the downloaded file with Gdebi or save it. You can go with either option because ultimately, youll be [using Gdebi for installing the deb file][4]. However, I prefer to save the file first.
![Save the deb file][5]
Wait for the download to finish.
![Wait for Google Chrome download to finish][6]
Once the download finishes, go to the Downloads folder in File Explorer. To [install the deb file][7], either double click on it or right click on it and select Open With GDebi Package Installer.
![Double click on the downloaded deb file to install it][8]
Wait for a few seconds and it should give you the option to install.
![Hit the Install Package option in Gdebi][9]
It will ask for Linux Mint account password. In Linux, you need to provide your password for installing any application.
![Enter your password for installing an application][10]
You are almost there. It will show what additional packages will be installed with it (if any). Just hit the Continue button.
![Details on the packages to be installed][11]
It should take a few seconds or a minute at most for installation to complete.
![Installing Chrome in progress][12]
You should see a screen like this when the installation completes.
![Chrome successfully installed on Linux Mint][13]
Once installed, you can run Google Chrome by looking for it in the application menu.
![Run Google Chrome in Linux Mint][14]
And then enjoy Google Chrome on Linux Mint.
![Google Chrome running in Linux Mint][15]
### How to update Google Chrome on Linux Mint
The good thing about this method is that Google Chrome gets updated with system updates. When you install the deb file, it also adds a repository from Google to your system.
![Chrome adds a repository to the system for providing updates][16]
Thanks to this added repository, the updates on the Chrome browser will be added to the system updates. So when you update Linux Mint, it gets updated as well (if there is an update available).
### How to remove Google Chrome from Linux Mint
Dont like Chrome? No worries. You can uninstall Google Chrome from Linux Mint. And no, you dont need to use terminal this time as well.
Click on the menu and search for Chrome. Right click on the Chrome icon and youll see an Uninstall option. Select it.
![Removing Google Chrome from Linux Mint][17]
Youll have to enter your password, of course. It will show the package to be removed. Click OK here.
![Uninstalling Google Chrome from Linux mint][18]
You may leave the repo from Google Chrome or remove it. Its your choice, really.
I hope you find this tutorial helpful in using Google Chrome on Linux Mint.
--------------------------------------------------------------------------------
via: https://itsfoss.com/install-chrome-linux-mint/
作者:[Abhishek Prakash][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/abhishek/
[b]: https://github.com/lujun9972
[1]: https://www.google.com/chrome/index.html
[2]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/08/download-chrome-linux-mint.png?resize=800%2C320&ssl=1
[3]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/08/downloading-chrome-linux-mint.png?resize=800%2C679&ssl=1
[4]: https://itsfoss.com/gdebi-default-ubuntu-software-center/
[5]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/08/saving-downloaded-chrome-linux-mint.png?resize=798%2C400&ssl=1
[6]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/08/finishing-chrome-download-linux-mint.png?resize=799%2C315&ssl=1
[7]: https://itsfoss.com/install-deb-files-ubuntu/
[8]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/08/installing-google-chrome-deb-file-mint.png?resize=799%2C529&ssl=1
[9]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/08/installing-google-chrome-gdebi-mint.png?resize=801%2C548&ssl=1
[10]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/08/enter-password-for-installing-chrome-mint.png?resize=800%2C399&ssl=1
[11]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/08/installing-chrome-mint.png?resize=799%2C483&ssl=1
[12]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/08/installing-chrome-mint-progress.png?resize=799%2C489&ssl=1
[13]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/08/chrome-installed-mint.png?resize=798%2C483&ssl=1
[14]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/08/run-google-chrome-linux-mint.png?resize=798%2C580&ssl=1
[15]: https://itsfoss.com/wp-content/uploads/2021/08/google-chrome-in-linux-mint-800x450.webp
[16]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/08/google-chrome-repo-added-mint.png?resize=799%2C272&ssl=1
[17]: https://itsfoss.com/wp-content/uploads/2021/08/removing-google-chrome-from-mint.webp
[18]: https://itsfoss.com/wp-content/uploads/2021/08/uninstalling-google-chrome-from-linux-mint.webp

View File

@ -0,0 +1,113 @@
[#]: subject: (Mount Microsoft OneDrive in Linux With OneDriver GUI Tool)
[#]: via: (https://itsfoss.com/onedriver/)
[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/)
[#]: collector: (lujun9972)
[#]: translator: (geekpi)
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
Mount Microsoft OneDrive in Linux With OneDriver GUI Tool
======
On Windows, Microsoft provides a [free cloud storage service][1] in the form of OneDrive. It comes integrated with Windows and you get 5 GB of free storage with your Microsoft account.
This works great on Windows but like Google, Microsoft also does not provide a native client for OneDrive on Linux desktop.
You can access your OneDrive data through browser, of course. In addition to that, there are some other ways to access OneDrive on Linux.
You can use a premium service like [Insync][2] or opt for a slightly more complicated command line approach with [rclone to use OneDrive on Linux][3].
Recently, I came across another tool that is slightly different and slightly easier to use. Its unsurprisingly called OneDriver.
### OneDriver: Mount OneDrive on your Linux system
![OneDrive Linux illustration][4]
[OneDriver][5] is a free and open source tool that allows you to mount your OneDrive files on your Linux system.
Please keep in mind that it does not sync files in the same way OneDrive does on the Windows system. It mounts the OneDrive files on a local mount point instead. You access the files over the network.
However, it does provide a kind of hybrid approach here. The files you open in the mounted OneDrive also get downloaded on the system. Which means that you can access the opened files offline as well. The files become read-only if you are not connected to the internet.
If you make any changes to files locally, it gets reflected on the OneDrive if you are connected to the internet.
I did notice that in Nautilus file manager on GNOME, it downloads the images present in the current folder automatically. I was under the impression that they will only be downloaded when I open them.
Another thing is that Nautilus builds thumbnail cache initially. OneDriver may feel a little bit slower and resource consuming in the beginning, but it gets better eventually.
Oh! You can also mount multiple OneDrive accounts.
### Installing and using OneDriver
To install OneDriver on Ubuntu 20.04 (and Linux Mint 20 series), you can use this PPA by the developer of OneDriver:
```
sudo add-apt-repository ppa:jstaf/onedriver
sudo apt update
sudo apt install onedriver
```
For Ubuntu 21.04, you may use it by downloading the [DEB file from its PPA][6].
On Fedora, you can add this COPR:
```
sudo dnf copr enable jstaf/onedriver
sudo dnf install onedriver
```
Arch users can find it in the AUR.
Once you install it, search for OneDriver in the menu and start it from here.
![Search for OneDriver][7]
On the first run, it gives a strange looking empty interface. Click on the + sign and choose a folder or create a new one where youll mount the OneDrive. In my case, I created a new folder named One_drive in my home directory.
![Click on + sign to add a mount point for OneDrive][8]
When you have selected the mount point, you will be asked to enter your Microsoft credential.
![one drive login][9]
![one drive permission][10]
Once you are successfully logged in, you can see your files from OneDrive in the mounted directory.
![OneDrive mounted in Linux][11]
Once you have done that, you can see your OneDrive account on the application interface. Click on the toggle button beside it to autostart OneDrive mounting after restart.
![Autostart OneDriver mounting][12]
Overall, OneDriver is a nice free utility for accessing OneDrive on Linux. It may not provide the complete sync facility like the [premium Insync service][13] but it works fine for limited needs.
If you use this nifty tool, do share your experience with it. If you like project, maybe give it a [star on GitHub][5].
--------------------------------------------------------------------------------
via: https://itsfoss.com/onedriver/
作者:[Abhishek Prakash][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/abhishek/
[b]: https://github.com/lujun9972
[1]: https://itsfoss.com/cloud-services-linux/
[2]: https://itsfoss.com/use-onedrive-on-linux/
[3]: https://itsfoss.com/use-onedrive-linux-rclone/
[4]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/08/one-drive-linux.png?resize=800%2C450&ssl=1
[5]: https://github.com/jstaf/onedriver
[6]: https://launchpad.net/~jstaf/+archive/ubuntu/onedriver/+packages
[7]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/08/search-for-onedriver.png?resize=798%2C214&ssl=1
[8]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/08/onedriver-interface.png?resize=745%2C456&ssl=1
[9]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/08/one-drive-login.png?resize=470%2C660&ssl=1
[10]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/08/one-drive-permission.png?resize=470%2C660&ssl=1
[11]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/08/one-drive-mounted-in-linux.png?resize=800%2C491&ssl=1
[12]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/08/auto-start-onedriver.png?resize=602%2C499&ssl=1
[13]: https://itsfoss.com/recommends/insync/

View File

@ -0,0 +1,132 @@
[#]: subject: "Reading and writing files with Python"
[#]: via: "https://opensource.com/article/21/7/read-write-files-python"
[#]: author: "Seth Kenlon https://opensource.com/users/seth"
[#]: collector: "lujun9972"
[#]: translator: "MjSeven"
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
Python 读写文件
======
每种编程语言处理数据文件的方式都不同Python 是这么干的。
![Hands on a keyboard with a Python book ][1]
有些数据是临时的,它们在应用程序运行时存储在 RAM 中,然后丢弃。但是有些数据是持久的。它们存储在硬盘驱动器上供以后使用,而且它们通常是用户最关心的东西。对于程序员来说,编写代码读写文件是很常见的,但每种语言处理这个任务的方式都有些不同。本文演示了如何使用 Python 处理数据文件。
### 安装Python
在 Linux 上,你可能已经安装了 Python。如果没有你可以从发行版软件仓库安装它。例如在 CentOS 或 RHEL 上:
```bash
$ sudo dnf install python3
```
在 macOS 上,你可以使用 [MacPorts][2] 或 [Homebrew][3] 安装。在 Windows 上,你可以使用 [Chocolatey][4] 安装。
一旦安装了 Python打开你最喜欢的文本编辑器准备好写代码吧。
### 使用 Python 向文件中写入数据
如果你需要向一个文件中写入数据,记住有三个步骤:
1. Open
2. Write
3. Close
这与你在计算机上写代码、编辑照片或执行其他操作时使用的步骤完全相同。首先,打开要编辑的文档,然后进行编辑,最后关闭文档。
在 Python 中,过程是这样的:
```python
f = open('example.txt', 'w')
f.write('hello world')
f.close()
```
这个例子中,第一行以**写**模式打开了一个文件,然后用变量 `f` 表示,我使用了 `f` 是因为它在 Python 代码中很常见,但其他任意有效变量名也能正常工作。
在打开文件时,有不同的模式:
* **w** 代表写入
* **r+** 代表可读可写
* **a** 表示追加
第二行表示向文件中写入数据,本例写入的是纯文本,但你可以写入任意类型的数据。
最后一行关闭了文件。
### 使用 'with' 语法写入数据
有一种简短的方法可以写入数据,对于快速的文件交互很有用。它不会使文件保持打开状态,所以你不必记得调用 **close()** 函数。相反,它使用 **with** 语法:
```python
with open('example.txt', 'a') as f:
    f.write('hello open source')
```
### 使用 Python 读取数据
如果你或你的用户需要通过应用程序需要向文件中写入一些数据,然后你需要使用它们,那么你就需要读取文件了。与写入类似,逻辑一样:
1. Open
2. Read
3. Close
同样的,这个逻辑反映了你一开始使用计算机就已经知道的内容。阅读文档,你可以打开、阅读,然后关闭。在计算机术语中,”打开“文件意味着将其加载到内存中。
实际上,一个文本文件内容肯定不止一行。例如,你需要读取一个配置文件、游戏保存的数据或乐队下一首歌曲的歌词,正如你打开一本实体书时,你不可能立刻读完整本书,代码也只能解析已经加载到内存中的文件。因此,你可能需要遍历文件的内容。
```python
f = open('example.tmp', 'r')
for line in f:
    print(line)
f.close()
```
示例的第一行表示使用 **读** 模式打开一个文件,然后文件交由变量 `f` 表示,但就像你写数据一样,变量名是任意的。`f` 并没有什么特殊的,它只是单词 "file" 的最简表示,所以 Python 程序员会经常使用它。
在第二行,我们使用了 `line`,另一个任意变量名,用来表示 `f` 的每一行。这告诉 Python 逐行迭代文件的内容,并将每一行的内容打印到输出中(在本例中为终端或 [IDLE][5])。
### 使用 'with' 语法读取数据
就像写入一样,使用 `with` 语法是一种更简短的方法读取数据。即不需要调用 **close()** 方法,方便地快速交互。
```python
with open('example.txt', 'r') as f:
    for line in f:
        print(line)
```
### 文件和 Python
使用 Python 有很多方法向文件写入数据,包括用 [JSON、YAML、TOML][6] 等不同的格式写入。还有一个非常好的内置方法用于创建和维护 [SQLite][7] 数据库,以及许多库来处理不同的文件格式,包括[图像][8]、音频和视频等。
--------------------------------------------------------------------------------
via: https://opensource.com/article/21/7/read-write-files-python
作者:[Seth Kenlon][a]
选题:[lujun9972][b]
译者:[MjSeven](https://github.com/MjSeven)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://opensource.com/users/seth
[b]: https://github.com/lujun9972
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/python-programming-code-keyboard.png?itok=fxiSpmnd "Hands on a keyboard with a Python book "
[2]: https://opensource.com/article/20/11/macports
[3]: https://opensource.com/article/20/6/homebrew-mac
[4]: https://opensource.com/article/20/3/chocolatey
[5]: https://opensource.com/article/17/10/python-101#idle
[6]: https://opensource.com/article/21/6/parse-configuration-files-python
[7]: https://opensource.com/article/21/2/sqlite3-cheat-sheet
[8]: https://opensource.com/article/19/3/python-image-manipulation-tools

View File

@ -0,0 +1,159 @@
[#]: subject: (How to Upgrade to Debian 11 from Debian 10)
[#]: via: (https://www.debugpoint.com/2021/07/upgrade-debian-11-from-debian-10/)
[#]: author: (Arindam https://www.debugpoint.com/author/admin1/)
[#]: collector: (lujun9972)
[#]: translator: (geekpi)
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
如何从 Debian 10 升级到 Debian 11
======
本指南解释了从 Debian 10 升级到 Debian 11 的步骤。
[Debian][1] 的发布是很罕见的。因为它往往是来自社区的多年努力。这就是为什么 Debian 是真正的通用操作系统,并且在稳定性方面坚如磐石。
[Debian 11][2],代号 Bullseye即将正式发布。2021 年 7 月 15 日Debian 11 进入完全冻结状态,这意味着发行在即。虽然官方日期还没有最终确定,但你现在就可以从 Debian 10 安装或升级到 Debian 11。
以下是方法。
### 前提条件
* 升级的过程非常简单明了。然而,采取某些预先注意事项是一个好的做法。特别是如果你正在升级一台服务器。
* 对你的系统进行备份,包括所有重要的数据和文件。
* 尝试禁用/删除你可能在一段时间内添加的任何外部仓库PPA。你可以在升级后逐一启用它们。
* 关闭所有正在运行的应用。
* 停止任何你可能已经启用的运行中的服务。升级完成后,你可以通过 [systemctl][3] 启动它们。这包括网络服务器、SSH 服务器、FTP 服务器或任何其他服务器。
* 确保你有稳定的互联网连接。
* 你的系统有足够的停机时间。因为根据你的系统配置Debian 版本升级需要时间大约在 1.5 小时到 2 小时之间。
### 将 Debian 10 Buster 升级到 11 Bullseye
* 确保你的系统是最新的,而且你的软件包列表是最新的。
```
sudo apt update && sudo apt upgrade
```
* 使用下面的命令安装 gcc-8-base 包。这是必须的,因为在历史上曾出现过升级失败的情况,这是因为下面的软件包中包含了某些依赖。
```
sudo apt install gcc-8-base
```
![upgrade debian system check][4]
* 打开 /etc/apt/sources.list通过注释 Debian 10 buster 包,而使用 bullseye 仓库进行更新。
* 注释所有的 buster 仓库,在行的开头加上 “#”。
![Comment the Debian 10 lines][5]
* 在文件的末尾添加以下几行。
```
deb http://deb.debian.org/debian bullseye main contrib non-free
deb http://deb.debian.org/debian bullseye-updates main contrib non-free
deb http://security.debian.org/debian-security bullseye-security main
deb http://ftp.debian.org/debian bullseye-backports main contrib non-free
```
![Add Debian 11 lines][6]
* 按 Ctrl + O 保存文件,按 Ctrl + X 退出 nano。
* 更新一次系统仓库列表,以验证仓库的添加情况。
```
sudo apt update
```
* 如果上面的命令没有出现任何错误,那么你已经成功地添加了 bullseye 仓库。
* 现在,通过运行下面的命令开始升级过程。基本安装的下载大小约为 1.2GB。这可能会根据你的系统配置而有所不同。
```
sudo apt full-upgrade
```
![Debian upgrade start][7]
* 这个命令需要时间。但不要让系统无人看管。因为升级过程中需要各种输入。
![lib6 config][8]
![sudoers file][9]
* 完成后,你可以用以下命令重启系统。
```
systemctl reboot
```
* 重启后,运行以下命令,以确保你的系统是最新的,并且清理了所有不再需要的不必要的软件包。
```
sudo apt --purge autoremove
```
* 如果一切顺利,你应该看到 Debian 11 bullseye。你可以用下面的命令来验证版本
```
cat /etc/os-release
```
![Debian 11 after upgrade][10]
### 结束语
我希望这个指南能帮助你将你的系统升级到 Debian 11 bullseye。如果你遇到任何问题请在下面的评论栏告诉我。
--------------------------------------------------------------------------------
via: https://www.debugpoint.com/2021/07/upgrade-debian-11-from-debian-10/
作者:[Arindam][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.debugpoint.com/author/admin1/
[b]: https://github.com/lujun9972
[1]: https://www.debian.org/
[2]: https://www.debugpoint.com/2021/05/debian-11-features/
[3]: https://www.debugpoint.com/2020/12/systemd-systemctl-service/
[4]: https://www.debugpoint.com/blog/wp-content/uploads/2021/07/upgrade-debian-system-check-1024x503.jpeg
[5]: https://www.debugpoint.com/blog/wp-content/uploads/2021/07/Cpmment-the-Debian-10-lines-1024x636.jpeg
[6]: https://www.debugpoint.com/blog/wp-content/uploads/2021/07/Add-Debian-11-lines-1024x635.jpeg
[7]: https://www.debugpoint.com/blog/wp-content/uploads/2021/07/Debian-upgrade-start-1024x226.jpeg
[8]: https://www.debugpoint.com/blog/wp-content/uploads/2021/07/lib6-config-1024x195.jpeg
[9]: https://www.debugpoint.com/blog/wp-content/uploads/2021/07/sudoers-file.jpeg
[10]: https://www.debugpoint.com/blog/wp-content/uploads/2021/07/Debian-11-after-upgrade.jpeg

View File

@ -3,18 +3,18 @@
[#]: author: (Seth Kenlon https://opensource.com/users/seth)
[#]: collector: (lujun9972)
[#]: translator: (geekpi)
[#]: reviewer: ( )
[#]: reviewer: (turbokernel)
[#]: publisher: ( )
[#]: url: ( )
用 du 检查 Linux 上已使用的磁盘空间
使用 du 检查 Linux 上已用的磁盘空间
======
用 Linux 的 du 命令了解你正在使用多少磁盘空间。
![Check disk usage][1]
无论你有多少存储空间,它总有可能被填满。在大多数个人设备上,驱动器被照片、视频和音乐填满,但在服务器上,由于用户账户和日志文件中的数据,空间减少是很正常的。无论你是负责管理一个多用户系统,还是只负责自己的笔记本电脑,你都可以用 `du` 命令检查磁盘的使用情况。
无论你有多少存储空间,它总有可能被填满。在大多数个人设备上,磁盘被照片、视频和音乐填满,但在服务器上,由于用户账户和日志文件数据,空间减少是很正常的。无论你是负责管理一个多用户系统,还是只负责自己的笔记本电脑,你都可以用 `du` 命令检查磁盘的使用情况。
默认情况下,`du` 提供了你当前目录中使用的磁盘空间,以及每个子目录的大小。
默认情况下,`du` 列出了当前目录中使用的磁盘空间,以及每个子目录的大小。
```
@ -23,7 +23,7 @@ $ du
60 .
```
在这个例子中,我的当前目录总共占用了 60KB其中 12KB 被子目录 `.backups` 占用。
在这个例子中,当前目录总共占用了 60KB其中 12KB 被子目录 `.backups` 占用。
如果你觉得这很混乱,并希望分别看到所有的大小,你可以使用 `--separate-dirs`(或简写 `S`)选项:
@ -34,9 +34,9 @@ $ du --separate-dirs
48 .
```
这是相同的信息48 加 12 是 60),但每个目录被独立处理。
显示相同的信息48KB 加 12KB 是 60KB),但每个目录被独立处理。
要想看到更多的细节,可以使用 --all简写 -a选项它显示每个目录中的每个文件:
如需看到更多的细节,可以使用 --all简写 -a选项它显示每个目录中以及每个文件:
```
@ -54,7 +54,7 @@ $ du --separate-dirs --all
当查看文件以找出占用空间的内容时,查看文件最后一次被修改的时间是很有用的。一年内没有使用的文件很可能是归档的候选文件,特别是当你的空间快用完时。
du 查看文件的修改时间,使用 `--time` 选项:
通过 du 查看文件的修改时间,使用 `--time` 选项:
```
@ -68,7 +68,7 @@ $ du --separate-dirs --all --time
### 为文件大小设置一个阈值
当为了磁盘空间而查看文件时,你可能只关心较大的文件。你可以 `--threshold`(简写 `-t`)选项为你想看的文件大小设置一个阈值。例如,只查看大于 1GB 的文件:
当为了磁盘空间而查看文件时,你可能只关心较大的文件。你可以通过 `--threshold`(简写 `-t`)选项为文件大小设置一个阈值。例如,只查看大于 1GB 的文件:
```
@ -78,7 +78,7 @@ $ \du --separate-dirs --all --time --threshold=1G ~/Footage/
8588936 2021-07-14 13:55 /home/tux/Footage/
```
当文件特别大时,它们可能难以阅读。使用 `--human-readable`(简写 `-h`)选项可以使文件大小更容易阅读:
当文件大时,它们可能难以阅读。使用 `--human-readable`(简写 `-h`)选项可以使文件大小更容易阅读:
```
@ -91,7 +91,7 @@ $ \du --separate-dirs --all --time \
### 查看可用磁盘空间
果只是想获得一个驱动器上还剩下多少磁盘空间的摘要,请阅读我们关于 [df 命令][2]的文章。
需获得一个驱动器上可用磁盘空间的摘要,请阅读我们关于 [df 命令][2]的文章。
--------------------------------------------------------------------------------
@ -100,7 +100,7 @@ via: https://opensource.com/article/21/7/check-disk-space-linux-du
作者:[Seth Kenlon][a]
选题:[lujun9972][b]
译者:[geekpi](https://github.com/geekpi)
校对:[校对者ID](https://github.com/校对者ID)
校对:[turbokernel](https://github.com/turbokernel)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出