mirror of
https://github.com/LCTT/TranslateProject.git
synced 2025-03-21 02:10:11 +08:00
Merge remote-tracking branch 'LCTT/master'
This commit is contained in:
commit
ac7ab26718
@ -1,102 +0,0 @@
|
||||
translating by Auk7F7
|
||||
How to set GNOME to display a custom slideshow
|
||||
======
|
||||
A very cool, yet lesser known, feature in GNOME is its ability to display a slideshow as your wallpaper. You can select a wallpaper slideshow from the background settings panel in the [GNOME Control Center][1]. Wallpaper slideshows can be distinguished from static wallpapers by a small clock emblem displayed in the lower-right corner of the preview.
|
||||
|
||||
Some distributions come with pre-installed slideshow wallpapers. For example, Ubuntu includes the stock GNOME timed wallpaper slideshow, as well as one of Ubuntu wallpaper contest winners.
|
||||
|
||||
What if you want to create your own custom slideshow to use as a wallpaper? While GNOME doesn't provide a user interface for this, it's quite simple to create one using some simple XML files in your home directory. Fortunately, the background selection in the GNOME Control Center honors some common directory paths, which makes it easy to create a slideshow without having to edit anything provided by your distribution.
|
||||
|
||||
### Getting started
|
||||
|
||||
Using your favorite text editor, create an XML file in `$HOME/.local/share/gnome-background-properties/`. Although the filename isn't important, the directory name matters (and you'll probably have to create the directory). For my example, I created `/home/ken/.local/share/gnome-background-properties/osdc-wallpapers.xml `with the following content:
|
||||
```
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE wallpapers SYSTEM "gnome-wp-list.dtd">
|
||||
<wallpapers>
|
||||
<wallpaper deleted="false">
|
||||
<name>Opensource.com Wallpapers</name>
|
||||
<filename>/home/ken/Pictures/Wallpapers/osdc/osdc.xml</filename>
|
||||
<options>zoom</options>
|
||||
</wallpaper>
|
||||
</wallpapers>
|
||||
```
|
||||
|
||||
The above XML file needs a `<wallpaper>` stanza for each slideshow or static wallpaper you want to include in the `backgrounds` panel of the GNOME Control Center.
|
||||
|
||||
In this example, my `osdc.xml` file looks like this:
|
||||
|
||||
```
|
||||
<?xml version="1.0" ?>
|
||||
<background>
|
||||
<static>
|
||||
<!-- Duration in seconds to display the background -->
|
||||
<duration>30.0</duration>
|
||||
<file>/home/ken/Pictures/Wallpapers/osdc/osdc_2.png</file>
|
||||
</static>
|
||||
<transition>
|
||||
<!-- Duration of the transition in seconds, default is 2 seconds -->
|
||||
<duration>0.5</duration>
|
||||
<from>/home/ken/Pictures/Wallpapers/osdc/osdc_2.png</from>
|
||||
<to>/home/ken/Pictures/Wallpapers/osdc/osdc_1.png</to>
|
||||
</transition>
|
||||
<static>
|
||||
<duration>30.0</duration>
|
||||
<file>/home/ken/Pictures/Wallpapers/osdc/osdc_1.png</file>
|
||||
</static>
|
||||
<transition>
|
||||
<duration>0.5</duration>
|
||||
<from>/home/ken/Pictures/Wallpapers/osdc/osdc_1.png</from>
|
||||
<to>/home/ken/Pictures/Wallpapers/osdc/osdc_2.png</to>
|
||||
</transition>
|
||||
</background>
|
||||
```
|
||||
|
||||
There are a few important pieces in the above XML. The `<background>` node in the XML is your outer node. Each background supports multiple `<static>` and `<transition>` nodes.
|
||||
|
||||
The `<static>` node defines an image to be displayed and the duration to display it with `<duration>` and `<file>` nodes, respectively.
|
||||
|
||||
The `<transition>` node defines the `<duration>`, the `<from>` image, and the `<to>` image for each transition.
|
||||
|
||||
### Changing wallpaper throughout the day
|
||||
|
||||
Another cool GNOME feature is time-based slideshows. You can define the start time for the slideshow and GNOME will calculate times based on it. This is useful for setting different wallpapers based on the time of day. For example, you could set the start time to 06:00 and display one wallpaper until 12:00, then change it for the afternoon, and again at 18:00.
|
||||
|
||||
This is accomplished by defining the `<starttime>` in your XML like this:
|
||||
```
|
||||
<starttime>
|
||||
<!-- A start time in the past is fine -->
|
||||
<year>2017</year>
|
||||
<month>11</month>
|
||||
<day>21</day>
|
||||
<hour>6</hour>
|
||||
<minute>00</minute>
|
||||
<second>00</second>
|
||||
</starttime>
|
||||
```
|
||||
|
||||
The above XML started the animation at 06:00 on November 21, 2017, with a duration of 21,600.00, equal to six hours. This displays your morning wallpaper until 12:00, at which time it changes to your next wallpaper. You can continue in this manner to change the wallpaper at any intervals you'd like throughout the day, but ensure the total of all your durations is 86,400 seconds (equal to 24 hours).
|
||||
|
||||
GNOME will calculate the delta between the start time and the current time and display the correct wallpaper for the current time. For example, if you select your new wallpaper at 16:00, GNOME will display the proper wallpaper for 36,000 seconds past the start time of 06:00.
|
||||
|
||||
For a complete example, see the adwaita-timed slideshow provided by the gnome-backgrounds package in most distributions. It's usually found in `/usr/share/backgrounds/gnome/adwaita-timed.xml`.
|
||||
|
||||
### For more information
|
||||
|
||||
Hopefully this encourages you to take a dive into creating your own slideshow wallpapers. If you would like to download complete versions of the files referenced in this article, they can be found on [GitHub][2].
|
||||
|
||||
If you're interested in utility scripts for generating the XML files, you can do an internet search for gnome-background-generator.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/17/12/create-your-own-wallpaper-slideshow-gnome
|
||||
|
||||
作者:[Ken Vandine][a]
|
||||
译者:[译者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/kenvandine
|
||||
[1]:http://manpages.ubuntu.com/manpages/xenial/man1/gnome-control-center.1.html
|
||||
[2]:https://github.com/kenvandine/misc/tree/master/articles/osdc/gnome/slide-show-backgrounds/osdc
|
@ -1,131 +0,0 @@
|
||||
Translating by MjSeven
|
||||
|
||||
10 fundamental commands for new Linux users
|
||||
======
|
||||
|
||||

|
||||
You may think you're new to Linux, but you're really not. There are [3.74 billion][1] global internet users, and all of them use Linux in some way since Linux servers power 90% of the internet. Most modern routers run Linux or Unix, and the [TOP500 supercomputers][2] also rely on Linux. If you own an Android smartphone, your operating system is constructed from the Linux kernel.
|
||||
|
||||
In other words, Linux is everywhere.
|
||||
|
||||
But there's a difference between using Linux-based technologies and using Linux itself. If you're interested in Linux, but have been using a PC or Mac desktop, you may be wondering what you need to know to use the Linux command line interface (CLI). You've come to the right place.
|
||||
|
||||
The following are the fundamental Linux commands you need to know. Each is simple and easy to commit to memory. In other words, you don't have to be Bill Gates to understand them.
|
||||
|
||||
### 1\. ls
|
||||
|
||||
You're probably thinking, "Is what?" No, that wasn't a typographical error – I really intended to type a lower-case L. `ls`, or "list," is the number one command you need to know to use the Linux CLI. This list command functions within the Linux terminal to reveal all the major directories filed under a respective filesystem. For example, this command:
|
||||
|
||||
`ls /applications`
|
||||
|
||||
shows every folder stored in the applications folder. You'll use it to view files, folders, and directories.
|
||||
|
||||
All hidden files are viewable by using the command `ls -a`.
|
||||
|
||||
### 2\. cd
|
||||
|
||||
This command is what you use to go (or "change") to a directory. It is how you navigate from one folder to another. Say you're in your Downloads folder, but you want to go to a folder called Gym Playlist. Simply typing `cd Gym Playlist` won't work, as the shell won't recognize it and will report the folder you're looking for doesn't exist. To bring up that folder, you'll need to include a backslash. The command should look like this:
|
||||
|
||||
`cd Gym\ Playlist`
|
||||
|
||||
To go back from the current folder to the previous one, you can type in the folder name followed by `cd ..`. Think of the two dots like a back button.
|
||||
|
||||
### 3\. mv
|
||||
|
||||
This command transfers a file from one folder to another; `mv` stands for "move." You can use this short command like you would drag a file to a folder on a PC.
|
||||
|
||||
For example, if I create a file called `testfile` to demonstrate all the basic Linux commands, and I want to move it to my Documents folder, I would issue this command:
|
||||
|
||||
`mv /home/sam/testfile /home/sam/Documents/`
|
||||
|
||||
The first piece of the command (`mv`) says I want to move a file, the second part (`home/sam/testfile`) names the file I want to move, and the third part (`/home/sam/Documents/`) indicates the location where I want the file transferred.
|
||||
|
||||
### 4\. Keyboard shortcuts
|
||||
|
||||
Okay, this is more than one command, but I couldn't resist including them all here. Why? Because they save time and take the headache out of your experience.
|
||||
|
||||
`CTRL+K` Cuts text from the cursor until the end of the line
|
||||
|
||||
`CTRL+Y` Pastes text
|
||||
|
||||
`CTRL+E` Moves the cursor to the end of the line
|
||||
|
||||
`CTRL+A` Moves the cursor to the beginning of the line
|
||||
|
||||
`ALT+F`Jumps forward to the next space
|
||||
|
||||
`ALT+B` Skips back to the previous space
|
||||
|
||||
`ALT+Backspace` Deletes the previous word
|
||||
|
||||
`CTRL+W` Cuts the word behind the cursor
|
||||
|
||||
`Shift+Insert` Pastes text into the terminal
|
||||
|
||||
`Ctrl+D` Logs you out
|
||||
|
||||
These commands come in handy in many ways. For example, imagine you misspell a word in your command text:
|
||||
|
||||
`sudo apt-get intall programname`
|
||||
|
||||
You probably noticed "install" is misspelled, so the command won't work. But keyboard shortcuts make it easy to go back and fix it. If my cursor is at the end of the line, I can click `ALT+B` twice to move the cursor to the place noted below with the `^` symbol:
|
||||
|
||||
`sudo apt-get^intall programname`
|
||||
|
||||
Now, we can quickly add the letter `s` to fix `install`. Easy peasy!
|
||||
|
||||
### 5\. mkdir
|
||||
|
||||
This is the command you use to make a directory or a folder in the Linux environment. For example, if you're big into DIY hacks like I am, you could enter `mkdir DIY` to make a directory for your DIY projects.
|
||||
|
||||
### 6\. at
|
||||
|
||||
If you want to run a Linux command at a certain time, you can add `at` to the equation. The syntax is `at` followed by the date and time you want the command to run. Then the command prompt changes to `at>` so you can enter the command(s) you want to run at the time you specified above
|
||||
|
||||
For example:
|
||||
|
||||
`at 4:08 PM Sat`
|
||||
`at> cowsay 'hello'`
|
||||
`at> CTRL+D`
|
||||
|
||||
This will run the program cowsay at 4:08 p.m. on Saturday night.
|
||||
|
||||
### 7\. rmdir
|
||||
|
||||
This command allows you to remove a directory through the Linux CLI. For example:
|
||||
|
||||
`rmdir testdirectory`
|
||||
|
||||
Bear in mind that this command will not remove a directory that has files inside. This only works when removing empty directories.
|
||||
|
||||
### 8\. rm
|
||||
|
||||
If you want to remove files, the `rm` command is what you want. It can delete files and directories. To delete a single file, type `rm testfile`, or to delete a directory and the files inside it, type `rm -r`.
|
||||
|
||||
### 9\. touch
|
||||
|
||||
The `touch` command, otherwise known as the "make file command," allows you to create new, empty files using the Linux CLI. Much like `mkdir` creates directories, `touch` creates files. For example, `touch testfile` will make an empty file named testfile.
|
||||
|
||||
### 10\. locate
|
||||
|
||||
This command is what you use to find a file in a Linux system. Think of it like search in Windows. It's very useful if you forget where you stored a file or what you named it.
|
||||
|
||||
For example, if you have a document about blockchain use cases, but you can't think of the title, you can punch in `locate -blockchain`or you can look for "blockchain use cases" by separating the words with an asterisk or asterisks (`*`). For example:
|
||||
|
||||
`locate -i*blockchain*use*cases*`.
|
||||
|
||||
There are tons of other helpful Linux CLI commands, like the `pkill` command, which is great if you start a shutdown and realize you didn't mean to. But the 10 simple and useful commands described here are the essentials you need to get started using the Linux command line.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/18/4/10-commands-new-linux-users
|
||||
|
||||
作者:[Sam Bocetta][a]
|
||||
译者:[译者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/sambocetta
|
||||
[1]:https://hostingcanada.org/state-of-the-internet/
|
||||
[2]:https://www.top500.org/statistics/details/osfam/1
|
@ -0,0 +1,105 @@
|
||||
|
||||
如何设置 GNOME 显示自定义幻灯片
|
||||
======
|
||||
在 GNOME 中, 一个非常酷, 但却鲜为人知的特性是它能够将幻灯片显示为墙纸。你可以从 [GNOME 控制中心][1]的 "背景设置" 面板中选择墙纸幻灯片。在预览的右下角显示一个小时钟标志, 可以将幻灯片的墙纸与静态墙纸区别开来。
|
||||
|
||||
一些发行版带有预装的幻灯片壁纸。 例如, Ubuntu 包含了库存的 GNOME 定时壁纸幻灯片, 以及 Ubuntu 壁纸大赛优胜者之一。
|
||||
|
||||
如果你想创建自己的自定义幻灯片用作壁纸怎么办? 虽然 GNOME 没有为此提供一个用户界面, 但是在你的主目录中使用一些简单的 XML 文件来创建一个是非常容易的。 幸运的是, GNOME 控制中心的背景选择支持一些常见的目录路径,这样就可以轻松创建幻灯片, 而不必编辑分发所提供的任何内容。
|
||||
|
||||
### 开始
|
||||
|
||||
使用你最喜欢的文本编辑器在 `$HOME/.local/share/gnome-background-properties/` 创建一个 XML 文件。 虽然文件名不重要, 但目录名称很重要(你可能需要创建目录)。 举个例子, 我创建了带有以下内容的 `/home/ken/.local/share/gnome-background-properties/osdc-wallpapers.xml `:
|
||||
|
||||
```
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE wallpapers SYSTEM "gnome-wp-list.dtd">
|
||||
<wallpapers>
|
||||
<wallpaper deleted="false">
|
||||
<name>Opensource.com Wallpapers</name>
|
||||
<filename>/home/ken/Pictures/Wallpapers/osdc/osdc.xml</filename>
|
||||
<options>zoom</options>
|
||||
</wallpaper>
|
||||
</wallpapers>
|
||||
```
|
||||
上面的 XML 文件需要为每个幻灯片或静态壁纸设计一 `<wallpaper>` 节点, 你需要将它们包含在 GNOME 控制中心的 `背景面板`中。
|
||||
|
||||
在这个例子中, 我的 `osdc.xml` 文件看起来是这样的:
|
||||
|
||||
|
||||
```
|
||||
<?xml version="1.0" ?>
|
||||
<background>
|
||||
<static>
|
||||
<!-- Duration in seconds to display the background -->
|
||||
<duration>30.0</duration>
|
||||
<file>/home/ken/Pictures/Wallpapers/osdc/osdc_2.png</file>
|
||||
</static>
|
||||
<transition>
|
||||
<!-- Duration of the transition in seconds, default is 2 seconds -->
|
||||
<duration>0.5</duration>
|
||||
<from>/home/ken/Pictures/Wallpapers/osdc/osdc_2.png</from>
|
||||
<to>/home/ken/Pictures/Wallpapers/osdc/osdc_1.png</to>
|
||||
</transition>
|
||||
<static>
|
||||
<duration>30.0</duration>
|
||||
<file>/home/ken/Pictures/Wallpapers/osdc/osdc_1.png</file>
|
||||
</static>
|
||||
<transition>
|
||||
<duration>0.5</duration>
|
||||
<from>/home/ken/Pictures/Wallpapers/osdc/osdc_1.png</from>
|
||||
<to>/home/ken/Pictures/Wallpapers/osdc/osdc_2.png</to>
|
||||
</transition>
|
||||
</background>
|
||||
```
|
||||
上面的XML中有几个重要的部分。 XML中的 `<background>` 节点是你的外部节点。 每个背景都支持多个 `<static>` 和 `<transition>` 节点。
|
||||
|
||||
`<static>` 节点定义要显示的图像以及分别用 `<duration>` 和 `<file>` 节点显示它的持续时间。
|
||||
|
||||
`<transition>` 节点为每个转换定义`<duration>` ,`<from>` 图像和 `<to>` 图像。
|
||||
|
||||
### 全天更换壁纸
|
||||
|
||||
另一个很酷的GNOME功能是基于时间的幻灯片。 你可以定义幻灯片的开始时间,GNOME将根据它计算时间。 这对于根据一天中的时间设置不同的壁纸很有用。 例如,你可以将开始时间设置为06:00,并在12:00之前显示一张墙纸,然后在下午和18:00再次更改。
|
||||
|
||||
这是通过在XML中定义 `<starttime>` 来完成的,如下所示:
|
||||
|
||||
```
|
||||
<starttime>
|
||||
<!-- A start time in the past is fine -->
|
||||
<year>2017</year>
|
||||
<month>11</month>
|
||||
<day>21</day>
|
||||
<hour>6</hour>
|
||||
<minute>00</minute>
|
||||
<second>00</second>
|
||||
</starttime>
|
||||
```
|
||||
|
||||
上述XML文件于2017年11月21日06:00开始动画,时长为21,600.00,相当于六个小时。 这段时间将显示你的早晨壁纸直到12:00,12:00时它会更改为你的下一张壁纸。 你可以继续以这种方式每隔一段时间更换一次壁纸,但确保所有持续时间的总计为86,400秒(等于24小时)。
|
||||
|
||||
GNOME将计算开始时间和当前时间之间的增量,并显示当前时间的正确墙纸。 例如,如果你在16:00选择新壁纸,则GNOME将在06:00开始时间之后显示36,000秒的适当壁纸。
|
||||
|
||||
有关完整示例,请参阅大多数发行版中由gnome-backgrounds包提供的adwaita-timed幻灯片。 它通常位于 `/usr/share/backgrounds/gnome/adwaita-timed.xml` 中。
|
||||
|
||||
|
||||
### 了解更多信息
|
||||
|
||||
希望这可以鼓励你深入了解创建自己的幻灯片壁纸。 如果你想下载本文中引用的文件的完整版本,那么你可以在 [GitHub][2] 上找到它们。
|
||||
|
||||
如果你对用于生成XML文件的实用程序脚本感兴趣,你可以在互联网上搜索gnome- backearth -generator。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/17/12/create-your-own-wallpaper-slideshow-gnome
|
||||
|
||||
作者:[Ken Vandine][a]
|
||||
译者:[Auk7F7](https://github.com/Auk7F7)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]:https://opensource.com/users/kenvandine
|
||||
[1]:http://manpages.ubuntu.com/manpages/xenial/man1/gnome-control-center.1.html
|
||||
[2]:https://github.com/kenvandine/misc/tree/master/articles/osdc/gnome/slide-show-backgrounds/osdc
|
||||
|
@ -0,0 +1,130 @@
|
||||
对于 Linux 新手来说 10 个基础的命令
|
||||
=====
|
||||
|
||||

|
||||
你可能认为你是 Linux 新手,但实际上并不是。全球互联网用户有 [3.74 亿][1],他们都以某种方式使用 Linux,因为 Linux 服务器占据了互联网的 90%。大多数现代路由器运行 Linux 或 Unix,[TOP500 超级计算机][2] 也依赖于 Linux。如果你拥有一台 Android 智能手机,那么你的操作系统就是由 Linux 内核构建的。
|
||||
|
||||
换句话说,Linux 无处不在。
|
||||
|
||||
但是使用基于 Linux 的技术和使用 Linux 本身是有区别的。如果你对 Linux 感兴趣,但是一直在使用 PC 或者 Mac 桌面,你可能想知道你需要知道什么才能使用 Linux 命令行接口(CLI),那么你来到了正确的地方。
|
||||
|
||||
下面是你需要知道的基本的 Linux 命令。每一个都很简单,也很容易记住。换句话说,你不必成为比尔盖茨就能理解它们。
|
||||
|
||||
### 1\. ls
|
||||
|
||||
你可能会想:“这是什么东西?”不,那不是一个印刷错误 - 我真的打算输入一个小写的 l。`ls`,或者 “list,” 是你需要知道的使用 Linux CLI 的第一个命令。这个 list 命令在 Linux 终端中运行,以显示在相应文件系统下归档的所有主要目录。例如,这个命令:
|
||||
|
||||
`ls /applications`
|
||||
|
||||
显示存储在 applications 文件夹下的每个文件夹,你将使用它来查看文件、文件夹和目录。
|
||||
|
||||
显示所有隐藏的文件都可以使用命令 `ls -a`。
|
||||
|
||||
### 2\. cd
|
||||
|
||||
这个命令是你用来跳转(或“更改”)到一个目录的。它指导你如何从一个文件夹导航到另一个文件夹。假设你位于 Downloads 文件夹中,但你想到名为 Gym Playlist 的文件夹中,简单地输入 `cd Gym Playlist` 将不起作用,(译注:这应该是 Gym 目录下的 Playlist 文件夹)因为 shell 不会识别它,并会报告你正在查找的文件夹不存在。要跳转到那个文件夹,你需要包含一个反斜杠。改命令如下所示:
|
||||
|
||||
`cd Gym\ Playlist`
|
||||
|
||||
要从当前文件夹返回到上一个文件夹,你可以输入 `cd ..` 后跟着文件夹名称(译注:返回上一层目录不应该是 cd .. ?)。把这两个点想象成一个后退按钮。
|
||||
|
||||
### 3\. mv
|
||||
|
||||
该命令将文件从一个文件夹转移到另一个文件夹;`mv` 代表“移动”。你可以使用这个简单的命令,就像你把一个文件拖到 PC 上的一个文件夹一样。
|
||||
|
||||
例如,如果我想创建一个名为 `testfile` 的文件来演示所有基本的 Linux 命令,并且我想将它移动到我的 Documents 文件夹中,我将输入这个命令:
|
||||
|
||||
`mv /home/sam/testfile /home/sam/Documents/`
|
||||
|
||||
命令的第一部分(`mv`)说我想移动一个文件,第二部分(`home/sam/testfile`)表示我想移动的文件,第三部分(`/home/sam/Documents/`)表示我希望传输文件的位置。
|
||||
|
||||
### 4\. 快捷键
|
||||
|
||||
好吧,这不止一个命令,但我忍不住把它们都包括进来。为什么?因为它们能节省时间并避免经历头痛。
|
||||
|
||||
`CTRL+K` 从光标处剪切文本直至本行结束
|
||||
|
||||
`CTRL+Y` 粘贴文本
|
||||
|
||||
`CTRL+E` 将光标移到本行的末尾
|
||||
|
||||
`CTRL+A` 将光标移动到本行的开头
|
||||
|
||||
`ALT+F` 跳转到下一个空格处
|
||||
|
||||
`ALT+B` 回到之前的空格处
|
||||
|
||||
`ALT+Backspace` 删除前一个词
|
||||
|
||||
`CTRL+W` 将光标前一个词剪贴
|
||||
|
||||
`Shift+Insert` 将文本粘贴到终端中
|
||||
|
||||
`Ctrl+D` 注销
|
||||
|
||||
这些命令在许多方面都能派上用场。例如,假设你在命令行文本中拼错了一个单词:
|
||||
|
||||
`sudo apt-get intall programname`
|
||||
|
||||
你可能注意到 "insatll" 拼写错了,因此该命令无法工作。但是快捷键可以让你分容易回去修复它。如果我的光标在这一行的末尾,我可以按下两次 `ALT+B` 来将光标移动到下面用 `^` 符号标记的地方:
|
||||
|
||||
`sudo apt-get^intall programname`
|
||||
|
||||
现在,我们可以快速地添加字母 `s` 来修复 `install`,十分简单!
|
||||
|
||||
### 5\. mkdir
|
||||
|
||||
这是你用来在 Linux 环境下创建目录或文件夹的命令。例如,如果你像我一样喜欢 DIY,你可以输入 `mkdir DIY` 为你的 DIY 项目创建一个目录。
|
||||
|
||||
### 6\. at
|
||||
|
||||
如果你想在特定时间运行 Linux 命令,你可以将 `at` 添加到语句中。语法是 `at` 后面跟着你希望命令运行的日期和时间,然后命令提示符变为 `at>`,这样你就可以输入在上面指定的时间运行的命令。
|
||||
|
||||
例如:
|
||||
|
||||
`at 4:08 PM Sat`
|
||||
`at> cowsay 'hello'`
|
||||
`at> CTRL+D`
|
||||
|
||||
这将会在周六下午 4:08 运行 cowsay 程序。
|
||||
|
||||
### 7\. rmdir
|
||||
|
||||
这个命令允许你通过 Linux CLI 删除一个目录。例如:
|
||||
|
||||
`rmdir testdirectory`
|
||||
|
||||
请记住,这个命令不会删除里面有文件的目录。这只在删除空目录时才起作用。
|
||||
|
||||
### 8\. rm
|
||||
|
||||
如果你想删除文件,`rm` 命令就是你想要的。它可以删除文件和目录。要删除一个文件,键入 `rm testfile`,或者删除一个目录和里面的文件,键入 `rm -r`。
|
||||
|
||||
### 9\. touch
|
||||
|
||||
`touch` 命令,也就是所谓的 "make file 命令",允许你使用 Linux CLI 创建新的、空的文件。很像 `mkdir` 创建目录,`touch` 会创建文件。例如,`touch testfile` 将会创建一个名为 testfile 的空文件。
|
||||
|
||||
### 10\. locate
|
||||
|
||||
这个命令是你在 Linux 系统中用来查找文件的命令。就像在 Windows 中搜索一样,如果你忘了存储文件的位置或它的名字,这是非常有用的。
|
||||
|
||||
例如,如果你有一个关于区块链用例的文档,但是你忘了标题,你可以输入 `locate -blockchain` 或者通过用星号分隔单词来查找 "blockchain use cases",或者星号(`*`)。例如:
|
||||
|
||||
`locate -i*blockchain*use*cases*`
|
||||
|
||||
还有很多其他有用的 Linux CLI 命令,比如 `pkill` 命令,如果你开始关机但是你意识到你并不想这么做,那么这条命令很棒。但是这里描述的 10 个简单而有用的命令是你开始使用 Linux 命令行所需的基本知识。
|
||||
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/18/4/10-commands-new-linux-users
|
||||
|
||||
作者:[Sam Bocetta][a]
|
||||
译者:[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/sambocetta
|
||||
[1]:https://hostingcanada.org/state-of-the-internet/
|
||||
[2]:https://www.top500.org/statistics/details/osfam/1
|
Loading…
Reference in New Issue
Block a user