---
title: "Discussion on \"完整的ps1控制码\" | Hashnode"
description: "Discussion on \"完整的ps1控制码\". PS1变量是在 shell 下用于定义提示符的变量，本文列出了可用于该变量的所有的控制代码，仅供参考.\n\n不同于其它文章中给出的常用控制码，以下内容完全转自man手册，应该是比较完整的\n\n\n\n\n\n\n序号参数说明\n\n\n\n1\\aASCII字符(07)，响铃bell\n\n2\\d代表日期，格式为weekday month date，例如：\"Mon Aug 1\"\n\n3\\D{format}format会作为参数传给strftime()，返回的结果将插入提示符，大括号是必须的\n\n4\\eASCII字符(033)\n..."
url: "https://hashnode.com/posts/100002-ps1-control-codes/634f8feb54ea85359128b7a5"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [完整的ps1控制码](https://whowin.cn/100002-ps1-control-codes?utm_source=hashnode&utm_medium=feed)

PS1变量是在 shell 下用于定义提示符的变量，本文列出了可用于该变量的所有的控制代码，仅供参考. 不同于其它文章中给出的常用控制码，以下内容完全转自man手册，应该是比较完整的 序号参数说明 1\\aASCII字符(07)，响铃bell 2\\d代表日期，格式为weekday month date，例如："Mon Aug 1" 3\\D{format}format会作为参数传给strftime()，返回的结果将插入提示符，大括号是必须的 4\\eASCII字符(033) ...

Mar 31, 2022 · 1 min read · whowin.cn  
Updated Oct 14, 2024  
Read the article

-   [#shell](https://hashnode.com/tag/shell)
-   [#ps1](https://hashnode.com/tag/ps1)
-   [#546v5akd5yy6yep](https://hashnode.com/tag/546v5akd5yy6yep)

## Written by

[whowin](https://hashnode.com/@whowin)

@whowin · Beijing, China

  
[View profile](https://hashnode.com/@whowin)

一枚有30多年经验的退休程序员，主要从事嵌入式软件开发

## Responses

Markdown supported · ⌘↵ to post

No responses yet.
