If you’re like me you always intend to customize your UNIX or Linux prompt but never seem to find the time to look up the options and make the change. Well, to give you a jump start here’s an excerpt from my book Easy Linux Commands.

In order to eliminate the need to frequently issue the pwd command to determine the current working directory, many Linux users choose to display the working directory within the Linux command prompt. Some Linux administrators even provide this service for their users when they create their Linux accounts. If a user’s command prompt does not contain the working directory, the command prompt can be modified by changing the prompt string 1 (PS1) shell variable as demonstrated here:

$ PS1="[\u@\h \w]\\$ "
[tclark@appsvr /home/tclark]$

This example of setting the PS1 variable also adds the username (\u) and hostname (\h) to the prompt. This can be very useful if you frequently connect to different hosts and as different users.

In order to avoid having to modify the prompt at each login, the following line of code can be placed within the appropriate configuration file, such as .bash_profile for the bash shell, within the home directory. To do this you can use a text editor like vi to add the following line to your .bash_profile file:

export PS1="[\u@\h \w]\\$ "

Note: Files that begin with a period will not appear when you list the contents of a directory. To see these hidden files use the command ls –a

There are even more options which you can put into your PS1 prompt. While it’s nice to keep your prompt fairly short you may find some of the other options useful. The following table contains a list of values that can be displayed within the PS1 and/or PS2 prompt strings:

Symbol

Displayed Value

\!

History number of current command

\#

Command number of current command

\d

Current date

\h

Host name

\n

Newline

\s

Shell name

\t

Current time

\u

User name

\W

Current working directory

\w

Current working directory (full path)

As a bonus, here are a few of my favorite options for the PS1 prompt:

Prompt:
export PS1='\u@\h$ '
Result:
oracle@glonk$

Prompt:
export PS1='\w$ '
Result:
/usr/local$

Prompt:
export PS1='\d$ '
Result:
Mon Oct 30$

You may notice that all these have the dollar sign ($) in them which is typical of bash prompts. There is also a space after the dollar sign so you can easily tell where your prompt ends and your commands begin.

Easy Linux CommandsFor more tips like this check out my book Easy Linux Commands, only $19.95 from Rampant TechPress.

Buy it now!


linux, unix, system administration, sysadmin, bash, shell, unix shell, shell prompt

Sometimes the comments are better than the original article.

Last week Mike Schaffner left this fantastic comment on my article Why Blog? He brings up several great points and I wanted to give it more attention than it might get just as a comment. Thanks Mike!

— Begin comment by Mike Schaffner:

Blogging can also be a useful tool in your job search as a way of establishing your “brand” and differentiating yourself.

During my job search I’ve gotten to know Kent Blumberg. Kent is a dynamic manufacturing and process industry operation exec also conducting a job search campaign. As part of his marketing plan Kent uses a weblog or “blog” ( Kent Blumberg ) to discuss timely issues in Leadership, Strategy and Performance.

Because of my desire to stay current with the issues facing IT and never having been shy about voicing my opinion I’ve taken my lead from Kent’s example and have started my own blog ( Mike Schaffner ) . In it I discuss “Management of Information Technology for Strategic Alignment with the Business” plus other related topics that come to mind.

When I started to think about it, blogs offer a number of advantages in a job search. They don’t replace any of the standard techniques but they can complement them.

** It is yet another form of networking
Through blogging and linking and contacting other people you have the opportunity to expand your network in way you could not have done otherwise

** It helps to “refresh” your name with your network
One of the rules of networking is to keep your name in front of your contacts so they don’t forget about you. RSS feeds and email subscriptions make this easier and can give your contacts useful information without the overt pressure of you asking for a job lead

** It is a great form of viral advertising
Blogs can help to give you a web presence and get your name out to the whole world. Many prospective employers will google you before the interview (as you should google them). Blogging will build your search engine presence. One master of blogging says that “blog” stands for “Better Listings On Google.” In my experience, that is certainly true.

** It is a great form of “push” marketing
It is a promotional strategy to create a demand complementing the “pull” marketing of your advertising i.e. resume

