# 命令 date shenjy@shenjy:~$ date Wed Dec 10 09:07:47 CST 2025 # 命令 cal shenjy@shenjy:~$ cal December 2025 Su Mo Tu We Th Fr Sa 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 # 命令 timels 查看命令 ls 的执行时间 shenjy@shenjy:~$ time ls anytls c ds es javademo lua nacos pa redis skywalking tldr xxl-job arthas docker easy-dataset images jyy_site minikube neo4j python sh snap video bookstore docs elasticsearch java logs mysql os qwen-code simple-blog soft vue
real 0m0.010s # 实际执行时间 user 0m0.004s # 用户态执行时间 sys 0m0.006s # 内核态执行时间 # \ 的含义 shenjy@shenjy:~$ echo hello\ world hello world
初始理解命令
首先,我看到这个命令是:
1
echo hello\ world
我知道 echo 是一个在终端中常用的命令,用于输出后面的参数。通常的用法是:
1
echo hello world
这会输出:
1
hello world
反斜杠 \ 的出现
在给定的命令中,hello 和 world 之间有一个反斜杠 \,即 hello\ world。这与我平时看到的 echo hello world 有所不同。我开始思考这个反斜杠的作用。
# 使用绝对路径运行 echo 命令 shenjy@shenjy:~$ cd /home/shenjy/c/demo/ shenjy@shenjy:~/c/demo$ ../../../../bin/echo hello world hello world # 列出当前路径多有的文件 ls # 列出上一级路径的我呢见 ls .. # 直接到指定的路径 / cd / # 回家 cd # 回到从哪里来 cd - # 查看命令帮助 ls --help man ls info ls # 查看更加详细的信息 ls -l # 查看命令的原始命令是啥 type ll # 创建文件 shenjy@shenjy:~$ touch a.txt shenjy@shenjy:~$ ls a.txt shenjy@shenjy:~$ mkdir file shenjy@shenjy:~$ ls a.txt file # 修改文件名 shenjy@shenjy:~$ mv a.txt b.txt shenjy@shenjy:~$ ls b.txt file # 把文件移动到 file 目录下 shenjy@shenjy:~$ mv b.txt file/ shenjy@shenjy:~$ cd file shenjy@shenjy:~/file$ ls b.txt # 删除文件夹以及问价夹中的内容 shenjy@shenjy:~$ rm -rf file/ # cp 命令 shenjy@shenjy:~/cp$ mkdir d shenjy@shenjy:~/cp$ echo "hello world" > file.txt shenjy@shenjy:~/cp$ ls d file.txt shenjy@shenjy:~/cp$ cat file.txt hello world shenjy@shenjy:~/cp$ ls d file.txt shenjy@shenjy:~/cp$ shenjy@shenjy:~/cp$ ls d file.txt shenjy@shenjy:~/cp$ cp file.txt d/ shenjy@shenjy:~/cp$ ls d file.txt shenjy@shenjy:~/cp$ cd d shenjy@shenjy:~/cp/d$ ls file.txt shenjy@shenjy:~/cp/d$ cat file.txt hello world # 移除空目录 rmdir d # 清屏 clear # 或者 ctrl + l # 快捷键
shenjy@shenjy:~/sh/ms$ grep foobar mcd.sh shenjy@shenjy:~/sh/ms$ echo $? 1 shenjy@shenjy:~/sh/ms$ true shenjy@shenjy:~/sh/ms$ echo $? 0 shenjy@shenjy:~/sh/ms$ false shenjy@shenjy:~/sh/ms$ echo $? 1 shenjy@shenjy:~/sh/ms$ false || echo "Oops fail" Oops fail shenjy@shenjy:~/sh/ms$ echo $? 0 shenjy@shenjy:~/sh/ms$ true || echo "Will be not be printed." shenjy@shenjy:~/sh/ms$ shenjy@shenjy:~/sh/ms$ true && echo "Things went well" Things went well shenjy@shenjy:~/sh/ms$ false && echo "This will not print" shenjy@shenjy:~/sh/ms$ false; echo "This will always print" This will always print
shenjy@shenjy:~/sh/ms$ foo=$(pwd) shenjy@shenjy:~/sh/ms$ echo $foo /home/shenjy/sh/ms shenjy@shenjy:~/sh/ms$ echo "we are in $(pwd)" we are in /home/shenjy/sh/ms shenjy@shenjy:~/sh/ms$ cat <(ls) <(ls ..) mcd.sh puma test demo2.sh install.sh ms print_all_process_opened_all_obj.sh sys.sh sysinfo.sh warp.sh
example.sh 脚本
1 2 3 4 5 6 7 8 9 10 11 12 13
#!/bin/bash echo "Starting program at $(date)" # Date will be substitutes echo "Running program $0 with $# arguments with pid $$"
for file in "$@"; do grep foobar "$file" > /dev/null 2> /dev/null # when pattern is not found, grep has exit status # We redirect STDOUT and STDERR to a null register if [ "$?" -ne 0 ]; then echo "File $file does not have any foobar, adding one" echo "# foobar" >> "$file" fi done
shell 脚本中 if 的语法
In Linux shell scripting, you can use conditional logic with if, elif (else if), and else statements. Here’s how to structure them:
Basic Syntax
1 2 3 4 5 6 7
if [ condition ]; then # commands to execute if condition is true elif [ another_condition ]; then # commands to execute if another_condition is true else # commands to execute if none of the above conditions are true fi
Example
1 2 3 4 5 6 7 8 9 10 11
#!/bin/bash
read -p "Enter a number: " num
if [ $num -gt 0 ]; then echo"The number is positive." elif [ $num -lt 0 ]; then echo"The number is negative." else echo"The number is zero." fi
Important Notes:
Spaces are required around brackets and operators:
Correct: [ $var -eq 10 ]
Incorrect: [$var-eq10]
Common comparison operators:
Numeric:
-eq (equal)
-ne (not equal)
-gt (greater than)
-lt (less than)
-ge (greater than or equal)
-le (less than or equal)
String:
= (equal)
!= (not equal)
-z (string is empty)
-n (string is not empty)
For file tests:
-f (file exists)
-d (directory exists)
-r (readable)
-w (writable)
-x (executable)
Advanced Example with Multiple Conditions
1 2 3 4 5 6 7 8 9 10 11 12 13
#!/bin/bash
file="/path/to/file"
if [ -f "$file" ] && [ -r "$file" ]; then echo"File exists and is readable." elif [ -d "$file" ]; then echo"This is a directory, not a file." elif [ ! -e "$file" ]; then echo"File does not exist." else echo"File exists but is not readable." fi
shenjy@shenjy:~/images/grandfather$ ls IMG_0684.JPG IMG_0685.JPG shenjy@shenjy:~/images/grandfather$ convert IMG_0684.JPG image.png shenjy@shenjy:~/images/grandfather$ ls IMG_0684.JPG IMG_0685.JPG image.png shenjy@shenjy:~/images/grandfather$ mkdir foo bar shenjy@shenjy:~/images/grandfather$ touch {foo,bar}/{a..j} shenjy@shenjy:~/images/grandfather$ ls IMG_0684.JPG IMG_0685.JPG bar foo image.png shenjy@shenjy:~/images/grandfather$ cd bar/ shenjy@shenjy:~/images/grandfather/bar$ ls a b c d e f g h i j shenjy@shenjy:~/images/grandfather/bar$ cd .. shenjy@shenjy:~/images/grandfather$ ls IMG_0684.JPG IMG_0685.JPG bar foo image.png shenjy@shenjy:~/images/grandfather$ cd foo/ shenjy@shenjy:~/images/grandfather/foo$ ls a b c d e f g h i j shenjy@shenjy:~/images/grandfather$ touch foo/x bar/y shenjy@shenjy:~/images/grandfather$ diff <(ls foo) <(ls bar) 11c11 < x --- > y # script.py #!/usr/bin/python3 # shebang #!/usr/bin/env python3 # 推荐使用 import sys for arg in reversed(sys.argv[1:]): print(arg)
shenjy@shenjy:~/sh/ms$ vim script.py shenjy@shenjy:~/sh/ms$ ls example.sh mcd.sh script.py shenjy@shenjy:~/sh/ms$ chmod +x script.py shenjy@shenjy:~/sh/ms$ ls example.sh mcd.sh script.py shenjy@shenjy:~/sh/ms$ ./script.py 1 2 3 4 -bash: ./script.py: /usr/local/bin/python3: bad interpreter: No such file or directory shenjy@shenjy:~/sh/ms$ which python shenjy@shenjy:~/sh/ms$ which python3 /usr/bin/python3 shenjy@shenjy:~/sh/ms$ vim script.py shenjy@shenjy:~/sh/ms$ ./script.py 1 2 3 4 4 3 2 1
shenjy@shenjy:~/sh/ms$ shellcheck mcd.sh
In mcd.sh line 4: cd "$1" ^-----^ SC2164 (warning): Use 'cd ... || exit' or 'cd ... || return' in case cd fails.
Did you mean: cd "$1" || exit
For more information: https://www.shellcheck.net/wiki/SC2164 -- Use 'cd ... || exit' or 'cd ... |... shenjy@shenjy:~/sh/ms$ man rg No manual entry for rg shenjy@shenjy:~/sh/ms$ rg Command 'rg' not found, but can be installed with: sudo snap install ripgrep # version 12.1.0, or sudo apt install ripgrep # version 13.0.0-2ubuntu0.1 See 'snap info ripgrep' for additional versions. shenjy@shenjy:~/sh/ms$ sudo apt install ripgrep shenjy@shenjy:~/sh/ms$ man rg shenjy@shenjy:~/sh/ms$ tldr convert
convert
This command is an alias of `magick convert`. Note: This alias is deprecated since ImageMagick 7. It has been replaced by `magick`. Use `magick convert` if you need to use the old tool in versions 7+.
- View documentation for the original command: tldr magick convert
shenjy@shenjy:~/sh/ms$ ag Entering AI mode. Type your prompt (or 'exit' to quit): prompt> 请使用 tldr 的方式介绍下 convert 命令。
Video conversion tool. See also: `gst-launch-1.0`. More information: https://ffmpeg.org/ffmpeg.html#Options.
- Extract the sound from a video and save it as MP3: ffmpeg -i path/to/video.mp4 -vn path/to/sound.mp3
- Transcode a FLAC file to Red Book CD format (44100kHz, 16bit): ffmpeg -i path/to/input_audio.flac -ar 44100 -sample_fmt s16 path/to/output_audio.wav
- Save a video as GIF, scaling the height to 1000px and setting framerate to 15: ffmpeg -i path/to/video.mp4 -filter:v 'scale=-1:1000' -r 15 path/to/output.gif
- Combine numbered images (frame_1.jpg, frame_2.jpg, etc) into a video or GIF: ffmpeg -i path/to/frame_%d.jpg -f image2 video.mpg|video.gif
- Trim a video from a given start time mm:ss to an end time mm2:ss2 (omit the -to flag to trim till the end): ffmpeg -i path/to/input_video.mp4 -ss mm:ss -to mm2:ss2 -codec copy path/to/output_video.mp4
- Convert AVI video to MP4. AAC Audio @ 128kbit, h264 Video @ CRF 23: ffmpeg -i path/to/input_video.avi -codec:a aac -b:a 128k -codec:v libx264 -crf 23 path/to/output_video.mp4
- Remux MKV video to MP4 without re-encoding audio or video streams: ffmpeg -i path/to/input_video.mkv -codec copy path/to/output_video.mp4
- Convert MP4 video to VP9 codec. For the best quality, use a CRF value (recommended range 15-35) and -b:v MUST be 0: ffmpeg -i path/to/input_video.mp4 -codec:v libvpx-vp9 -crf 30 -b:v 0 -codec:a libopus -vbr on -threads number_of_threads path/to/output_video.webm
shenjy@shenjy:~/sh/ms$ tldr tar
tar
Archiving utility. Often combined with a compression method, such as `gzip` or `bzip2`. More information: https://www.gnu.org/software/tar/manual/tar.html.
- [c]reate an archive and write it to a [f]ile: tar cf path/to/target.tar path/to/file1 path/to/file2 ...
- [c]reate a g[z]ipped archive and write it to a [f]ile: tar czf path/to/target.tar.gz path/to/file1 path/to/file2 ...
- [c]reate a g[z]ipped (compressed) archive from a directory using relative paths: tar czf path/to/target.tar.gz --directory path/to/directory .
- E[x]tract a (compressed) archive [f]ile into the current directory [v]erbosely: tar xvf path/to/source.tar[.gz|.bz2|.xz]
- E[x]tract a (compressed) archive [f]ile into the target directory: tar xf path/to/source.tar[.gz|.bz2|.xz] --directory path/to/directory
- [c]reate a compressed archive and write it to a [f]ile, using the file extension to [a]utomatically determine the compression program: tar caf path/to/target.tar.xz path/to/file1 path/to/file2 ...
- Lis[t] the contents of a tar [f]ile [v]erbosely: tar tvf path/to/source.tar
- E[x]tract files matching a pattern from an archive [f]ile: tar xf path/to/source.tar --wildcards "*.html" shenjy@shenjy:~/sh/ms$ ag Entering AI mode. Type your prompt (or 'exit' to quit): prompt> please introduce find command with tldr pattern.
DeepSeek-v3: Here's a `tldr`-style introduction to the `find` command:
```bash # find # Search for files and directories in a directory hierarchy.
# Find files by name (case-sensitive): find /path/to/dir -name "*.txt"
# Find files by name (case-insensitive): find /path/to/dir -iname "*.txt"
# Find directories: find /path/to/dir -type d
# Find regular files: find /path/to/dir -type f
# Find files modified in the last 7 days: find /path/to/dir -mtime -7
# Find files larger than 10MB: find /path/to/dir -size +10M
# Find and delete files (use with caution!): find /path/to/dir -name "*.tmp" -delete
# Find and execute a command on each file ({} represents the filename): find /path/to/dir -name "*.jpg" -exec chmod 644 {} \;
# Find files owned by a specific user: find /path/to/dir -user username ```
Key options: - `-name`: Search by filename (case-sensitive) - `-iname`: Search by filename (case-insensitive) - `-type`: Filter by type (f=file, d=directory, l=symlink) - `-mtime`: Filter by modification time - `-size`: Filter by size - `-exec`: Execute command on found files - `-delete`: Delete matching files
The `find` command is incredibly powerful for searching and operating on files. For more details, check `man find`.
Entering AI mode. Type your prompt (or 'exit' to quit): prompt> introduce fd command in linux.
DeepSeek-v3: # The `fd` Command in Linux
`fd` is a modern, user-friendly alternative to the traditional `find` command in Linux/Unix systems. It's designed to be faster and easier to use while offering sensible defaults.
## Key Features of `fd`
1. **Colorized output**: Results are displayed with syntax highlighting 2. **Fast search**: Uses parallelism for quicker results 3. **Smart case**: Case-insensitive by default, switches to case-sensitive if uppercase is used 4. **Ignores hidden files and `.gitignore` by default**: More focused results 5. **Simpler syntax**: Easier to remember commands
## Basic Usage
```bash fd PATTERN [PATH] ```
## Common Options
| Option | Description | |--------|-------------| | `-H`/`--hidden` | Include hidden files/directories | | `-I`/`--no-ignore` | Don't respect `.gitignore` files | | `-t`/`--type` | Filter by type (`f`=file, `d`=directory, `l`=symlink) | | `-e`/`--extension` | Filter by file extension | | `-E`/`--exclude` | Exclude files/directories matching pattern | | `-L`/`--follow` | Follow symbolic links | | `-p`/`--full-path` | Search the full path (not just filename) |
Note: The command is typically `fdfind` on Debian/Ubuntu systems to avoid conflict with another package. You can alias it with `alias fd=fdfind`.
prompt> introduce fd command with tldr pattern.
DeepSeek-v3: Here's the `fd` command introduced in the `tldr` pattern:
```markdown # fd
A simple, fast, and user-friendly alternative to `find`. More information: <https://github.com/sharkdp/fd>.
- Find files matching a specific pattern in the current directory: `fd "{{pattern}}"`
- Find files with a specific extension (e.g., `.txt`): `fd --extension "{{txt}}"`
- Find files in a specific directory (e.g., `/tmp`): `fd "{{pattern}}" {{/tmp}}`
- Include hidden and ignored files in the search: `fd --hidden --no-ignore "{{pattern}}"`
- Execute a command on each search result (e.g., `ls -l`): ` fd "{{pattern}}" --exec {{ls -l}}`
- Search for files matching a case-insensitive pattern (e.g., `PATTERN`): `fd --ignore-case "{{pattern}}"`
- Exclude specific files or directories from the search: `fd "{{pattern}}" --exclude "{{*.o}}" --exclude "{{/path/to/dir}}"`
- Show version information: `fd --version` ```
Key features highlighted: - Simpler syntax than traditional `find` - Colorized output by default - Fast due to parallel directory traversal - Sensible defaults (ignores hidden files and gitignored files by default)
prompt> tell me tmux command line usage with tldr pattern.
DeepSeek-v3: Here’s a tldr-style cheat sheet for tmux:
Basic Commands
1 2 3 4 5 6
tmux # Start new session tmux new -s <name> # Start new named session tmux ls# List sessions ctrl-b d # Detach from session tmux attach -t <name> # Reattach to session tmux kill-session -t <name> # Kill session
Session Management
1 2 3 4
ctrl-b $ # Rename session ctrl-b s # Switch sessions ctrl-b ( # Move to previous session ctrl-b ) # Move to next session
Window Management
1 2 3 4 5 6
ctrl-b c # Create new window ctrl-b , # Rename window ctrl-b p # Previous window ctrl-b n # Next window ctrl-b 0-9 # Switch to window by number ctrl-b & # Kill current window
Pane Management
1 2 3 4 5 6 7 8
ctrl-b " # Split pane horizontally ctrl-b % # Split pane vertically ctrl-b arrow key # Switch pane ctrl-b z # Toggle pane zoom ctrl-b x # Kill current pane ctrl-b { # Move pane left ctrl-b } # Move pane right ctrl-b space # Toggle layouts
Copy Mode (Scroll/Buffer)
1 2 3 4 5 6 7 8
ctrl-b [ # Enter copy mode q # Exit copy mode ↑ ↓ ← → # Navigate ctrl-u / ctrl-d # Half-page up/down / or ? # Search (n/N to navigate) space # Start selection enter # Copy selection ctrl-b ] # Paste
Miscellaneous
1 2 3 4 5
ctrl-b : # Enter command mode ctrl-b t # Show clock ctrl-b ? # Show key bindings ctrl-b r # Reload config (~/.tmux.conf) tmux -V # Show version
🔥 Pro Tip: Default prefix is ctrl-b, but many users remap it to ctrl-a (add set -g prefix C-a in ~/.tmux.conf).
Want a specific deep dive on any part? 🚀
在 Linux 或 Unix 系统中,jobs命令用于查看当前 shell 会话中正在运行或暂停(后台)的作业(jobs)。以下是它的基本用法和示例:
A versatile programming language for working on files. Note: Different implementations of AWK often make this a symlink of their binary. See also: `gawk`. More information: https://github.com/onetrueawk/awk.
- Print the fifth column (a.k.a. field) in a space-separated file: awk '{print $5}' path/to/file
- Print the second column of the lines containing "foo" in a space-separated file: awk '/foo/ {print $2}' path/to/file
- Print the last column of each line in a file, using a comma (instead of space) as a field separator: awk -F ',' '{print $NF}' path/to/file
- Sum the values in the first column of a file and print the total: awk '{s+=$1} END {print s}' path/to/file
- Print every third line starting from the first line: awk 'NR%3==1' path/to/file
- Print different values based on conditions: awk '{if ($1 == "foo") print "Exact match foo"; else if ($1 ~ "bar") print "Partial match bar"; else print "Baz"}' path/to/file
- Print all the lines which the 10th column value is between a min and a max: awk '($10 >= min_value && $10 <= max_value)'
- Print table of users with UID >=1000 with header and formatted output, using colon as separator (%-20s mean: 20 left-align string characters, %6s means: 6 right-align string characters): awk 'BEGIN {FS=":";printf "%-20s %6s %25s\n", "Name", "UID", "Shell"} $4 >= 1000 {printf "%-20s %6d %25s\n", $1, $4, $7}' /etc/passwd
shenjy@shenjy:~/msoce/data_wrangling$ tldr sed
sed
GNU stream editor for filtering and transforming text. See also: `awk`, `ed`. More information: https://www.gnu.org/software/sed/manual/sed.html.
- Replace "apple" with "mango" on all lines using basic regex, print to stdout: command | sed 's/apple/mango/g'
- Replace "apple" with "APPLE" on all lines using extended regex, print to stdout: command | sed --regexp-extended 's/(apple)/\U\1/g'
- Use basic regex to replace "apple" with "mango" and "orange" with "lime" in-place in a file (overwriting original file): sed --in-place -e 's/apple/mango/g' -e 's/orange/lime/g' path/to/file
- Execute a specific sed script file and print the result to stdout: command | sed --file path/to/script.sed
- [p]rint only the first line to stdout: command | sed --quiet '1p'
- [d]elete lines 1 to 5 of a file and back up the original file with a .orig extension: sed --in-place=.orig '1,5d' path/to/file
- [i]nsert a new line at the beginning of a file, overwriting the original file in-place: sed --in-place '1i\your new line text\' path/to/file
- Delete blank lines (with or without spaces/tabs) from a file, overwriting the original file in-place: sed --in-place '/^[[:space:]]*$/d' path/to/file
Found 5 pages with the same name under the platforms: common, netbsd, openbsd, freebsd, osx
shenjy@shenjy:~/msoce/data_wrangling$ tldr ed
ed
The original Unix text editor. See also: `awk`, `sed`. More information: https://www.gnu.org/software/ed/manual/ed_manual.html.
- Start an interactive editor session with an empty document: ed
- Start an interactive editor session with an empty document and a specific prompt: ed --prompt '> '
- Start an interactive editor session with user-friendly errors: ed --verbose
- Start an interactive editor session with an empty document and without diagnostics, byte counts and '!' prompt: ed --quiet --script
- Start an interactive editor session without exit status change when command fails: ed --loose-exit-status
- Edit a specific file (this shows the byte count of the loaded file): ed path/to/file
- Replace a string with a specific replacement for all lines: ,s/regex/replacement/g<Enter>
- Exit ed: q<Enter>
Found 1 page with the same name under the platform: osx\
shenjy@shenjy:~/msoce/data_wrangling$ echo 'aba' | sed 's/[ab]//' ba # 输入字符串是 "a b a"(字母顺序为:第1个a、第1个b、第2个a)。 # `sed` 会从左到右扫描,找到第一个匹配 `[ab]` 的字符(即第一个 `a`),然后将其删除。 # 后续的 `b` 和第二个 `a` 不会被处理(因为缺少全局替换标志 `g`)。
shenjy@shenjy:~/msoce/data_wrangling$ echo 'bba' | sed 's/[ab]//' ba # 输入字符串是 "b b a"(字母顺序为:第1个b、第1个b、第2个a)。 # `sed` 会从左到右扫描,找到第一个匹配 `[ab]` 的字符(即第一个 `b`),然后将其删除。 # 后续的 `b` 和第二个 `a` 不会被处理(因为缺少全局替换标志 `g`)。
shenjy@shenjy:~/msoce/data_wrangling$ echo 'bba' | sed 's/[ab]//g' shenjy@shenjy:~/msoce/data_wrangling$ echo 'bbac' | sed 's/[ab]//g' c shenjy@shenjy:~/msoce/data_wrangling$ echo 'bcbzac' | sed 's/[ab]//g' czc shenjy@shenjy:~/msoce/data_wrangling$ echo 'abcaba' | sed 's/(ab)//g' abcaba shenjy@shenjy:~/msoce/data_wrangling$ echo 'abcaba' | sed 's/(ab)*//g' abcaba shenjy@shenjy:~/msoce/data_wrangling$ echo 'abcaba' | sed -E 's/(ab)*//g' ca shenjy@shenjy:~/msoce/data_wrangling$ echo 'abcaba' | sed 's/\(ab\)*//g' ca shenjy@shenjy:~/msoce/data_wrangling$ echo 'abcabaabc' | sed -E 's/(ab|bc)*//g' cac shenjy@shenjy:~/msoce/data_wrangling$ echo 'abcababc' | sed -E 's/(ab|bc)*//g' cc shenjy@shenjy:~/msoce/data_wrangling$ echo 'abcabbc' | sed -E 's/(ab|bc)*//g' c
find /path -type f -execdu -h {} + | sort -rh | head -n 5
Note: Combine tools using pipes (|) for complex workflows. Install tools via package managers (e.g., apt, brew, pip). For large datasets, prefer tools like xsv or q for speed.
Here’s a tldr-style summary for the rustup command in Linux:
# 根据扩展名查找文件 findext() { find . -type f -name "*.$1" } alias fe='findext'
# 使用:fe txt # 查找所有.txt文件
条件别名
1 2 3 4 5 6
# 根据不同系统设置别名 if [ -f /etc/debian_version ]; then alias update='sudo apt update && sudo apt upgrade' elif [ -f /etc/redhat-release ]; then alias update='sudo yum update' fi
# Git 简化 alias gs='git status' alias ga='git add' alias gc='git commit' alias gcm='git commit -m' alias gp='git push' alias gl='git log --oneline --graph'
# Docker 简化 alias dps='docker ps' alias dpsa='docker ps -a' alias di='docker images' alias drm='docker rm' alias drmi='docker rmi'
# Python 开发 alias py='python3' alias pip='pip3' alias venv='python3 -m venv' alias pyclean='find . -name "*.pyc" -delete'
系统管理员别名
1 2 3 4 5 6 7 8 9 10 11 12 13 14
# 进程管理 alias pstop='ps aux | sort -nrk 3,3 | head -5'# CPU使用前5 alias psmem='ps aux | sort -nrk 4,4 | head -5'# 内存使用前5
# 日志查看 alias logerr='sudo journalctl -p 3 -xb'# 查看系统错误 alias logtail='sudo tail -f /var/log/syslog'# 实时系统日志
# 服务管理 alias start='sudo systemctl start' alias stop='sudo systemctl stop' alias restart='sudo systemctl restart' alias status='sudo systemctl status' alias reload='sudo systemctl reload'
网络诊断别名
1 2 3 4 5 6 7 8 9
# 网络测试 alias pingg='ping 8.8.8.8'# 测试谷歌DNS alias speedtest='curl -s https://raw.githubusercontent.com/sivel/speedtest-cli/master/speedtest.py | python -'
# 端口扫描 alias scanports='nmap -sT -p- localhost'# 扫描本地所有端口
# ls 增强 aliasls='ls --color=auto' alias ll='ls -alF' alias la='ls -A' alias l='ls -CF' alias lx='ls -lXB'# 按扩展名排序 alias lk='ls -lSr'# 按大小排序(从小到大) alias lt='ls -ltr'# 按日期排序(最近修改在前) alias lm='ls -al | more'# 分页显示
# 目录导航 alias ..='cd ..' alias ...='cd ../..' alias ....='cd ../../..' alias ~='cd ~' alias home='cd ~'
# 系统信息 aliasdf='df -h' aliasdu='du -h' alias free='free -m' alias meminfo='free -m -l -t' alias psmem='ps auxf | sort -nr -k 4' alias pscpu='ps auxf | sort -nr -k 3'
# 网络 alias myip='curl ifconfig.me' alias ports='netstat -tulanp' alias ping='ping -c 5' alias wget='wget -c'# 断点续传
# Git 简化 alias gs='git status' alias ga='git add' alias gb='git branch' alias gc='git commit' alias gd='git diff' alias go='git checkout' alias gp='git push' alias gl='git log --oneline --graph --all'
# 快速编辑配置 alias bashrc='nano ~/.bashrc && source ~/.bashrc' alias vimrc='nano ~/.vimrc' alias tmuxconf='nano ~/.tmux.conf && tmux source-file ~/.tmux.conf'
# 常用别名配置(添加到 ~/.gitconfig) [alias] co = checkout br = branch ci = commit st = status lg = log --oneline --graph --all last = log -1 HEAD unstage = reset HEAD --
add two file to this repo zh01@zh01-pc:~/version_controll$ git log commit 4acae0d500d77b6d5e89d0db8c1f04d0d7fb6402 (HEAD -> master) Author: shenjunyu <shenjunyu1030@hotmail.com> Date: Sun Dec 21 21:09:13 2025 +0800
add two file to this repo zh01@zh01-pc:~/version_controll$ git cat-file -p 4acae tree 2e527c3fc79da9bfa05e14f91ebff55d30fc6d0a author shenjunyu <shenjunyu1030@hotmail.com> 1766322553 +0800 committer shenjunyu <shenjunyu1030@hotmail.com> 1766322553 +0800
add two file to this repo zh01@zh01-pc:~/version_controll$ git cat-file -p 2e527c3fc79da9bfa05e14f91ebff55d30fc6d0a 100644 blob 898d6fc69db29e5d1cecb9f0acfee700b15712d3 hello.txt 100644 blob fa49b077972391ad58037050f2a75f74e3671e92 new_file.txt zh01@zh01-pc:~/version_controll$ git cat-file -p 898d6fc69db29e5d1cecb9f0acfee700b15712d3 hello world hello world again. zh01@zh01-pc:~/version_controll$ git cat-file -p fa49b new file
zh01@zh01-pc:~/version_controll$ git log commit 4acae0d500d77b6d5e89d0db8c1f04d0d7fb6402 (HEAD -> master) Author: shenjunyu <shenjunyu1030@hotmail.com> Date: Sun Dec 21 21:09:13 2025 +0800
add two file to this repo zh01@zh01-pc:~/version_controll$ git cat-file -p 4acae tree 2e527c3fc79da9bfa05e14f91ebff55d30fc6d0a author shenjunyu <shenjunyu1030@hotmail.com> 1766322553 +0800 committer shenjunyu <shenjunyu1030@hotmail.com> 1766322553 +0800
add two file to this repo zh01@zh01-pc:~/version_controll$ git cat-file -p 2e527c3fc79da9bfa05e14f91ebff55d30fc6d0a 100644 blob 898d6fc69db29e5d1cecb9f0acfee700b15712d3 hello.txt 100644 blob fa49b077972391ad58037050f2a75f74e3671e92 new_file.txt zh01@zh01-pc:~/version_controll$ git cat-file -p 898d6fc69db29e5d1cecb9f0acfee700b15712d3 hello world hello world again. zh01@zh01-pc:~/version_controll$ git cat-file -p fa fatal: Not a valid object name fa zh01@zh01-pc:~/version_controll$ git cat-file -p fa49b new file zh01@zh01-pc:~/version_controll$ git log --all --graph --decorate * commit 4acae0d500d77b6d5e89d0db8c1f04d0d7fb6402 (HEAD -> master) Author: shenjunyu <shenjunyu1030@hotmail.com> Date: Sun Dec 21 21:09:13 2025 +0800
add two file to this repo zh01@zh01-pc:~/version_controll$ cat ./hello.txt hello world hello world again. zh01@zh01-pc:~/version_controll$ echo"another line" >> hello.txt zh01@zh01-pc:~/version_controll$ cat ./hello.txt hello world hello world again. another line zh01@zh01-pc:~/version_controll$ git commit 位于分支 master 尚未暂存以备提交的变更: (使用 "git add <文件>..." 更新要提交的内容) (使用 "git restore <文件>..." 丢弃工作区的改动) 修改: hello.txt
修改尚未加入提交(使用 "git add" 和/或 "git commit -a") zh01@zh01-pc:~/version_controll$ git add hello.txt zh01@zh01-pc:~/version_controll$ git commit [master 057c72e] add a new line for file hello.txt. 1 file changed, 1 insertion(+) zh01@zh01-pc:~/version_controll$ git log --all --graph --decorate * commit 057c72e5f8f21917cc993e14debab0681f8f2a42 (HEAD -> master) | Author: shenjunyu <shenjunyu1030@hotmail.com> | Date: Sun Dec 21 21:23:22 2025 +0800 | | add a new line for file hello.txt. | * commit 4acae0d500d77b6d5e89d0db8c1f04d0d7fb6402 Author: shenjunyu <shenjunyu1030@hotmail.com> Date: Sun Dec 21 21:09:13 2025 +0800
add two file to this repo zh01@zh01-pc:~/version_controll$ git checkout 4acae0d500d77b6d5e89d0db8c1f04d0d7fb6402 注意:正在切换到 '4acae0d500d77b6d5e89d0db8c1f04d0d7fb6402'。
HEAD 目前位于 4acae0d add two file to this repo zh01@zh01-pc:~/version_controll$ cat ./hello.txt hello world hello world again. zh01@zh01-pc:~/version_controll$ git log --all --graph --decorate * commit 057c72e5f8f21917cc993e14debab0681f8f2a42 (master) | Author: shenjunyu <shenjunyu1030@hotmail.com> | Date: Sun Dec 21 21:23:22 2025 +0800 | | add a new line for file hello.txt. | * commit 4acae0d500d77b6d5e89d0db8c1f04d0d7fb6402 (HEAD) Author: shenjunyu <shenjunyu1030@hotmail.com> Date: Sun Dec 21 21:09:13 2025 +0800
add two file to this repo zh01@zh01-pc:~/version_controll$ git checkout master 之前的 HEAD 位置是 4acae0d add two file to this repo 切换到分支 'master' zh01@zh01-pc:~/version_controll$ cat ./hello.txt hello world hello world again. another line zh01@zh01-pc:~/version_controll$ vim ./hello.txt zh01@zh01-pc:~/version_controll$ git checkout 4acae0d500d77b6d5e89d0db8c1f04d0d7fb6402 error: 您对下列文件的本地修改将被检出操作覆盖: hello.txt 请在切换分支前提交或贮藏您的修改。 正在终止 zh01@zh01-pc:~/version_controll$ git status 位于分支 master 尚未暂存以备提交的变更: (使用 "git add <文件>..." 更新要提交的内容) (使用 "git restore <文件>..." 丢弃工作区的改动) 修改: hello.txt
HEAD 目前位于 4acae0d add two file to this repo zh01@zh01-pc:~/version_controll$ git checkout master 之前的 HEAD 位置是 4acae0d add two file to this repo 切换到分支 'master' zh01@zh01-pc:~/version_controll$ git status 位于分支 master 无文件要提交,干净的工作区 zh01@zh01-pc:~/version_controll$ cat hello.txt hello world hello world again. another line zh01@zh01-pc:~/version_controll$ vim ./hello.txt zh01@zh01-pc:~/version_controll$ git diff diff --git a/hello.txt b/hello.txt index 5696a4e..b03bcc3 100644 --- a/hello.txt +++ b/hello.txt @@ -1,3 +1,4 @@ hello world hello world again. another line +adfjalsjdfs zh01@zh01-pc:~/version_controll$ git diff hello.txt diff --git a/hello.txt b/hello.txt index 5696a4e..b03bcc3 100644 --- a/hello.txt +++ b/hello.txt @@ -1,3 +1,4 @@ hello world hello world again. another line +adfjalsjdfs zh01@zh01-pc:~/version_controll$ git log commit 057c72e5f8f21917cc993e14debab0681f8f2a42 (HEAD -> master) Author: shenjunyu <shenjunyu1030@hotmail.com> Date: Sun Dec 21 21:23:22 2025 +0800
add a new line for file hello.txt.
commit 4acae0d500d77b6d5e89d0db8c1f04d0d7fb6402 Author: shenjunyu <shenjunyu1030@hotmail.com> Date: Sun Dec 21 21:09:13 2025 +0800
add two file to this repo zh01@zh01-pc:~/version_controll$ git diff 4acae0d hello.txt diff --git a/hello.txt b/hello.txt index 898d6fc..b03bcc3 100644 --- a/hello.txt +++ b/hello.txt @@ -1,2 +1,4 @@ hello world hello world again. +another line +adfjalsjdfs
zh01@zh01-pc:~/version_controll$ git diff HEAD hello.txt diff --git a/hello.txt b/hello.txt index 5696a4e..b03bcc3 100644 --- a/hello.txt +++ b/hello.txt @@ -1,3 +1,4 @@ hello world hello world again. another line +adfjalsjdfs zh01@zh01-pc:~/version_controll$ git diff 4acae0d HEAD hello.txt diff --git a/hello.txt b/hello.txt index 898d6fc..5696a4e 100644 --- a/hello.txt +++ b/hello.txt @@ -1,2 +1,3 @@ hello world hello world again. +another line
修改尚未加入提交(使用 "git add" 和/或 "git commit -a") zh01@zh01-pc:~/version_controll$ git checkout hello.txt 从索引区更新了 1 个路径 zh01@zh01-pc:~/version_controll$ git log --all --graph --decorate * commit 057c72e5f8f21917cc993e14debab0681f8f2a42 (HEAD -> master) | Author: shenjunyu <shenjunyu1030@hotmail.com> | Date: Sun Dec 21 21:23:22 2025 +0800 | | add a new line for file hello.txt. | * commit 4acae0d500d77b6d5e89d0db8c1f04d0d7fb6402 Author: shenjunyu <shenjunyu1030@hotmail.com> Date: Sun Dec 21 21:09:13 2025 +0800
add two file to this repo zh01@zh01-pc:~/version_controll$ cat ./hello.txt hello world hello world again. another line zh01@zh01-pc:~/version_controll$ ls hello.txt new_file.txt zh01@zh01-pc:~/version_controll$ vim animal.py zh01@zh01-pc:~/version_controll$ python3 ./animal.py hello zh01@zh01-pc:~/version_controll$ git status 位于分支 master 未跟踪的文件: (使用 "git add <文件>..." 以包含要提交的内容) animal.py
if __name__ == '__main__': main() zh01@zh01-pc:~/version_controll$ zh01@zh01-pc:~/version_controll$ git diff HEAD zh01@zh01-pc:~/version_controll$ git diff zh01@zh01-pc:~/version_controll$ git status 位于分支 cat 无文件要提交,干净的工作区 zh01@zh01-pc:~/version_controll$ git status 位于分支 cat 无文件要提交,干净的工作区 zh01@zh01-pc:~/version_controll$ git log --all --graph --decorate --oneline * 263b714 (HEAD -> cat) add new feature for animal.py * 1e50a3e (master) add animal.py to this repo * 057c72e add a new line for file hello.txt. * 4acae0d add two file to this repo zh01@zh01-pc:~/version_controll$ git checkout master 切换到分支 'master' zh01@zh01-pc:~/version_controll$ cat ./animal.py import sys
def default(): print("hello")
def main(): default()
if __name__ == '__main__': main() zh01@zh01-pc:~/version_controll$ git log --all --graph --decorate --oneline * 263b714 (cat) add new feature for animal.py * 1e50a3e (HEAD -> master) add animal.py to this repo * 057c72e add a new line for file hello.txt. * 4acae0d add two file to this repo zh01@zh01-pc:~/version_controll$ git branch dog zh01@zh01-pc:~/version_controll$ git checkout dog 切换到分支 'dog' zh01@zh01-pc:~/version_controll$ vim ./animal.py zh01@zh01-pc:~/version_controll$ git branch cat * dog master zh01@zh01-pc:~/version_controll$ git log --all --graph --decorate --oneline * 263b714 (cat) add new feature for animal.py * 1e50a3e (HEAD -> dog, master) add animal.py to this repo * 057c72e add a new line for file hello.txt. * 4acae0d add two file to this repo zh01@zh01-pc:~/version_controll$ vim ./animal.py zh01@zh01-pc:~/version_controll$ python3 ./animal.py dog Woof! zh01@zh01-pc:~/version_controll$ python3 ./animal.py d hello zh01@zh01-pc:~/version_controll$ git add . zh01@zh01-pc:~/version_controll$ ls animal.py hello.txt new_file.txt zh01@zh01-pc:~/version_controll$ git commit [dog 2807677] add dog functionfor animal.py 1 file changed, 6 insertions(+), 1 deletion(-) zh01@zh01-pc:~/version_controll$ git log --all --graph --decorate --oneline * 2807677 (HEAD -> dog) add dog functionfor animal.py | * 263b714 (cat) add new feature for animal.py |/ * 1e50a3e (master) add animal.py to this repo * 057c72e add a new line for file hello.txt. * 4acae0d add two file to this repo
zh01@zh01-pc:~/version_controll$ git checkout master 切换到分支 'master' zh01@zh01-pc:~/version_controll$ git log --all --graph --decorate --oneline * 2807677 (dog) add dog functionfor animal.py | * 263b714 (cat) add new feature for animal.py |/ * 1e50a3e (HEAD -> master) add animal.py to this repo * 057c72e add a new line for file hello.txt. * 4acae0d add two file to this repo zh01@zh01-pc:~/version_controll$ git merge cat 更新 1e50a3e..263b714 Fast-forward animal.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) zh01@zh01-pc:~/version_controll$ cat ./animal.py import sys
if __name__ == '__main__': main() zh01@zh01-pc:~/version_controll$ git log --all --graph --decorate --oneline * 2807677 (dog) add dog functionfor animal.py | * 263b714 (HEAD -> master, cat) add new feature for animal.py |/ * 1e50a3e add animal.py to this repo * 057c72e add a new line for file hello.txt. * 4acae0d add two file to this repo zh01@zh01-pc:~/version_controll$ git merge dog 自动合并 animal.py 冲突(内容):合并冲突于 animal.py 自动合并失败,修正冲突然后提交修正的结果。 zh01@zh01-pc:~/version_controll$ git mergetool
This message is displayed because 'merge.tool' is not configured. See 'git mergetool --tool-help' or 'git help config'for more details. 'git mergetool' will now attempt to use one of the following tools: opendiff kdiff3 tkdiff xxdiff meld tortoisemerge gvimdiff diffuse diffmerge ecmerge p4merge araxis bc codecompare smerge emerge vimdiff Merging: animal.py
Normal merge conflict for'animal.py': {local}: modified file {remote}: modified file Hit return to start merge resolution tool (bc): vimdiff animal.py seems unchanged. Was the merge successful [y/n]? n merge of animal.py failed zh01@zh01-pc:~/version_controll$ git merge --abort zh01@zh01-pc:~/version_controll$ git merge dog 自动合并 animal.py 冲突(内容):合并冲突于 animal.py 自动合并失败,修正冲突然后提交修正的结果。 zh01@zh01-pc:~/version_controll$ vim ./animal.py zh01@zh01-pc:~/version_controll$ git merge --continue U animal.py error: 无法提交,因为您有未合并的文件。 提示:请在工作区改正文件,然后酌情使用 'git add/rm <文件>' 命令标记 提示:解决方案并提交。 fatal: 因为存在未解决的冲突而退出。 zh01@zh01-pc:~/version_controll$ git add animal.py zh01@zh01-pc:~/version_controll$ git merge --continue [master efd4f8b] Merge branch 'dog' zh01@zh01-pc:~/version_controll$ git log --all --graph --decorate --oneline * efd4f8b (HEAD -> master) Merge branch 'dog' |\ | * 2807677 (dog) add dog functionfor animal.py * | 263b714 (cat) add new feature for animal.py |/ * 1e50a3e add animal.py to this repo * 057c72e add a new line for file hello.txt. * 4acae0d add two file to this repo
zh01@zh01-pc:~/version_controll$ git remote origin zh01@zh01-pc:~/version_controll$ git remote add origin ../remote/ fatal: 远程 origin 已经存在。 zh01@zh01-pc:~/version_controll$ git remote remove origin zh01@zh01-pc:~/version_controll$ git remote zh01@zh01-pc:~/version_controll$ git remote add origin ../remote zh01@zh01-pc:~/version_controll$ git push origin master:master fatal: '../remote' does not appear to be a git repository fatal: 无法读取远程仓库。
zh01@zh01-pc:~/remote$ git init --bare 已初始化空的 Git 仓库于 /home/zh01/remote/ zh01@zh01-pc:~/version_controll$ ls animal.py hello.txt new_file.txt zh01@zh01-pc:~/version_controll$ git push origin master:master 枚举对象: 19, 完成. 对象计数中: 100% (19/19), 完成. 使用 8 个线程进行压缩 压缩对象中: 100% (16/16), 完成. 写入对象中: 100% (19/19), 1.98 KiB | 1.98 MiB/s, 完成. 总共 19 (差异 3),复用 0 (差异 0) To ../remote * [new branch] master -> master zh01@zh01-pc:~/version_controll$ git log --all --graph --decorate --oneline * efd4f8b (HEAD -> master, origin/master) Merge branch 'dog' |\ | * 2807677 (dog) add dog functionfor animal.py * | 263b714 (cat) add new feature for animal.py |/ * 1e50a3e add animal.py to this repo * 057c72e add a new line for file hello.txt. * 4acae0d add two file to this repo zh01@zh01-pc:~/version_controll$ git log --all --graph --decorate --oneline * efd4f8b (HEAD -> master, origin/master) Merge branch 'dog' |\ | * 2807677 (dog) add dog functionfor animal.py * | 263b714 (cat) add new feature for animal.py |/ * 1e50a3e add animal.py to this repo * 057c72e add a new line for file hello.txt. * 4acae0d add two file to this repo zh01@zh01-pc:~/version_controll$ ls animal.py hello.txt new_file.txt zh01@zh01-pc:~/version_controll$ vim ./animal.py zh01@zh01-pc:~/version_controll$ git add . zh01@zh01-pc:~/version_controll$ git commit -m 'refactoring source code' [master fb3be48] refactoring source code 1 file changed, 2 insertions(+), 2 deletions(-) zh01@zh01-pc:~/version_controll$ git log --all --graph --decorate --oneline * fb3be48 (HEAD -> master) refactoring source code * efd4f8b (origin/master) Merge branch 'dog' |\ | * 2807677 (dog) add dog functionfor animal.py * | 263b714 (cat) add new feature for animal.py |/ * 1e50a3e add animal.py to this repo * 057c72e add a new line for file hello.txt. * 4acae0d add two file to this repo
zh01@zh01-pc:~/version_controll$ git log --all --graph --decorate --oneline * fb3be48 (HEAD -> master) refactoring source code * efd4f8b (origin/master) Merge branch 'dog' |\ | * 2807677 (dog) add dog functionfor animal.py * | 263b714 (cat) add new feature for animal.py |/ * 1e50a3e add animal.py to this repo * 057c72e add a new line for file hello.txt. * 4acae0d add two file to this repo zh01@zh01-pc:~/version_controll$ git branch --set-upstream-to=origin/master 分支 'master' 设置为跟踪来自 'origin' 的远程分支 'master'。 zh01@zh01-pc:~/version_controll$ git branch -vv cat 263b714 add new feature for animal.py dog 2807677 add dog functionfor animal.py * master fb3be48 [origin/master: 领先 1] refactoring source code zh01@zh01-pc:~/version_controll$ git push 枚举对象: 5, 完成. 对象计数中: 100% (5/5), 完成. 使用 8 个线程进行压缩 压缩对象中: 100% (3/3), 完成. 写入对象中: 100% (3/3), 361 字节 | 361.00 KiB/s, 完成. 总共 3 (差异 1),复用 0 (差异 0) To ../remote efd4f8b..fb3be48 master -> master
zh01@zh01-pc:~/vc$ git log --all --graph --decorate --oneline * fb3be48 (origin/master, origin/HEAD) refactoring source code * efd4f8b (HEAD -> master) Merge branch 'dog' |\ | * 2807677 add dog functionfor animal.py * | 263b714 add new feature for animal.py |/ * 1e50a3e add animal.py to this repo * 057c72e add a new line for file hello.txt. * 4acae0d add two file to this repo zh01@zh01-pc:~/vc$ git pull # equals to git fetch + git merge 更新 efd4f8b..fb3be48 Fast-forward animal.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) zh01@zh01-pc:~/vc$ git log --all --graph --decorate --oneline * fb3be48 (HEAD -> master, origin/master, origin/HEAD) refactoring source code * efd4f8b Merge branch 'dog' |\ | * 2807677 add dog functionfor animal.py * | 263b714 add new feature for animal.py |/ * 1e50a3e add animal.py to this repo * 057c72e add a new line for file hello.txt. * 4acae0d add two file to this repo
# get latest snapshot of source code git clone --shallow
# add file to this repo git add -p animal.py diff --git a/animal.py b/animal.py index 00c2edd..80a3972 100644 --- a/animal.py +++ b/animal.py @@ -7,9 +7,10 @@ def default(): print("hello")
def dog(): - print('woof') + print('Woof')
def main(): + print('debug print') if sys.argv[1] == 'cat': cat() elif sys.argv[1] == 'dog': (1/1) Stage this hunk [y,n,q,a,d,s,e,?]?
DeepSeek: The prompt (1/1) Stage this hunk [y,n,q,a,d,s,e,?]? is commonly seen when using Git’s interactive patch staging feature (e.g., git add -p or git add --patch). Here’s what it means and how to respond:
Explanation:
(1/1): This indicates you’re viewing the first (and only) hunk in the current file. If there were multiple hunks, it would show something like (1/3), meaning the first of three hunks.
Stage this hunk? Git is asking whether you want to stage (add to the next commit) the highlighted changes shown in the diff.
Options ([y,n,q,a,d,s,e,?]): These are the choices you can make:
y (yes): Stage this hunk.
n (no): Do not stage this hunk.
q (quit): Abort the interactive session and leave remaining hunks unstaged.
a (all): Stage this hunk and all remaining hunks in the file.
d (don’t stage): Do not stage this hunk or any remaining hunks in the file (opposite of a).
s (split): Split the hunk into smaller hunks (if possible) for more precise staging.
e (edit): Manually edit the hunk—useful for fine-tuning changes before staging (advanced).
? (help): Show this help message again.
When to Use This:
git add -p is powerful for reviewing changes carefully before committing.
Use it to avoid staging unwanted code (like debug logs or accidental changes).
Split (s) or edit (e) hunks if you want to stage only part of the changes in a file.
If you’re debugging an issue and find problematic code in line 42 of app.js, you could:
1
git blame -L 42,42 app.js
This shows you the commit hash and author. Then you can:
1
git show <commit-hash>
to examine the full changeset that introduced that line.
Would you like me to explain any specific aspect of git blame in more detail?
1
git show asjf
Prompt> introduce git stash and tell me how to use it?
DeepSeek:
Introduction to Git Stash
Git stash is a handy command that allows you to temporarily save changes you’ve made to your working directory without committing them. It’s particularly useful when you need to switch contexts quickly—like when you’re in the middle of working on something but need to address an urgent bug fix or switch branches.
Key Concepts of Git Stash
Stashing saves your uncommitted changes (both staged and unstaged) and reverts your working directory to match the HEAD commit
Stashes are stored locally in your Git repository
You can have multiple stashes saved at once
Stashes don’t get transferred when you push/pull from remote repositories
Basic Git Stash Commands
1. Stash Your Changes
1
git stash
or with a descriptive message:
1
git stash save "your descriptive message"
2. View Your Stashes
1
git stash list
This shows you all stashes in the format stash@{n}: branch: message
3. Apply Stashed Changes
To apply the most recent stash and keep it in the stash list:
1
git stash apply
To apply a specific stash:
1
git stash apply stash@{n}
(where n is the stash number from git stash list)
4. Apply and Remove from Stash (pop)
1
git stash pop
This applies the stash and removes it from the stash list.
5. Remove a Stash Without Applying
1
git stash drop stash@{n}
6. Clear All Stashes
1
git stash clear
Advanced Usage
Stash Specific Files
1
git stash push -p
This lets you interactively select which changes to stash.
Stash Untracked Files
1
git stash -u
Stash Ignored Files
1
git stash -a
Create a Branch from a Stash
1
git stash branch new-branch-name stash@{n}
This creates a new branch starting from the commit where you created the stash, then applies the stash changes to it.
When to Use Git Stash
When you need to quickly switch branches but aren’t ready to commit
Before pulling remote changes that might conflict with your local changes
When you need to test something on a clean working directory
To temporarily save experimental changes while you work on something else
Remember, stashes are meant to be temporary storage—don’t use them as a substitute for proper commits over long periods.
修改尚未加入提交(使用 "git add" 和/或 "git commit -a") 丢弃了 refs/stash@{0}(ee40adca5f13520e2599114aba984c74d9027675) zh01@zh01-pc:~/version_controll$ cat ./new_file.txt new file git stash here
Prompt> introduce git stash and tell me how to use it.
DeepSeek:
Git Stash: Introduction
Git stash is a powerful command that allows you to temporarily save changes in your working directory without committing them. This is useful when you need to switch branches or tasks but are not ready to commit your current work.
Reverts your working directory to the last commit (HEAD)
Lets you reapply the saved changes later
Basic Usage of git stash
1. Stash Changes
To stash your current changes:
1
git stash
Alternatively, you can include a descriptive message:
1
git stash save "work in progress on feature X"
By default, git stash only stashes tracked files. To include untracked files:
1
git stash -u
For including ignored files (rarely needed):
1
git stash -a # (--all)
2. List Saved Stashes
View all stored stashes:
1
git stash list
Output:
1 2
stash@{0}: On main: work in progress on login feature stash@{1}: On dev: temporary experiment
3. Reapply (Pop) Stashed Changes
To reapply the most recent stash and remove it from the stash list:
1
git stash pop
To apply a specific stash (stash@{n}):
1
git stash pop stash@{1}
To reapply stash without deleting it:
1
git stash apply stash@{0}
4. Delete a Stash
Drop (delete) a specific stash:
1
git stash drop stash@{1}
Clear all stashes (use with caution):
1
git stash clear
5. Stash Individual Files
Stash only specific changes (requires Git 2.13+):
1
git stash push -p # (--patch)
This opens an interactive prompt where you can choose which hunks to stash.
Common Use Cases
✅ Switching Branches: Stash work before switching branches. ✅ Pulling Latest Changes: Stash changes before doing git pull. ✅ Testing Something Quickly: Stash your current changes to test another idea.
Summary
Command
Description
git stash / git stash save "message"
Stash changes
git stash list
List all stashes
git stash pop
Apply & remove the latest stash
git stash apply stash@{n}
Apply stash without removing it
git stash drop stash@{n}
Delete a stash
git stash clear
Delete all stashes
git stash -u
Stash untracked files too
Hope this helps! Let me know if you’d like examples for more advanced stash usage.
Prompt> introduce git bisect and tell me how to use it.
DeepSeek:
Introducing Git Bisect
Git bisect is a powerful tool that helps you identify which specific commit introduced a bug or regression in your codebase. It uses a binary search algorithm to efficiently narrow down the problematic commit between a known “good” state and a known “bad” state.
How Git Bisect Works
You specify a “good” commit where the bug didn’t exist
You specify a “bad” commit where the bug does exist
Git checks out commits halfway between good and bad
You test each commit and tell Git if it’s good or bad
Git repeats this process until it pinpoints the exact commit that introduced the bug
Using Git Bisect: Step by Step
1. Start the bisect process
1
git bisect start
2. Mark the known bad commit (usually HEAD)
1
git bisect bad [commit-hash] # omit hash for HEAD
3. Mark a known good commit
1
git bisect good [commit-hash]
4. Begin testing commits
After marking good and bad commits, Git will automatically check out a commit halfway between them. At this point:
Test the code (run tests, manually verify behavior, etc.)
Tell Git the result:
If the bug exists:
1
git bisect bad
If the bug doesn’t exist:
1
git bisect good
Git will repeat the process until it finds the first bad commit
5. When finished
Once Git identifies the problematic commit:
1
git bisect reset # returns you to your original HEAD
Advanced Usage
Automating the process
You can create a script to automatically determine if a commit is good or bad:
Remember to commit your .gitignore file to share these rules with your team!
Prompt> tell me the difference between git reset and git rebase.
DeepSeek: Both git reset and git rebase are powerful Git commands used to modify commit history, but they serve different purposes and operate in distinct ways. Here’s a breakdown of their differences:
1. git reset
Purpose: Used to undo changes by moving the current branch pointer to a specified commit, optionally resetting the staging area (--soft/--mixed/--hard).
Effect:
Rewrites commit history locally (changes are not pushed to remote unless forced).
Can discard commits permanently (--hard) or keep changes (--soft/--mixed).
Use Cases:
Undo commits (e.g., git reset HEAD~1).
Discard changes (git reset --hard).
Impact:
Affects only your local repository; can cause issues if shared commits are discarded.
Modes:
--soft: Moves the branch pointer but keeps changes staged.
--mixed (default): Moves branch pointer & unstages changes (changes remain in working dir).
--hard: Discards all changes and resets to commit.
Example:
1 2 3 4 5 6 7 8
# Undo the last commit but keep changes staged: git reset --soft HEAD~1
# Undo the last commit & unstage changes: git reset HEAD~1
# Discard the last commit & all changes permanently: git reset --hard HEAD~1
2. git rebase
Purpose: Used to rewrite commit history by reapplying commits on top of a different base commit (often used for linearizing histories).
Effect:
Changes the commit history by creating new commits (old ones become dangling until garbage-collected).
Often used to clean up history before merging (interactive rebase: git rebase -i).
Use Cases:
Integrate changes from one branch into another (alternative to git merge).
Combine/squash/edit commits (git rebase -i).
Impact:
Can cause conflicts if rebased commits change underlying code.
Dangerous if used on shared branches (requires force-pushing).
Example:
1 2 3 4 5
# Rebase current branch onto another branch (e.g., `main`): git rebase main
# Interactive rebase (edit/squash/fixup commits): git rebase -i HEAD~3
To clean up commit history before merging into main.
When working on a feature branch and want to avoid merge commits.
⚠️ Warning: Both commands alter Git history. Avoid using them on commits already pushed unless you coordinate with collaborators (force-pushing may disrupt others’ work).
Would you like clarification on specific scenarios?
import random import time for _ inrange(100): i = random.randint(0, 10) if i <= 4: logger.info("Value is {} - Everything is fine".format(i)) elif i <= 6: logger.warning("Value is {} - System is getting hot".format(i)) elif i <= 8: logger.error("Value is {} - Dangerous region".format(i)) else: logger.critical("Maximum value reached") time.sleep(0.3)
1 2 3 4 5 6 7 8
shenjy@shenjy:~/msoce/debug_profiling$ printf"\e[38;2;255;0;0m This is red \e[0m\n" This is red
shenjy@shenjy:~/msoce/debug_profiling$ python -m ipdb bubble.py /usr/bin/python3: No module named ipdb shenjy@shenjy:~/msoce/debug_profiling$ pip install ipdb python3 -m pip install --upgrade pip
shenjy@shenjy:~/msoce/debug_profiling$ python -m ipdb bubble.py /usr/lib/python3.10/runpy.py:126: RuntimeWarning: 'ipdb.__main__' found in sys.modules after import of package 'ipdb', but prior to execution of 'ipdb.__main__'; this may result in unpredictable behaviour warn(RuntimeWarning(msg)) > /home/shenjy/msoce/debug_profiling/bubble.py(1)<module>() ----> 1 def bubble_sort(arr): 2 n = len(arr) 3 for i in range(n):
ipdb> l ----> 1 def bubble_sort(arr): 2 n = len(arr) 3 for i in range(n): 4 for j in range(n): 5 if arr[j] > arr[j+1]: 6 arr[j] = arr[j+1] 7 arr[j+1] = arr[j] 8 return arr 9 10 print(bubble_sort([4,2,1,8,7,6]))
ipdb> > /home/shenjy/msoce/debug_profiling/bubble.py(4)bubble_sort() 3 for i in range(n): ----> 4 for j in range(n): 5 if arr[j] > arr[j+1]:
ipdb> > /home/shenjy/msoce/debug_profiling/bubble.py(5)bubble_sort() 4 for j in range(n): ----> 5 if arr[j] > arr[j+1]: 6 arr[j] = arr[j+1]
ipdb> IndexError: list index out of range > /home/shenjy/msoce/debug_profiling/bubble.py(5)bubble_sort() 4 for j in range(n): ----> 5 if arr[j] > arr[j+1]: 6 arr[j] = arr[j+1]
ipdb> --Return-- None > /home/shenjy/msoce/debug_profiling/bubble.py(5)bubble_sort() 4 for j in range(n): ----> 5 if arr[j] > arr[j+1]: 6 arr[j] = arr[j+1]
ipdb> IndexError: list index out of range > /home/shenjy/msoce/debug_profiling/bubble.py(10)<module>() 8 return arr 9 ---> 10 print(bubble_sort([4,2,1,8,7,6]))
ipdb> restart Restarting bubble.py with arguments:
> /home/shenjy/msoce/debug_profiling/bubble.py(1)<module>() ----> 1 def bubble_sort(arr): 2 n = len(arr) 3 for i in range(n):
ipdb> c Traceback (most recent call last): File "/home/shenjy/.local/lib/python3.10/site-packages/ipdb/__main__.py", line 323, in main pdb._runscript(mainpyfile) File "/usr/lib/python3.10/pdb.py", line 1583, in _runscript self.run(statement) File "/usr/lib/python3.10/bdb.py", line 598, in run exec(cmd, globals, locals) File "<string>", line 1, in <module> File "/home/shenjy/msoce/debug_profiling/bubble.py", line 10, in <module> print(bubble_sort([4,2,1,8,7,6])) File "/home/shenjy/msoce/debug_profiling/bubble.py", line 5, in bubble_sort if arr[j] > arr[j+1]: IndexError: list index out of range Uncaught exception. Entering post mortem debugging Running 'cont' or 'step' will restart the program > /home/shenjy/msoce/debug_profiling/bubble.py(5)bubble_sort() 4 for j in range(n): ----> 5 if arr[j] > arr[j+1]: 6 arr[j] = arr[j+1]
ipdb> p arr [2, 1, 1, 7, 6, 6] ipdb> p j 5 ipdb> q Post mortem debugger finished. The bubble.py will be restarted > /home/shenjy/msoce/debug_profiling/bubble.py(1)<module>() ----> 1 def bubble_sort(arr): 2 n = len(arr) 3 for i in range(n):
ipdb> q
shenjy@shenjy:~/msoce/debug_profiling$ python -m ipdb bubble.py /usr/lib/python3.10/runpy.py:126: RuntimeWarning: 'ipdb.__main__' found in sys.modules after import of package 'ipdb', but prior to execution of 'ipdb.__main__'; this may result in unpredictable behaviour warn(RuntimeWarning(msg)) > /home/shenjy/msoce/debug_profiling/bubble.py(1)<module>() ----> 1 def bubble_sort(arr): 2 n = len(arr) 3 for i in range(n):
ipdb> l ----> 1 def bubble_sort(arr): 2 n = len(arr) 3 for i in range(n): 4 for j in range(n-1): 5 if arr[j] > arr[j+1]: 6 arr[j] = arr[j+1] 7 arr[j+1] = arr[j] 8 return arr 9 10 print(bubble_sort([4,2,1,8,7,6]))
ipdb> b 6 Breakpoint 1 at /home/shenjy/msoce/debug_profiling/bubble.py:6 ipdb> c > /home/shenjy/msoce/debug_profiling/bubble.py(6)bubble_sort() 5 if arr[j] > arr[j+1]: 1---> 6 arr[j] = arr[j+1] 7 arr[j+1] = arr[j]
shenjy@shenjy:~$ strace -e lstat ls -l > /dev/null +++ exited with 0 +++
lint.py 文件
1 2 3 4 5 6 7 8 9 10 11 12
import time
deffoo(): return42
for foo inrange(5): print(foo)
bar = 1 bar *= 0.2 time.sleep(60) print(baz)
1 2 3 4 5 6 7
# 执行上面 python 程序 python lint.py
# pyflakes 命令 # mypy 命令 # writegood 命令 timels
1 2 3 4 5 6 7 8 9 10
import time
# get current time start = time.time()
# Do some work print("Sleep for {} s".format(n/1000))
# compute time between start and now print(time.time() - start)
grep.py
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
import sys, re
defgrep(pattern, file): withopen(file, 'r') as f: print(file) for i, line inenumerate(f.readlines()): pattern = re.compile(pattern) match = pattern.search(line) ifmatchisnotNone: print("{}: {}".format(i, line), end="")
if __name__ == '__main__': times = int(sys.argv[1]) pattern = sys.argv[2] for i inrange(times): for file in sys.argv[3:]: grep(pattern, file)
DESCRIPTION OpenSSL is a cryptography toolkit implementing the Secure Sockets Layer (SSL v2/v3) and Transport Layer Security (TLS v1) network protocols and related cryptography standards required by them.
The openssl program is a command line program for using the various cryptography functions of OpenSSL's crypto library from the shell. It can be used for o Creation and management of private keys, public keys and parameters o Public key cryptographic operations o Creation of X.509 certificates, CSRs and CRLs o Calculation of Message Digests and Message Authentication Codes o Encryption and Decryption with Ciphers o SSL/TLS Client and Server Tests o Handling of S/MIME signed or encrypted mail o Timestamp requests, generation and verification COMMAND SUMMARY The openssl program provides a rich variety of commands (command in the "SYNOPSIS" above). Each command can have many options and argument parameters, shown above as options and parameters. Detailed documentation and use cases for most standard subcommands are available (e.g., openssl-x509(1)). The list options -standard-commands, -digest-commands, and -cipher-commands output a list (one entry per line) of the names of all standard commands, message digest commands, or cipher commands, respectively, that are available. The list parameters -cipher-algorithms, -digest-algorithms, and -mac-algorithms list all cipher, message digest, and message authentication code names, one entry per line. Aliases are listed as: from => to The list parameter -public-key-algorithms lists all supported public key algorithms. The command no-XXX tests whether a command of the specified name is available. If no command named XXX exists, it returns 0 (success) and prints no-XXX; otherwise it returns 1 and prints XXX. In both cases, the output goes to stdout and nothing is printed to stderr. Additional command line arguments are always ignored. Since for each cipher there is a command of the same name, this provides an easy way for shell scripts to test for the availability of ciphers in the openssl program. (no-XXX is not able to detect pseudo-commands such as quit, list, or no-XXX itself.) Configuration Option Many commands use an external configuration file for some or all of their arguments and have a -config option to specify that file. The default name of the file is openssl.cnf in the default certificate storage area, which can be determined from the openssl-version(1) command using the -d or -a option. The environment variable OPENSSL_CONF can be used to specify a different file location or to disable loading a configuration (using the empty string). Among others, the configuration file can be used to load modules and to specify parameters for generating certificates and random numbers. See config(5) for details. Standard Commands asn1parse Parse an ASN.1 sequence. ca Certificate Authority (CA) Management. ciphers Cipher Suite Description Determination. cms CMS (Cryptographic Message Syntax) command. crl Certificate Revocation List (CRL) Management. crl2pkcs7 CRL to PKCS#7 Conversion. dgst Message Digest calculation. MAC calculations are superseded by openssl-mac(1). dhparam Generation and Management of Diffie-Hellman Parameters. Superseded by openssl-genpkey(1) and openssl-pkeyparam(1). dsa DSA Data Management. dsaparam DSA Parameter Generation and Management. Superseded by openssl-genpkey(1) and openssl-pkeyparam(1). ec EC (Elliptic curve) key processing. ecparam EC parameter manipulation and generation. enc Encryption, decryption, and encoding. engine Engine (loadable module) information and manipulation. errstr Error Number to Error String Conversion. fipsinstall FIPS configuration installation. gendsa Generation of DSA Private Key from Parameters. Superseded by openssl-genpkey(1) and openssl-pkey(1). genpkey Generation of Private Key or Parameters. genrsa Generation of RSA Private Key. Superseded by openssl-genpkey(1). help Display information about a command's options.
info Display diverse information built into the OpenSSL libraries.
kdf Key Derivation Functions.
list List algorithms and features.
mac Message Authentication Code Calculation.
nseq Create or examine a Netscape certificate sequence.
ocsp Online Certificate Status Protocol command.
passwd Generation of hashed passwords.
pkcs12 PKCS#12 Data Management.
pkcs7 PKCS#7 Data Management.
pkcs8 PKCS#8 format private key conversion command.
pkey Public and private key management.
pkeyparam Public key algorithm parameter management.
pkeyutl Public key algorithm cryptographic operation command.
prime Compute prime numbers.
rand Generate pseudo-random bytes.
rehash Create symbolic links to certificate and CRL files named by the hash values.
rsautl RSA commandfor signing, verification, encryption, and decryption. Superseded by openssl-pkeyutl(1).
s_client This implements a generic SSL/TLS client which can establish a transparent connection to a remote server speaking SSL/TLS. It's intended for testing purposes only and provides only rudimentary interface functionality but internally uses mostly all functionality of the OpenSSL ssl library. s_server This implements a generic SSL/TLS server which accepts connections from remote clients speaking SSL/TLS. It's intended for testing purposes only and provides only rudimentary interface functionality but internally uses mostly all functionality of the OpenSSL ssl library. It provides both an own command line oriented protocol for testing SSL functions and a simple HTTP response facility to emulate an SSL/TLS-aware webserver.
s_time SSL Connection Timer.
sess_id SSL Session Data Management.
smime S/MIME mail processing.
speed Algorithm Speed Measurement.
spkac SPKAC printing and generating command.
srp Maintain SRP password file. This command is deprecated.
storeutl Command to list and display certificates, keys, CRLs, etc.
ts Time Stamping Authority command.
verify X.509 Certificate Verification. See also the openssl-verification-options(1) manual page.
OPTIONS Details of which options are available depend on the specific command. This section describes some common options with common behavior.
Common Options -help Provides a terse summary of all options. If an option takes an argument, the "type" of argument is also given.
-- This terminates the list of options. It is mostly useful if any filename parameters start with a minus sign:
openssl verify [flags...] -- -cert1.pem...
Format Options See openssl-format-options(1) for manual page.
Pass Phrase Options See the openssl-passphrase-options(1) manual page.
Random State Options Prior to OpenSSL 1.1.1, it was common for applications to store information about the state of the random-number generator in a file that was loaded at startup and rewritten upon exit. On modern operating systems, this is generally no longer necessary as OpenSSL will seed itself from a trusted entropy source provided by the operating system. These flags are still supported for special platforms or circumstances that might require them.
It is generally an error to use the same seed file more than once and every use of -rand should be paired with -writerand.
-rand files A file or files containing random data used to seed the random number generator. Multiple files can be specified separated by an OS-dependent character. The separator is ";"for MS-Windows, ","for OpenVMS, and ":"for all others. Another way to specify multiple files is to repeat this flag with different filenames.
-writerand file Writes the seed data to the specified file upon exit. This file can be used in a subsequent command invocation.
Certificate Verification Options See the openssl-verification-options(1) manual page.
Name Format Options See the openssl-namedisplay-options(1) manual page.
TLS Version Options Several commands use SSL, TLS, or DTLS. By default, the commands use TLS and clients will offer the lowest and highest protocol version they support, and servers will pick the highest version that the client offers that is also supported by the server.
The options below can be used to limitwhich protocol versions are used, and whether TCP (SSL and TLS) or UDP (DTLS) is used. Note that not all protocols and flags may be available, depending on how OpenSSL was built.
-ssl3, -tls1, -tls1_1, -tls1_2, -tls1_3, -no_ssl3, -no_tls1, -no_tls1_1, -no_tls1_2, -no_tls1_3 These options require or disable the use of the specified SSL or TLS protocols. When a specific TLS version is required, only that version will be offered or accepted. Only one specific protocol can be given and it cannot be combined with any of the no_ options.
-dtls, -dtls1, -dtls1_2 These options specify to use DTLS instead of DLTS. With -dtls, clients will negotiate any supported DTLS protocol version. Use the -dtls1 or -dtls1_2 options to support only DTLS1.0 or DTLS1.2, respectively.
Engine Options -engine id Load the engine identified by id and use all the methods it implements (algorithms, key storage, etc.), unless specified otherwise in the command-specific documentation or it is configured to do so, as described in"Engine Configuration"in config(5).
The engine will be used for key ids specified with -key and similar options when an option like -keyform engine is given.
A special case is the "loader_attic" engine, which is meant just for internal OpenSSL testing purposes and supports loading keys, parameters, certificates, and CRLs from files. When this engine is used, files with such credentials are read via this engine. Using the "file:" schema is optional; a plain file (path) name will do.
Options specifying keys, like -key and similar, can use the generic OpenSSL engine key loading URI scheme "org.openssl.engine:" to retrieve private keys and public keys. The URI syntax is as follows, in simplified form:
org.openssl.engine:{engineid}:{keyid}
Where "{engineid}" is the identity/name of the engine, and "{keyid}" is a key identifier that's acceptable by that engine. For example, when using an engine that interfaces against a PKCS#11 implementation, the generic key URI would be something like this (this happens to be an example for the PKCS#11 engine that's part of OpenSC):
As a third possibility, for engines and providers that have implemented their own OSSL_STORE_LOADER(3), "org.openssl.engine:" should not be necessary. For a PKCS#11 implementation that has implemented such a loader, the PKCS#11 URI as defined in RFC 7512 should be possible to use directly:
Provider Options -provider name Load and initialize the provider identified by name. The name can be also a path to the provider module. In that case the provider name will be the specified path and not just the provider module name. Interpretation of relative paths is platform specific. The configured "MODULESDIR" path, OPENSSL_MODULES environment variable, or the path specified by -provider-path is prepended to relative paths. See provider(7) for a more detailed description.
-provider-path path Specifies the search path that is to be used for looking for providers. Equivalently, the OPENSSL_MODULES environment variable may be set.
-propquery propq Specifies the property query clause to be used when fetching algorithms from the loaded providers. See property(7) for a more detailed description.
ENVIRONMENT The OpenSSL library can be take some configuration parameters from the environment. Some of these variables are listed below. For information about specific commands, see openssl-engine(1), openssl-rehash(1), and tsget(1).
For information about the use of environment variables in configuration, see "ENVIRONMENT"in config(5).
For information about querying or specifying CPU architecture flags, see OPENSSL_ia32cap(3), and OPENSSL_s390xcap(3).
For information about all environment variables used by the OpenSSL libraries, see openssl-env(7).
OPENSSL_TRACE=name[,...] Enable tracing output of OpenSSL library, by name. This output will only make sense if you know OpenSSL internals well. Also, it might not give you any output at all, depending on how OpenSSL was built.
The value is a comma separated list of names, with the following available:
TRACE The tracing functionality.
TLS General SSL/TLS.
TLS_CIPHER SSL/TLS cipher.
CONF Show details about provider and engine configuration.
ENGINE_TABLE The function that is used by RSA, DSA (etc) code to select registered ENGINEs, cache defaults and functional references (etc), will generate debugging summaries.
ENGINE_REF_COUNT Reference counts in the ENGINE structure will be monitored with a line of generated for each change.
PKCS5V2 PKCS#5 v2 keygen.
PKCS12_KEYGEN PKCS#12 key generation.
PKCS12_DECRYPT PKCS#12 decryption.
X509V3_POLICY Generates the complete policy tree at various point during X.509 v3 policy evaluation.
HISTORY The list -XXX-algorithms options were added in OpenSSL 1.0.0; For notes on the availability of other commands, see their individual manual pages.
The -issuer_checks option is deprecated as of OpenSSL 1.1.0 and is silently ignored.
The -xcertform and -xkeyform options are obsolete since OpenSSL 3.0 and have no effect.
The interactive mode, which could be invoked by running "openssl" with no further arguments, was removed in OpenSSL 3.0, and running that program with no arguments is now equivalent to "openssl help".
COPYRIGHT Copyright 2000-2021 The OpenSSL Project Authors. All Rights Reserved.
Licensed under the Apache License 2.0 (the "License"). You may not use this file except in compliance with the License. You can obtain a copy in the file LICENSE in the source distribution or at <https://www.openssl.org/source/license.html>.