Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Need to revert default prompt in Linux after setting PS1 command Post 302884039 by vbe on Friday 17th of January 2014 08:03:20 AM
Old 01-17-2014
You should have a .bash_profile or .bashrc file in your home directory...
execute it e.g. with .bash_profile:
Code:
. ./.bash_profile

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

PS1 with date stamp included in prompt

How would I put the date within my PS1 command for my shell prompt? I have it set to: PS1='$>' I tried PS1='$>' but that didn't work. (7 Replies)
Discussion started by: kymberm
7 Replies

2. UNIX for Dummies Questions & Answers

colors in Prompt - $PS1

would someone please explain in detail, how does the code below change the color or bash prompt $ echo $PS1 :\033 are there other tricks like above? (3 Replies)
Discussion started by: rakeshou
3 Replies

3. UNIX for Dummies Questions & Answers

PS1 prompt

please advise what's wrong with this command ? PS1="`hostname`:`who am i | cut -d " " -f1`:>>" trying to make the PS1 prompt look like : machine_name:username:>> thank you (4 Replies)
Discussion started by: venhart
4 Replies

4. Shell Programming and Scripting

Help setting PS1 prompt to include current time

Hi, I'm using the ksh shell and I'd like to set my PS1 prompt on an AIX system to include, amongst ther things, the current time. This was my best effort: export PS1=$(date -u +%R)'${ME}:${PWD}# ' but this only sets the time to the value when PS1 is defined and the time value doesn't... (4 Replies)
Discussion started by: m223464
4 Replies

5. Shell Programming and Scripting

How to get a Prompt (PS1) Timestamp under /sbin/sh?

Hi, I'm trying to find out if there is a way to get a timestamp on my Solaris root shell prompt using /sbin/sh? I'm trying to archive something in line with the following: 12:34:26 root@server # 12:34:28 root@server # 12:34:28 root@server # ls ... 12:34:30 root@server # I know there... (1 Reply)
Discussion started by: Solarius
1 Replies

6. UNIX for Dummies Questions & Answers

Setting PS1

