Преглед изворни кода

为shell.cheat和qr.cheat添加中文注释

tianyun пре 6 месеци
родитељ
комит
464aa2ca75
2 измењених фајлова са 65 додато и 65 уклоњено
  1. 1 1
      misc/qr.cheat
  2. 64 64
      misc/shell.cheat

+ 1 - 1
misc/qr.cheat

@@ -1,4 +1,4 @@
 % qr code
 
-# Create a QR code with some content
+# 使用内容创建二维码 | Create a QR code with some content
 echo <content> | curl -F-=\<- qrenco.de

+ 64 - 64
misc/shell.cheat

@@ -1,216 +1,216 @@
 
 % Shell Usage 
 
-# Re-call last input with sudo
+# 用sudo重新执行上一条命令 | Re-call last input with sudo
 sudo !!
 
-# Help
+# 帮助 | Help
 help cd / help dir (...)
 
-# Finding Help
+# 查找帮助 | Finding Help
 apropos directory / apropos search (...)
 
-# Define custom startup screen
+# 定义自定义启动屏幕 | Define custom startup screen
 sudo nano /etc/motd
 
-# Run a script as background process
+# 以后台进程运行脚本 | Run a script as background process
 <process> &
 
-#List all running processes
+# 列出所有正在运行的进程 | List all running processes
 ps -A
 
-# Kill a running process
+# 终止正在运行的进程 | Kill a running process
 killall <Process-name>
 
 % Shell System
 
-# Get the current path
+# 获取当前路径 | Get the current path
 pwd
 
-# Get the current hostname
+# 获取当前主机名 | Get the current hostname
 hostname
 
-# Get the current users
+# 获取当前用户 | Get the current users
 users
 
-# Show calendar
+# 显示日历 | Show calendar
 cal
 
-# Show today's date
+# 显示当前日期 | Show today's date
 date
 
-# Exit terminal
+# 退出终端 | Exit terminal
 exit
 
 % Shell Permissions
 
-# Use -R option to change permissions recursively.
+# 使用-R选项递归更改权限 | Use -R option to change permissions recursively.
 ps -ef | grep apache | grep -v grep
 
-# Change group
+# 更改组 | Change group
 chgrp <group-name-from> <group-name-to>
 
 % Shell Directories
 
-# List directory contents
+# 列出目录内容 | List directory contents
 ls
 
-# List all directory contents
+# 列出所有目录内容 | List all directory contents
 ll
 
-# List all directory contents sorted by time edited
+# 按编辑时间列出所有目录内容 | List all directory contents sorted by time edited
 ls -alt
 
-# List directory (wildcard matching)
+# 列出目录(通配符匹配) | List directory (wildcard matching)
 ls *.<txt>
 
-# List all files of type
+# 列出指定类型的所有文件 | List all files of type
 find . -name '*.<txt>' -print
 
-# Go back to previous directory
+# 返回上一个目录 | Go back to previous directory
 cd -
 
-# Make (empty) directory
+# 创建(空)目录 | Make (empty) directory
 mkdir <dirname>
 
-# Remove (empty) directory
+# 删除(空)目录 | Remove (empty) directory
 rmdir <dirname>
 
-# Remove directory with all contents without prompt
+# 无提示删除目录及其所有内容 | Remove directory with all contents without prompt
 rm -rf <dirname>
 
-# Remove directory contents and keep directory
+# 删除目录内容但保留目录 | Remove directory contents and keep directory
 rm -rf *
 
-# Change directory
+# 切换目录 | Change directory
 cd <dirname>
 
 % shell Symlinks
 
-# Create symlink
+# 创建符号链接 | Create symlink
 ln -s <source-dirname> <destination-dirname>
 
-# Update symlink
+# 更新符号链接 | Update symlink
 ln -sfn <source-dirname> <destination-dirname>
 
-# Remove symlink
+# 删除符号链接 | Remove symlink
 unlink <sample-dirname>
 
 % Shell Files
 
-# Make (empty) file
+# 创建(空)文件 | Make (empty) file
 touch <filename-txt>
 
-# Duplicate file
+# 复制文件 | Duplicate file
 cp <filename> <file-copyname>
 
-# Copy/Page folder with content
+# 复制/分页文件夹及其内容 | Copy/Page folder with content
 cp -a <old-folder>/ <new-folder>
 
-# Move/Rename file
+# 移动/重命名文件 | Move/Rename file
 mv <current-filename-path> <new-filename-path>
 
-# Move/Rename file and prompt before overwriting an existing file
+# 移动/重命名文件并在覆盖现有文件前提示 | Move/Rename file and prompt before overwriting an existing file
 mv -i <current-filename> <new-filename>
 
