初学者在Linux命令窗口(终端)敲命令时,肯定觉得通过输入一串一串的字符的方式来控制计算是效率很低。 但是Linux命令解释器(Shell)是有很多快捷键的,熟练掌握可以极大的提高操作效率。 下面列出最常用的快捷键,这还不是完全版。
- 命令行快捷键:
- 常用:
- Ctrl L :清屏
- 常用:
- Ctrl M :等效于回车
# Hello, and welcome to makefile basics. | |
# | |
# You will learn why `make` is so great, and why, despite its "weird" syntax, | |
# it is actually a highly expressive, efficient, and powerful way to build | |
# programs. | |
# | |
# Once you're done here, go to | |
# http://www.gnu.org/software/make/manual/make.html | |
# to learn SOOOO much more. |
# What to do when mysqldump fails | |
function report_mysqldump_fail() { | |
cat $scratch/${filename}_raw.err >> $log | |
mailx -s "mysqldump failed for DB $db_name on $HOSTNAME!!!" [email protected] < $log | |
exit 2 | |
} | |
# How to report a step along the process | |
function status_report() { | |
message=$1 |
// ==UserScript== | |
// @name Copy Link for GitHub Issues and PRs | |
// @namespace http://tampermonkey.net/ | |
// @version 0.2 | |
// @description Add a "Copy link" button to Github issue and pull requests | |
// @author ye11ow, K8sCat <[email protected]> | |
// @match https://github.com/* | |
// @include https://github.com/*/issues/* | |
// @include https://github.com/*/pull/* | |
// @icon https://www.google.com/s2/favicons?domain=github.com |
urlencode() { | |
# urlencode <string> | |
old_lc_collate=$LC_COLLATE | |
LC_COLLATE=C | |
local length="${#1}" | |
for (( i = 0; i < length; i++ )); do | |
local c="${1:$i:1}" | |
case $c in |
# Stop dance for OpenResty | |
# A modification of the Nginx systemd script | |
# Source: https://www.digitalocean.com/community/tutorials/how-to-use-the-openresty-web-framework-for-nginx-on-ubuntu-16-04 | |
# ======================= | |
# | |
# ExecStop sends SIGSTOP (graceful stop) to the Nginx process. | |
# If, after 5s (--retry QUIT/5) OpenResty is still running, systemd takes control | |
# and sends SIGTERM (fast shutdown) to the main process. | |
# After another 5s (TimeoutStopSec=5), and if OpenResty is alive, systemd sends | |
# SIGKILL to all the remaining processes in the process group (KillMode=mixed). |
#!/usr/bin/env bash | |
# | |
# gh-dl-release! It works! | |
# | |
# This script downloads an asset from latest or specific Github release of a | |
# private repo. Feel free to extract more of the variables into command line | |
# parameters. | |
# | |
# PREREQUISITES | |
# |
#!/bin/bash | |
# bash generate random alphanumeric string | |
# | |
# bash generate random 32 character alphanumeric string (upper and lowercase) and | |
NEW_UUID=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1) | |
# bash generate random 32 character alphanumeric string (lowercase only) | |
cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1 |
package main | |
import ( | |
"fmt" | |
"log" | |
"net" | |
"net/mail" | |
"net/smtp" | |
"crypto/tls" | |
) |