** It keeps you in the game
When we start a job search we leave our professional world behind and concentrate on networking, resumes, networking, interviews and networking. In today’s world, a few months away from a subject is an eternity. By writing about current topics in your field you “stay in the game”

** It demonstrates comfort with and a mastery of current technology
It shows that you “get” current technology which is especially important for more senior job seekers. Blogs can help counter the perception older folks don’t understand the use of technology

** It shows a maturity and depth of experience
Blogs give you the opportunity to showcase your expertise and thinking in more detail than a resume. This can be especially useful for younger job seekers by countering the perception they lack “depth”

** It helps to answer the third question
Hiring manager basically have 3 questions: (1) Can this person do the job? (2) Will this person do the job? and (3) Will this person “fit” with our culture? A resume goes a long way toward answering the first 2 questions but provides no insight to the all important third question, a blog does.

** Its fun
Blogs offer the opportunity to discuss issues with others and what can be more fun than a good healthy debate?

Blogs are relatively inexpensive. You can get one going for about $50 to $150 per year depending on what you want to do. The hardest part is the commitment to make 3 to 5 postings of roughly 300 words each week. Fortunately this should only take a few hours and depending on the blog host you choose you can prepare your posts in advance and schedule them to post whenever you want. Writing well is tough, and the discipline of saying something meaningful in 500 words or less is even tougher. Blogging builds writing muscles.
It is too early for me to personally comment on results but I’m optimistic. However, Kent who has been at this much longer than I have reports “It can be a great source of interview questions. In my last three interviews, my blog came up (positively) in each, and generated questions that allowed me to expand on my approach to the world.” and “One of the interviewers had googled me, and then read my blog and my comments on others’ blogs. About half her questions were related to those links. Since I blog about areas that I believe are my strengths, it gave me a great chance to reinforce what makes me different.”

— End comment by Mike Schaffner

If you made it through all that (easily the longest comment I’ve ever had posted here) and like what Mike has to say, check out his blog. He talks a lot about communication, management and all sorts of other business and IT related topics.

blog, blogging, information technology, web, internet, career development

Plastic Pink FlamingoWhile still available from many retailers, the last plastic pink flamingo may have already been produced.

For almost 50 years, Leominster, Massachusetts based Union Products has been producing Don Fetherstone’s original design which has grown to iconic status on the lawn and in our hearts. Now the rising material and energy prices have caused Union Products to close its plant.

But this may not be the end for the beloved pink pair. Dennis Plante, president of Union Products is pursuing a new producer for the fine (simulated) feathered friend. For now we can just hope that he can find a producer who will do as nice a job as Union has.

To read more about the potential demise of the plastic pink flamingo check out these articles:

Boston Herald: Not a leg to stand on

Boing Boing: Pink Flamingos, RIP?

Sun Sentinel: RIP: Pink Flamingo, 1957-2006

pink flamingo, lawn ornament, tacky, kitsch

Earlier this week I was solicited for an interview with Bill Brenner, Senior News Writer for SearcSecurity.com on the topic of Oracle patches and their new Critical Patch Update bulletins.

Bill interviewed several DBAs and got some interesting opinions on Oracle’s patching procedures.

Jon Emmons, an Oracle database consultant and keeper of a blog called Life After Coffee, which focuses on Oracle security and other topics, said he also found the bulletin changes helpful.

“Perhaps the most valuable new feature in the CPU bulletin is the executive summaries,” Emmons said in an email interview. “These bulleted lists give a great high-level summary. At one point or another we’ve all had to explain to our boss why we need to apply these patches and now Oracle has given us the words to do it with.”

The full article, which came out yesterday, highlights mixed opinions on Oracle’s patching procedure and “improved” CPU bulletin.

oracle, patch, database, dba, database administration, rdbms, security, database security

Vitaly Friedman, a freelance web developer has compiled a list of the 25 best free fonts. Perhaps even more impressively, he continues to update it with license changes and new fonts as they change.

As far as I can tell the only oversight is that there is no monospace font (like courier) represented in the list, but still, this could be useful for some future projects.

fonts, free, freeware, publishing, web development, information technology

« Previous PageNext Page »