-# Remove file
+# 删除文件 | Remove file
 rm <filename-txt>
 
-# Write to file (will overwrite existing content)
+# 写入文件(将覆盖现有内容) | Write to file (will overwrite existing content)
 cat > <filename-txt> 
 
-# Search for a filename-(not content!) in the current directory
+# 在当前目录中搜索文件名(非内容) | Search for a filename-(not content!) in the current directory
 find <filename-txt>
 
-# Search for a string inside all files in the current directory and subdrectories
+# 在当前目录和子目录的所有文件中搜索字符串 | Search for a string inside all files in the current directory and subdrectories
 grep -r <string> *
 
-# Search and replace within file
+# 在文件中搜索并替换 | Search and replace within file
 sed -i s/<original-text>/<new-text>/g <filename-txt>
 
-# MD5 hash for files
+# 文件的MD5哈希值 | MD5 hash for files
 md5 <filename-txt>
 
-# MD5 hash for folders
+# 文件夹的MD5哈希值 | MD5 hash for folders
 tar c <folder> | md5sum
 
-# Encrypt file
+# 加密文件 | Encrypt file
 openssl enc -aes-256-cbc -e -in <sample-filename-txt> -out <sample-encrypted-txt>
 
-# Decrypt file
+# 解密文件 | Decrypt file
 openssl enc -aes-256-cbc -d -in <sample-encrypted> -out <sample-filename>
 
 % Shell Server
 
-# Access via ssh
+# 通过ssh访问 | Access via ssh
 ssh <username_remote>
 
-# Copy file from server to local
+# 从服务器复制文件到本地 | Copy file from server to local
 scp <username_remote>:<file-to-send-path> <path-to-recieve> 
 
-# Copy file from local to server
+# 从本地复制文件到服务器 | Copy file from local to server
 scp <file-to-send> <username_remote>:<where-to-put>
 
-# Escape files with spaces in name like this
+# 转义文件名中的空格 | Escape files with spaces in name like this
 <path-to-file>\\\ <name-png>
 
 $ username_remote: cat ~/.ssh/config | grep -i "host "|sed 's/^[ \t]*//g' | awk '{print $2}'
 
 % Shell System
 
-# Show disc space
+# 显示磁盘空间 | Show disc space
 df -h
 
-# Show disc space (inodes)
+# 显示磁盘空间(inode) | Show disc space (inodes)
 df -i
 
-# Show disc space for current directory
+# 显示当前目录的磁盘空间 | Show disc space for current directory
 du -hs
 
-# Current processes (also CPS usage)
+# 当前进程(包括CPU使用率) | Current processes (also CPS usage)
 top or htop
 
-# Show running php processes
+# 显示正在运行的php进程 | Show running php processes
 ps aux | grep php
 
-# Monitor error log (stream as file grows)
+# 监控错误日志(实时显示文件增长) | Monitor error log (stream as file grows)
 tail error.log -f -n 0
 
 % Shell Apps
 
-# Start appliction
+# 启动应用程序 | Start appliction
 xdg-open <programme> 
 
-# Open finder with current folder
+# 用当前文件夹打开Finder | Open finder with current folder
 open .
 
 % Shell Variables
 
-# Register variable
+# 注册变量 | Register variable
 export <TESTING>=<Variable-text>
 
-# Echo variable
+# 输出变量 | Echo variable
 echo $<Variable>
 
-# Unset variable
+# 取消设置变量 | Unset variable
 unset <Variable>
 
 % Shell Output & Redirects
 
-# Write to file
+# 写入文件 | Write to file
 echo <Hello> > <hello-txt>
 
-# Append content from a file to another file
+# 将一个文件的内容追加到另一个文件 | Append content from a file to another file
 cat <file1-txt> >> <file2-txt>
 
-# Add the amount of lines, words, and characters to <file2-txt>
+# 将行数、单词数和字符数添加到<file2-txt> | Add the amount of lines, words, and characters to <file2-txt>
 cat <file1-txt> | <word-count> | cat > <file2-txt>
 
-# Sort the content of a file (like cat)
+# 对文件内容进行排序(类似cat) | Sort the content of a file (like cat)
 sort <hello-txt>
 
-# Save to sorted content to a new file
+# 将排序后的内容保存到新文件 | Save to sorted content to a new file
 cat <file1-txt> | sort > <sorted-file1-txt>
 
-# Sort and remove duplicates and save to a new file
+# 排序并去重后保存到新文件 | Sort and remove duplicates and save to a new file
 sort <file1-txt> | uniq > <uniq-file1-txt>