Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Display Directory path on top Post 302798431 by Corona688 on Wednesday 24th of April 2013 12:02:04 PM
Old 04-24-2013
Nice idea. Long paths often mess up my prompt too.

Code:
export PS1='\[\033[01;32m\]$PWD\[\033[00m\]\n[${LOGNAME}@$(hostname)]> '

Play with the 01;32m to get the colors you want. 01 is bold, 30-37 are foreground colors, 40-47 are background colors, and you can stack them with ;. To get yellow-on-blue I did 01;44;33m

00 just means 'default', so the code before the newline just sets colors back to normal.
This User Gave Thanks to Corona688 For This Post:
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

How Can I Have Top Display The Top 20 Processes??

how can i do that in a script withough havin the script halt at the section where the top command is located. am writign a script that will send me the out put of unx commands if the load average of a machine goes beyond the recommended number. top -n 20 i want to save this output to a file... (1 Reply)
Discussion started by: TRUEST
1 Replies

2. Solaris

Top and Prstat display different results for memory

I have a question about the accuracy of prstat. I did a 'prstat -t' and it shows 99% of my memory is occupied by oracle. NPROC USERNAME SIZE RSS MEMORY TIME CPU 194 oracle 343G 340G 99% 86:17.24 56% However, 'top' shows I still have 7762meg of memory free. Memory: 16G real, 7762M... (4 Replies)
Discussion started by: zen03
4 Replies

3. Shell Programming and Scripting

Help needed removing two top level folders from path

Hi, I am trying to use either awk or sed to drop the first two folders in a path. So if I had path /folder1/folder2/folder3/folder4.... I need to drop folder1&2, so the new path would be /folder3/folder4... If folder1 and folder2 were the same all the time, this would be easy. But... (4 Replies)
Discussion started by: robertinohio
4 Replies

4. Shell Programming and Scripting

Shell script to display top 5 process (per cpu consumption)

Hello, I have to create shell script being myself real novice in scripting... I was looking on the Internet for some script examples, but I don't have the basic understanding of the shell. I was trying to do something with “ps” command without success. For exemple total number of... (2 Replies)
Discussion started by: mr_awd
2 Replies

5. Shell Programming and Scripting

Display top ten directories by size

Hi, I am new to Unix. I want to display top 10 folders by size. I tried with du -ksl * | sort -nr | head -10 command .But I am getting the following error -bash: /usr/bin/du: Argument list too long Can some one help me. Thanks. (5 Replies)
Discussion started by: Satyak
5 Replies

6. Shell Programming and Scripting

Retrieve directory path from full file path through sh

Hi, I have a file abcd.txt which has contents in the form of full path file names i.e. $home> vi abcd.txt /a/b/c/r1.txt /q/w/e/r2.txt /z/x/c/r3.txt Now I want to retrieve only the directory path name for each row i.e /a/b/c/ /q/w/e/ How to get the same through shell script?... (7 Replies)
Discussion started by: royzlife
7 Replies

7. Shell Programming and Scripting

Method to display a line at the top always, regardless of stdout

Hi Is there way to, say, echo a line and make sure it is always displayed on the first line, no matter what is coming out on stdout? eg: #!/bin/bash clear echo " ...... Internal audit script ......" tar xvf hugefile.tar I'd like to have the " Internal audit script " line to be shown... (2 Replies)
Discussion started by: bludhemn
2 Replies

8. UNIX for Beginners Questions & Answers

How to display only the first 5 running process using top in shell scripting?

topfunc() { top } topfunc Here i used the top command inside a function,and i called the function. when executing this bash file i get all the process which are using by the kernel i just want to display only the first 5 running process. is it possible? (7 Replies)
Discussion started by: Meeran Rizvi
7 Replies

9. UNIX for Beginners Questions & Answers

Convert Relative path to Absolute path, without changing directory to the file location.

Hello, I am creating a file with all the source folders included in my git branch, when i grep for the used source, i found source included as relative path instead of absolute path, how can convert relative path to absolute path without changing directory to that folder and using readlink -f ? ... (4 Replies)
Discussion started by: Sekhar419
4 Replies

10. UNIX for Beginners Questions & Answers

What is the difference ../directory path and ./directory path in ksh?

What is the difference ../directory path and ./directory path in ksh? (1 Reply)
Discussion started by: TestKing
1 Replies
CURSES_DEFAULT_COLORS(3)				   BSD Library Functions Manual 				  CURSES_DEFAULT_COLORS(3)

NAME
curses_default_colors, assume_default_colors, use_default_colors -- curses default colors setting routines LIBRARY
Curses Library (libcurses, -lcurses) SYNOPSIS
#include <curses.h> int assume_default_colors(short fore, short back); int use_default_colors(); DESCRIPTION
These functions tell the curses library to set the default colors or to use the terminal's default colors instead of using the default colors for curses applications (which are white foreground on black background). The function assume_default_colors(fore, back) sets the default colors to foreground color fore and background color back. If a value of -1 is used for a color, then the terminal default color is used for that color. The function use_default_colors() sets both the foreground and background colors to the terminal default colors. This is equivalent to assume_default_colors(-1, -1). RETURN VALUES
These functions return OK on success and ERR on failure. SEE ALSO
curses_color(3) STANDARDS
These functions are based on ncurses extensions to the curses standards. HISTORY
These functions first appeared in NetBSD 2.0. BSD
October 13, 2002 BSD
All times are GMT -4. The time now is 08:52 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy