---
title: "Unix command coloring."
author: "RobertLeeJesus"
date: "2008-07-28T16:27:42Z"
tags: []
slug: "unix-command-coloring"
draft: false
lastmod: "2008-07-28T16:27:42Z"
id: 220515
url: "https://hidefromall.iteye.com/blog/220515"
---

1\. System.out.println("\\u001b[1;31mhahahahhaha\\u001b[1;37m");

           hahahahhaha

 

    \\u001b[1;31m

    means to start with red.

 

    \\u001b[1;37m

    means to start with default color, that is to say, close the coloring.

 

2\. alias cvsDirty="cvs status | grep File | grep Modified | sed 's#\\(File:.\*Status:.\*\\)#\\x1b[1;31m\\1\\x1b[1;37m#'"

    Create a alias to highlight the modified file.

 

File: L360-CEF-client-test.jpr    Status: Locally Modified  
File: L360CEF.properties    Status: Locally Modified  
File: L360-CEF-server.jpr    Status: Locally Modified  
File: L360-CEF-server-test.jpr    Status: Locally Modified

 

    sed sytax, **sed 's#SRC#DEST#"** , replace all the matches SRC with DEST.

 

    \\x1b[1;31m

    means to start with red.

 

    \\x1b[1;37m

    means to start with default color, that is to say, close the coloring.