I have set PSI for my prompt using the following command: PS1="${debian_chroot:+($debian_chroot)}\\u@\h:\\\w\a]\ "which produces chrisd@pguk:~]I want to include [ in the beginning but cannot understand the way to do this. Also I want to show only the current directory, not the whole... (4 Replies)
Discussion started by: kristinu
4 Replies

7. UNIX for Dummies Questions & Answers

[Solved] Help needed to have changing value to the command prompt string variable PS1

Hi, I am using git bash terminal window to do git operations. I have set the prompt string variable PS1 in the ~/.bashrc file as follows: export PS1=" " This is intended to show me the current git branch's name which is active as part of the prompt string. But, the problem is when I do a git... (2 Replies)
Discussion started by: royalibrahim
2 Replies

8. Shell Programming and Scripting

Change / Setup bash custom prompt (PS1)

I am trying to create my custom prompt and I have almost succeeded. Right now I have PS1='\n\\$\ ' What I have not figured out is how to make the directories bold when I'm using commands ls or ls -la. Any idea how to do it??? Many thanx. (2 Replies)
Discussion started by: emailkia
2 Replies

9. UNIX for Dummies Questions & Answers

Why is my PS1 breaking my prompt?

So, this is strange... I created this prompt: PS1='\n\e You can see that it's a pretty minor modification of the default Debian prompt. And, if it matters, I'm using Putty to SSH to my server. The following strange symptoms appear when I use that prompt, and disappear when I change and... (2 Replies)
Discussion started by: treesloth
2 Replies

10. Solaris

Help changing the PS1 prompt in Solaris

Hi, I need help changing PS1 in Solaris. I tried this: MYPROMPT="> " PS1=$LOGNAME@$HOSTNAME:${PWD}$MYPROMPT (NOT SURE WHY IT'S HIGHLIGHTED HERE) export PS1 My problem is that $PWD is not working, when I get the prompt and I change directories, the prompt is not displaying the current... (17 Replies)
Discussion started by: curiousmal
17 Replies
LESSOPEN(1)						      General Commands Manual						       LESSOPEN(1)

NAME
lessfile, lesspipe - "input preprocessor" for less. SYNOPSIS
lessfile, lesspipe DESCRIPTION
This manual page documents briefly the lessfile, and lesspipe commands. This manual page was written for the Debian GNU/Linux distribution because the input preprocessor scripts are provided by Debian GNU/Linux and are not part of the original program. lessfile and lesspipe are programs that can be used to modify the way the contents of a file are displayed in less. What this means is that less can automatically open up tar files, uncompress gzipped files, and even display something reasonable for graphics files. lesspipe will toss the contents/info on STDOUT and less will read them as they come across. This means that you do not have to wait for the decoding to finish before less shows you the file. This also means that you will get a 'byte N' instead of an N% as your file posi- tion. You can seek to the end and back to get the N% but that means you have to wait for the pipe to finish. lessfile will toss the contents/info on a file which less will then read. After you are done, lessfile will then delete the file. This means that the process has to finish before you see it, but you get nice percentages (N%) up front. USAGE
Just put one of the following two commands in your login script (e.g. ~/.bash_profile): eval "$(lessfile)" or eval "$(lesspipe)" FILE TYPE RECOGNITION
File types are recognized by their extensions. This is a list of currently supported extensions (grouped by the programs that handle them): *.a *.arj *.tar.bz2 *.bz *.bz2 *.deb, *.udeb, *.ddeb *.doc *.gif, *.jpeg, *.jpg, *.pcd, *.png, *.tga, *.tiff, *.tif *.iso, *.raw, *.bin *.lha, *.lzh *.tar.lz, *.tlz *.lz *.7z *.pdf *.rar, *.r[0-9][0-9] *.rpm *.tar.gz, *.tgz, *.tar.z, *.tar.dz *.gz, *.z, *.dz *.tar *.tar.xz, *.xz *.jar, *.war, *.xpi, *.zip *.zoo USER DEFINED FILTERS
It is possible to extend and overwrite the default lesspipe and lessfile input processor if you have specialized requirements. Create an executable program with the name .lessfilter and put it into your home directory. This can be a shell script or a binary program. It is important that this program returns the correct exit code: return 0 if your filter handles the input, return 1 if the standard lesspipe/lessfile filter should handle the input. Here is an example script: #!/bin/sh case "$1" in *.extension) extension-handler "$1" ;; *) # We don't handle this format. exit 1 esac # No further processing by lesspipe necessary exit 0 FILES
~/.lessfilter Executable file that can do user defined processing. See section USER DEFINED FILTERS for more information. BUGS
When trying to open compressed 0 byte files, less displays the actual binary file contents. This is not a bug. less is designed to do that (see manual page less(1), section INPUT PREPROCESSOR). This is the answer of Mark Nudelman <markn@greenwoodsoftware.com>: "I recognized when I designed it that a lesspipe filter cannot output an empty file and have less display nothing in that case; it's a side effect of using the "no output" case to mean "the filter has nothing to do". It could have been designed to have some other mechanism to indicate "nothing to do", but "no output" seemed the simplest and most intuitive for lesspipe writers." Sometimes, less does not display the contents file you want to view but output that is produced by your login scripts (~/.bashrc or ~/.bash_profile). This happens because less uses your current shell to run the lesspipe filter. Bash first looks for the variable $BASH_ENV in the environment expands its value and uses the expanded value as the name of a file to read and execute. If this file produces any out- put less will display this. A way to solve this problem is to put the following lines on the top of your login script that produces output: if [ -z "$PS1" ]; then exit fi This tests whether the prompt variable $PS1 is set and if it isn't (which is the case for non-interactive shells) it will exit the script. SEE ALSO
less(1) AUTHOR
This manual page was written by Thomas Schoepf <schoepf@debian.org>, for the Debian GNU/Linux system (but may be used by others). Most of the text was copied from a description written by Darren Stalder <torin@daft.com>. LESSOPEN(1)
All times are GMT -4. The time now is 12:21 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy