Welcome to Linux Knowledge Base and Tutorial
"The place where you learn linux"
CARE

 Create an AccountHome | Submit News | Your Account  

Tutorial Menu
Linux Tutorial Home
Table of Contents

· Introduction to Operating Systems
· Linux Basics
· Working with the System
· Shells and Utilities
· Editing Files
· Basic Administration
· The Operating System
· The X Windowing System
· The Computer Itself
· Networking
· System Monitoring
· Solving Problems
· Security
· Installing and Upgrading
· Linux and Windows

Glossary
MoreInfo
Man Pages
Linux Topics
Test Your Knowledge

Site Menu
Site Map
FAQ
Copyright Info
Terms of Use
Privacy Info
Disclaimer
WorkBoard
Thanks
Donations
Advertising
Masthead / Impressum
Your Account

Communication
Feedback
Forums
Private Messages
Recommend Us
Surveys

Features
HOWTOs
News
News Archive
Submit News
Topics
User Articles
Web Links

Google
Google


The Web
linux-tutorial.info

Who's Online
There are currently, 218 guest(s) and 1 member(s) that are online.

You are an Anonymous user. You can register for free by clicking here

  

HOWTO Home

Current HOWTO: Bash-Prompt-HOWTO


Bash Prompt HOWTO

Bash Prompt HOWTO

$Revision: 0.93 $, $Date: 2003/11/06 02:12:02 $

Giles Orr

Creating and controlling terminal and xterm prompts is discussed, including incorporating standard escape sequences to give username, current working directory, time, etc. Further suggestions are made on how to modify xterm title bars, use external functions to provide prompt information, and how to use ANSI colours.


Table of Contents
1. Introduction and Administrivia
1.1. Introduction
1.2. Revision History
1.3. Requirements
1.4. How To Use This Document
1.5. Document Versions, Comments and Suggestions
1.6. Problems
1.7. Credits/Bibliography
1.8. Disclaimer
2. Bash and Bash Prompts
2.1. What is Bash?
2.2. What Can Tweaking Your Bash Prompt Do For You?
2.3. Why Bother?
2.4. The First Step
2.5. Bash Prompt Escape Sequences
2.6. Setting the PS? Strings Permanently
3. Bash Programming and Shell Scripts
3.1. Variables
3.2. Quotes and Special Characters
3.3. Command Substitution
3.4. Non-Printing Characters in Prompts
3.5. Sourcing a File
3.6. Functions, Aliases, and the Environment
4. External Commands
4.1. PROMPT_COMMAND
4.2. External Commands in the Prompt
4.3. What to Put in Your Prompt
5. Saving Complex Prompts
6. ANSI Escape Sequences: Colours and Cursor Movement
6.1. Colours
6.2. Cursor Movement
6.3. Xterm Title Bar Manipulations
6.4. Xterm Title Bars and Screen
6.5. Colours and Cursor Movement With tput
7. Special Characters: Octal Escape Sequences
8. The Bash Prompt Package
8.1. Availability
8.2. Xterm Fonts
8.3. Changing the Xterm Font
8.4. Line Draw Characters without VGA Fonts
9. Loading a Different Prompt
9.1. Loading a Different Prompt, Later
9.2. Loading a Different Prompt, Immediately
9.3. Loading Different Prompts in Different X Terms
10. Loading Prompt Colours Dynamically
10.1. A "Proof of Concept" Example
11. Prompt Code Snippets
11.1. Built-in Escape Sequences
11.2. Date and Time
11.3. Counting Files in the Current Directory
11.4. Total Bytes in the Current Directory
11.5. Checking the Current TTY
11.6. Stopped Jobs Count
11.7. Load
11.8. Uptime
11.9. Number of Processes
11.10. Controlling the Size and Appearance of $PWD
11.11. Laptop Power
11.12. Having the Prompt Ignored on Cut and Paste
11.13. New Mail
11.14. Prompt Beeps After Long-Running Commands
12. Example Prompts
12.1. Examples on the Web
12.2. A "Lightweight" Prompt
12.3. Dan's Prompt
12.4. Elite from Bashprompt Themes
12.5. A "Power User" Prompt
12.6. Prompt Depending on Connection Type
12.7. A Prompt the Width of Your Term
12.8. The Floating Clock Prompt
12.9. The Elegant Useless Clock Prompt
A. GNU Free Documentation License
0. PREAMBLE
1. APPLICABILITY AND DEFINITIONS
2. VERBATIM COPYING
3. COPYING IN QUANTITY
4. MODIFICATIONS
5. COMBINING DOCUMENTS
6. COLLECTIONS OF DOCUMENTS
7. AGGREGATION WITH INDEPENDENT WORKS
8. TRANSLATION
9. TERMINATION
10. FUTURE REVISIONS OF THIS LICENSE
How to use this License for your documents

The Linux Tutorial completely respects the rights of authors and artists to decide for themselves if and how their works can be used, independent of any existing licenses. This means if you are the author of any document presented on this site and do no wish it to be displayed as it is on this site or do not wish it to be displayed at all, please contact us and we will do our very best to accommodate you. If we are unable to accommodate you, we will, at your request, remove your document as quickly as possible.

If you are the author of any document presented on this site and would like a share of the advertising revenue, please contact us using the standard Feedback Form.


  
Show your Support for the Linux Tutorial

Purchase one of the products from our new online shop. For each product you purchase, the Linux Tutorial gets a portion of the proceeds to help keep us going.


Login
Nickname

Password

Security Code
Security Code
Type Security Code


Don't have an account yet? You can create one. As a registered user you have some advantages like theme manager, comments configuration and post comments with your name.

Help if you can!


Amazon Wish List

Did You Know?
The Linux Tutorial can use your help.


Friends



Tell a Friend About Us

Bookmark and Share



Web site powered by PHP-Nuke

Is this information useful? At the very least you can help by spreading the word to your favorite newsgroups, mailing lists and forums.
All logos and trademarks in this site are property of their respective owner. The comments are property of their posters. Articles are the property of their respective owners. Unless otherwise stated in the body of the article, article content (C) 1994-2013 by James Mohr. All rights reserved. The stylized page/paper, as well as the terms "The Linux Tutorial", "The Linux Server Tutorial", "The Linux Knowledge Base and Tutorial" and "The place where you learn Linux" are service marks of James Mohr. All rights reserved.
The Linux Knowledge Base and Tutorial may contain links to sites on the Internet, which are owned and operated by third parties. The Linux Tutorial is not responsible for the content of any such third-party site. By viewing/utilizing this web site, you have agreed to our disclaimer, terms of use and privacy policy. Use of automated download software ("harvesters") such as wget, httrack, etc. causes the site to quickly exceed its bandwidth limitation and are therefore expressly prohibited. For more details on this, take a look here

PHP-Nuke Copyright © 2004 by Francisco Burzi. This is free software, and you may redistribute it under the GPL. PHP-Nuke comes with absolutely no warranty, for details, see the license.
Page Generation: 0.12 Seconds