background preloader

How to: Change / Setup bash custom prompt (PS1)

How to: Change / Setup bash custom prompt (PS1)
So how do you setup, change and pimp out Linux / UNIX shell prompt? Most of us work with a shell prompt. By default most Linux distro displays hostname and current working directory. You can easily customize your prompt to display information important to you. You change look and feel by adding colors. In this small howto I will explain howto setup: a] Howto customizing a bash shell to get a good looking prompt b] Configure the appearance of the terminal. c] Apply themes using bashish d] Howto pimp out your shell prompt Prompt is control via a special shell variable. PS1 – The value of this parameter is expanded (see PROMPTING below) and used as the primary prompt string. How do I display current prompt setting? Simply use echo command, enter: $ echo $PS1 Output: \\u@\h \\W]\\$ How do I modify or change the prompt? Modifying the prompt is easy task. touch me : Let us try to set the prompt so that it can display today’d date and hostname: PS1="\d \h $ " Output: Sat Jun 02 server $

http://www.cyberciti.biz/tips/howto-linux-unix-bash-shell-setup-prompt.html

Related:  GIT

GUI Clients Git comes with built-in GUI tools for committing (git-gui) and browsing (gitk), but there are several third-party tools for users looking for platform-specific experience. Only show GUIs for my OS (Linux)0Linux GUIs are highlighted below ↓ GitHub DesktopPlatforms: Windows, MacPrice: Free GitX-dev Platforms: MacPrice: Free SourceTreePlatforms: Mac, WindowsPrice: Free SmartGitPlatforms: Windows, Mac, LinuxPrice: $79/user / Free for non-commercial use GitUpPlatforms: MacPrice: Free gigglePlatforms: LinuxPrice: Free GitKrakenPlatforms: Windows, Mac, LinuxPrice: Free ForkPlatforms: MacPrice: Free TowerPlatforms: Windows, MacPrice: $79/user (Free 30 day trial) GitboxPlatforms: MacPrice: $14.99 Git ExtensionsPlatforms: WindowsPrice: Free git-colaPlatforms: Windows, Mac, LinuxPrice: Free GitEyePlatforms: Windows, Mac, LinuxPrice: Free gitgPlatforms: LinuxPrice: Free

Tip: Prompt magic As Linux/UNIX people, we spend a lot of time working in the shell, and in many cases, this is what we have staring back at us: If you happen to be root, you're entitled to the "prestige" version of this beautiful prompt: These prompts are not exactly pretty. It's no wonder that several Linux distributions have upgraded their default prompts that add color and additional information to boot. Working more productively with bash 2.x/3.x Overview and Introduction bash is a shell, a.k.a. command language interpreter for modern computers. It is Bourne shell (sh) compatible and incorporates useful features from the Korn shell (ksh) and C shell (csh). It conforms to the IEEE POSIX P1003.2/ISO 9945.2 Shell and Tools standard. Some of bash's features are, in no particular order: editing and completion; history and command re-entry; job control; shell functions and aliases; arrays; arithmetic; ANSI C quoting; tilde expansion; brace expansion; substring capabilities; indirect variable expansion; expanded I/O capabilities; control of built-in commands; help; directory stack; POSIX mode; internationalisation; command timing.

gitk Documentation To control which revisions to show, gitk supports most options applicable to the git rev-list command. It also supports a few options applicable to the git diff-* commands to control how the changes each commit introduces are shown. Finally, it supports some gitk-specific options. gitk generally only understands options with arguments in the sticked form (see gitcli[7]) due to limitations in the command-line parser. rev-list options and arguments This manual page describes only the most frequently used options. Howto: Linux write (burn) data to DVD or DVD/RW In order to write DVD/DVD-RW from shell prompt you need to install a package called dvd+rw-tools. DVD is another good option for backup, archiving, data exchange etc. You can install dvd+rw-tools with following commands. Also note that this package works under *BSD, HP-UX, Solaris and other UNIX like operating systems. Debian installation: # apt-get install 'dvd+rw-tools' Fedora Core Linux installation: # yum install 'dvd+rw-tools'

Linux Force DHCP client (dhclient) to renew ip address byVivek GiteonNovember 15, 2007 last updated May 12, 2015 I'm using Ubuntu Linux. How to force Linux to reacquire a new IP address from the DHCP server? What is the command in Linux equivalent to Windows' "ipconfig /renew" command? You need to use Dynamic Host Configuration Protocol Client i.e. dhclient command. The client normally doesn't release the current lease as it is not required by the DHCP protocol. Setting up a repository - git-init This tutorial provides a succinct overview of the most important Git commands. First, the Setting Up a Repository section explains all of the tools you need to start a new version-controlled project. Then, the remaining sections introduce your everyday Git commands. Learning the shell - Lesson 6: I/O Redirection In this lesson, we will explore a powerful feature used by many command line programs called input/output redirection. As we have seen, many commands such as ls print their output on the display. This does not have to be the case, however. By using some special notation we can redirect the output of many commands to files, devices, and even to the input of other commands. Standard Output Most command line programs that display their results do so by sending their results to a facility called standard output.

Related: