初学者在Linux命令窗口(终端)敲命令时,肯定觉得通过输入一串一串的字符的方式来控制计算是效率很低。 但是Linux命令解释器(Shell)是有很多快捷键的,熟练掌握可以极大的提高操作效率。 下面列出最常用的快捷键,这还不是完全版。
- 命令行快捷键:
- 常用:
- Ctrl L :清屏
 
 
- 常用:
- Ctrl M :等效于回车
| #!/usr/bin/env swift | |
| // swiftc displaymode1.swift | |
| import Foundation | |
| import CoreGraphics | |
| let display = CGMainDisplayID() | |
| guard let dmodes = CGDisplayCopyAllDisplayModes(display, nil) as? [CGDisplayMode] else {exit(1)} | |
| let argv = CommandLine.arguments | |
| if argv.count == 2 { | 
| public abstract record Either<TLeft, TRight> | |
| { | |
| // there can be no more cases defined! | |
| private Either() {} | |
| public sealed record Left(TLeft Value) : Either<TLeft, TRight>; | |
| public sealed record Right(TRight Value) : Either<TLeft, TRight>; | |
| } | 
| // Filename: HttpServer.cs | |
| // Author: Benjamin N. Summerton <define-private-public> | |
| // License: Unlicense (http://unlicense.org/) | |
| using System; | |
| using System.IO; | |
| using System.Text; | |
| using System.Net; | |
| using System.Threading.Tasks; | 
| #! /usr/bin/swift | |
| // Douglas Hill, March 2020 | |
| /* | |
| Extracts the most common translations from Apple’s glossary files. | |
| This script helped with localisation for KeyboardKit (https://github.com/douglashill/KeyboardKit) by leveraging Apple’s existing translations. | |
| More detail in the article at https://douglashill.co/localisation-using-apples-glossaries/ | 
| #! /usr/bin/swift | |
| // Douglas Hill, March 2020 | |
| // This file is made available under the MIT license included at the bottom of this file. | |
| /* | |
| Extracts specific localised strings from Apple’s glossary files. | |
| This script helped with localisation for KeyboardKit (https://github.com/douglashill/KeyboardKit) by leveraging Apple’s existing translations. | 
| #! /usr/bin/swift | |
| // Douglas Hill, March 2020 | |
| // Prints out translations from Apple’s glossary files matching text in a supplied English .strings file. | |
| // More detail in the article at https://douglashill.co/localisation-using-apples-glossaries/ | |
| import Foundation | |
| let stringsSource = URL(fileURLWithPath: "PUT THE PATH TO YOUR ENGLISH .strings FILE HERE") | 
| // | |
| // | |
| // Adapted from: | |
| // | |
| // Original: https://gist.github.com/loudmouth/332e8d89d8de2c1eaf81875cfcd22e24 | |
| // Adds encoding: https://github.com/3D4Medical/glTFSceneKit/blob/master/Sources/glTFSceneKit/GLTF/JSONCodingKeys.swift | |
| // Adds fix for null inside arrays causing infinite loop: https://gist.github.com/loudmouth/332e8d89d8de2c1eaf81875cfcd22e24#gistcomment-2807855 | |
| // | |
| struct JSONCodingKeys: CodingKey { | |
| var stringValue: String |