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 $ Related:  GIT

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. bash is the default shell on all popular GNU/Linux distributions. bash is, perhaps, the Linux program you use the most at work, yet how much are you really getting out of it? bash Tips and Tricks readline Tips and Tricks Programmable Completion Introduction Standard completion Download Installation Getting started .

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

How to call external command in Python 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. --all Show all refs (branches, tags, etc.). --branches[=<pattern>]--tags[=<pattern>]--remotes[=<pattern>] Pretend as if all the branches (tags, remote branches, resp.) are listed on the command line as <commit>. --since=<date> Show commits more recent than a specific date. --until=<date> Show commits older than a specific date. --date-order Sort commits by date when possible. --merge --left-right Mark which side of a symmetric diff a commit is reachable from. --full-history --simplify-merges

how to display only Permissions and file names using ls command Documentation Documentation Reference Reference Manual The official and comprehensive man pages that are included in the Git package itself. Quick reference guides: GitHub Cheat Sheet (PDF) | Visual Git Cheat Sheet (SVG | PNG) Book Pro Git The entire Pro Git book written by Scott Chacon and Ben Straub is available to read online for free. Videos See all videos → External Links The External Links section is a curated, ever-evolving collection of tutorials, books, videos, and other Git resources. 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. The dhclient command, provides a means for configuring one or more network interfaces using the Dynamic Host Configuration Protocol, BOOTP protocol, or if these protocols fail, by statically assigning an address. Linux renew ip command The -r flag explicitly releases the current lease, and once the lease has been released, the client exits. How can I renew or release an IP in Linux for eth0? To renew or release an IP address for the eth0 interface, enter: $ sudo dhclient -r eth0 $ sudo dhclient eth0 In this example, I am renewing an IP address for my wireless interface: Sample outputs:

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. By the end of this module, you should be able to create a Git repository, record snapshots of your project for safekeeping, and view your project’s history. git init The git init command creates a new Git repository. Executing git init creates a .git subdirectory in the project root, which contains all of the necessary metadata for the repo. Usage git init Transform the current directory into a Git repository. git init <directory> Create an empty Git repository in the specified directory. git init --bare <directory> Initialize an empty Git repository, but omit the working directory. Discussion Compared to SVN, the git init command is an incredibly easy way to create new version-controlled projects. Bare Repositories Example git clone