LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 10-21-2009, 09:43 PM   #1
j0hnsmith
LQ Newbie
 
Registered: Apr 2009
Posts: 23

Rep: Reputation: 0
bash - output blank line after each command


I use clear quite a lot as I find it hard to distinguish the start of the output from the last command from the previous command.

Is there any way to get bash to automatically output a blank line after the output of all commands (or a blank line before displaying the prompt)?


currently
Code:
$ ls
file1.txt file2.txt
$ ls
file1.txt file2.txt
what I want
Code:
$ ls
file1.txt file2.txt

$ ls
file1.txt file2.txt
 
Old 10-21-2009, 11:25 PM   #2
kbp
Senior Member
 
Registered: Aug 2009
Posts: 3,790

Rep: Reputation: 653Reputation: 653Reputation: 653Reputation: 653Reputation: 653Reputation: 653
Hi,

You can add '\n' (newline char) into your PS1 variable to insert a newline

eg.
Code:
PS1="\n\u@\h \W\\$ "
More info: 'man bash' then '/PROMPTING'

cheers

Last edited by kbp; 10-21-2009 at 11:29 PM.
 
Old 10-22-2009, 12:05 AM   #3
j0hnsmith
LQ Newbie
 
Registered: Apr 2009
Posts: 23

Original Poster
Rep: Reputation: 0
Thanks

For anyone else who finds this, in OS X Snow Leopard PS1 is in /etc/bashrc, however you shouldn't edit this file. Instead copy the PS1 line to .bash_profile in your home folder (create it if it doesn't exist) where you can edit it.

This file will then be used for new terminal windows after you restart.

Last edited by j0hnsmith; 10-22-2009 at 12:10 AM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
BASH: Grepping/sedding/etc out part of a file... (from one word to 'blank' line) elinenbe Programming 2 12-11-2008 01:17 PM
grab the line below a blank line and the line above the next blank line awk or perl? Pantomime Linux - General 7 06-26-2008 08:13 AM
what is the Linux command line character for a blank space? Peter Shepard Red Hat 3 06-21-2006 06:25 PM
Redirecting output to a command-line argument of another command madiyaan Linux - Newbie 1 02-19-2005 04:35 PM
Command to output file content line by line aznluvsmc Programming 2 09-12-2004 07:45 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 06:41 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration