Sponsored Content
Top Forums UNIX for Advanced & Expert Users Tip: show the last 3 directories in the shell prompt Post 302996436 by MadeInGermany on Wednesday 26th of April 2017 07:55:42 AM
Old 04-26-2017
Lightbulb Tip: show the last 3 directories in the shell prompt

tcsh: have the following in .cshrc (or .tcshrc)
Code:
set prompt="[%C3]: "

zsh: have the following in .zshrc
Code:
PS1="[%3C]%# "

bash: have the following in .bashrc
Code:
PS1='[${PWD#${PWD%/*/*/*}/}]\$ '

Lacking direct support this is a good approximation.
These 2 Users Gave Thanks to MadeInGermany For This Post:
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

No shell prompt?

When I login to a specific machine (running Solaris 2.8; actually serveral machines behave this way), with a known good account, I don't get any shell prompt, and no screen responses to various commands such as ID and PWD. Any ideas on what is causing this, and how to change this behavior? (2 Replies)
Discussion started by: Mufasa
2 Replies

2. UNIX for Advanced & Expert Users

User friendly Unix ksh prompt to type directories/files

Hello, I wanted to setup user friendly ksh command prompt, by typing first character of files or directories and then tab bring up whole word. No need to type whole file/directory/command names. Example: cat a file like university just typing un and then tab bring up whole university wod.... (3 Replies)
Discussion started by: abdurrouf
3 Replies

3. Web Development

403 Forbidden / show directories

I have a directory that I want to just list the items when going to the URL instead of having an index.html page in the folder. I keep getting a 403 forbidden even though it is in my document root. I tried to add: Alias /keys/ "/var/www/html/keys/" <Directory "/var/www/html/keys"> ... (6 Replies)
Discussion started by: ippy98
6 Replies

4. UNIX for Dummies Questions & Answers

How can I show my "current" directory as the KSH prompt?

Hi All, This is an embarrassingly simple question and couldn't think of "keywords" to search for the answer, but how do I change my UNIX/KSH prompt to show the machine name and my "current" but not "full" directory? For example: if the machine name is "machine" and I'm currently in... (4 Replies)
Discussion started by: chatguy
4 Replies

5. UNIX for Dummies Questions & Answers

Shell Scripts - Show all directories with full information ( and no files)

Hello all, i'm stumped.... I need to list all directories with all there info and exclude the files, then vice versa. I am not sure if I need to string several ls commands together or how to even do that. I believe I need to do some variation of ls -l but need to figure out how to take out the... (5 Replies)
Discussion started by: citizencro
5 Replies

6. UNIX for Dummies Questions & Answers

show all text files in directories and subdirectories

Hi! I am trying to find all text files in my home directory that contain the string "C-d" so I tyied this : cd ~ find . -type f -exec grep -l "C-d" {} + but it took very long so I tryed this : ls -aR | xargs file |grep text but it didn't descend in the directories and it said :... (3 Replies)
Discussion started by: kelamahim
3 Replies

7. Web Development

Php localhost/ directories show ?? ICONS

I have been troubleshooting a couple of problems all day that have to do with this all day. I do not know if you need to know the code I used in php but if you do I will post it. I hope that you can see the .pngs. Thanks ahead of time. Using phpMyAdmin and creating files.... somehow... (2 Replies)
Discussion started by: iHaveAQuestion
2 Replies

8. Shell Programming and Scripting

[Solved] Shell : Can someone show me how to used these ?

${var%pattern} removes the shortest suffix of $var patching pattern ${var%%pattern} removes the longest suffix of $var patching pattern ${var#pattern} removes the shortest prefix of $var patching pattern ${var##pattern} removes the longest prefix of $var patching pattern (2 Replies)
Discussion started by: popeye
2 Replies

9. UNIX for Advanced & Expert Users

Tip: how to get the deepest directories

A couple of times there was the question: in a directory hierarchy how to display the deepest directories only. For example in Help with listing only subfolders. My hot solution at that time was (in short) find . -depth -type d | awk -F / 'NF>=p; {p=NF}' But another article has opened my eyes... (6 Replies)
Discussion started by: MadeInGermany
6 Replies

10. UNIX for Beginners Questions & Answers

[Tip] Housekeeping Tasks Made Easy - User Home directories and Leftover Files

We have regularly questions about how to create users and user accounts. But regularly user accounts need to be deleted too. It is quite easy to delete the user account itself but usually the HOME directory of the user remains. It is good style to remove these directories but simply deleting... (3 Replies)
Discussion started by: bakunin
3 Replies
STDLIB(7)						   Erlang Application Definition						 STDLIB(7)

NAME
STDLIB - The STDLIB Application DESCRIPTION
The STDLIB is mandatory in the sense that the minimal system based on Erlang/OTP consists of Kernel and STDLIB. The STDLIB application con- tains no services. CONFIGURATION
The following configuration parameters are defined for the STDLIB application. See app(5) for more information about configuration parame- ters. shell_esc = icl | abort : This parameter can be used to alter the behaviour of the Erlang shell when ^G is pressed. restricted_shell = module() : This parameter can be used to run the Erlang shell in restricted mode. shell_catch_exception = bool() : This parameter can be used to set the exception handling of the Erlang shell's evaluator process. shell_history_length = integer() >= 0 : This parameter can be used to determine how many commands are saved by the Erlang shell. shell_prompt_func = {Mod, Func} | default : where * Mod = atom() * Func = atom() This parameter can be used to set a customized Erlang shell prompt function. shell_saved_results = integer() >= 0 : This parameter can be used to determine how many results are saved by the Erlang shell. SEE ALSO
app(5) , application(3erl) , shell(3erl) , Ericsson AB stdlib 1.17.3 STDLIB(7)
All times are GMT -4. The time now is 09:55 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy