OpenSUSE :: Customizing A Bash Shell Prompt (PS1)?
Jul 28, 2010
I changed the default SUSE prompt setting by modifying the shell variable PS1 to display the following information:
u : the username of the current user
h : the hostname up to the first '.'
w : the current working directory, with $HOME abbreviated with a tilde
I used export command to setup a new shell prompt:
export PS1="[u@h: w]$ " To add colors to the shell prompt and make a regular user prompt blue I used the following command syntax:export PS1="e[0;34m[u@h: w]$ e[m "
[Code]...
View 3 Replies
ADVERTISEMENT
Oct 26, 2010
Currently the terminal prompt looks like this:[karlis@karlis-desktop current_folder]$How can I minimize the prompt, so that it only shows $ or # without extra info in square brackets?I checked the preferences for the default Gnome-Terminal and Terminator - there are no settings for this. It is pretty hard to use terminal when working in directories with long names.
View 1 Replies
View Related
Jan 13, 2010
I am getting more and more comfortable working with the shell, thus I would like to change its prompt color to my liking, as it will be easier for me to distinguish commands vs. outputs.
I've read a couple of instructions of how to change the .bashrc file and am familiar with what the codes in PS1 mean. Except, this file can be intimidating to newbie eyes.
Where exactly on the file is it that I need to make the change?
Here is what I am trying to do. I would like my prompt to like exactly like the prompt I use in Backtrack - which consist in two different colors, one for the host and another for the pwd. Here is what the Backtrack .bashrc file looks like:
# /etc/profile: This file contains system-wide defaults used by
# all Bourne (and related) shells.
# Set the values for some environment variables:
export MINICOM="-c on"
export MANPATH=/usr/local/man:/usr/man:/usr/X11R6/man:/usr/local/share/man:/usr/bin/man:/usr/share/man
export HOSTNAME="`cat /etc/HOSTNAME`"
[Code]....
I also read that in order to have the same results when I log in as root, I will have to copy the modified .bashrc file into /root
View 8 Replies
View Related
Jun 9, 2011
To flesh out my *nix capability, I create new identities and give them the functionality that I liked in previous ones. I've added the "open terminal here" script, which I find invaluable. Now I want to change the prompt. This is what the terminal does right now:
ITo run a command as administrator (user "root"), use "sudo <command>".
See "man sudo_root" for details.
elliot@dan:/media/KINGSTON$
- Where do I go to shorten the prompt dramatically? I can't really think of a situation where a shorter prompt isn't better or color matters.
- How do I adios the 2 sentences that want to appear every time I open this terminal? I'm aware what sudo does.
- Instead, I would like the equivalent of a pwd command. Where would I put that?
- How do I get the output of this terminal to be simultaneously saved in a file. I do so much copying and pasting out of these terminals that I'm looking for easier ways to do it.
View 2 Replies
View Related
Feb 2, 2011
I'm running Red Hat Linux 5.4 on HP DL580 server with 16 processors and 64 GB of RAM. I'm connecting to the server remotely through SSH. after entering the password, it takes time to return the command line, if I click ctrl+c during this time, I'll have the command line prompt but not the correct bash prompt (I have to run bash to pass to my correct prompt).I tried to install Apache on the server, ./configure took 4 hours to finish instead of 1 or two minutes, Oracle installation same behavior. Server Disks are mirrored using RAID controller.
View 6 Replies
View Related
Jan 6, 2009
Is there a way to customize bash autocomplete such that it avoids searching for commands? I want it to auto complete file and folder names only!
View 2 Replies
View Related
Mar 17, 2010
i've finally got a NIX environment...yipee! Installed opensuse 11.2 in a dual boot with windoze with no problem whatsoever. unfortunately, my NIX skills are sadly dated or maybe things have changed or both. in any case, i have a rather trivial problem that i have not been able to figure out.
i go to gnome terminal to get to the bash shell, no problem except when i do things like cat, less and so on. the commands do what they do then when done the last line output is "some text" and "(END)" - at the completion of the command it does not return to the bash shell. i've tried ctrl-everything, enter, escape, actually all keystrokes i can think of to get back to the bash shell...no luck. man and docs have not been helpful or i simply missed the answer (i'm a little saturated at this point).the only thing i've been able to do to solve my dilema is close the terminal an start a new instance, not elegant but works.
View 8 Replies
View Related
Feb 26, 2010
I want to show line numbers automatically in bash scripts (a habit of being a programmer) and when I load an emacs lisp file it works from the command below but the following command that sets up the same thing for bash scripts doesn't work. I played around with this for quite some time and couldn't find anything that would make work.This is the first time I have tried to customize emacs so it could easily be something ignorant on my part.
;; Load additional packages
(load-file "~/.elisp/whitespace.el")
(load-file "~/.elisp/setnu+.el")
[code]....
View 1 Replies
View Related
Mar 14, 2010
I want to change my default shell to tcsh. I used
Code:
usermod -s /bin/tcsh username
command as given at url
But if I open a new shell, it is still a bash shell.
How do I make my default shell as tcsh?
View 6 Replies
View Related
Jun 25, 2010
Is there some type of functional way to read things in the Python shell interpreter similar to less or more in the bash (and other) command line shells?
Example:
Code:
>>> import subprocess
>>> help(subprocess)
...
[pages of stuff to read]
...
I'm hoping so as I hate scrolling and love how less works with simple keystrokes for page-up/page-down/searching etc.
View 4 Replies
View Related
Oct 30, 2010
I have an assignment that I have to change the prompt of shell through C.
View 11 Replies
View Related
Mar 7, 2010
Because I have to stare at my command prompt all the time on my computer, it should look at least half-decent, so I am trying to get it colored. The expected outcome is as seen on this site. I have the colors I want set in my .Xdefaults file, but they of course do not color my prompt.
[Code]....
View 1 Replies
View Related
Apr 8, 2010
I just added a new user to my ubuntu by:
useradd -gdevelopers -d/home/peter -m peter
when peter logs in (after I created a passwd for him) he doesn't see the shell as I do:
me:
adhg@server:~$
peter
$
ALSO, he can't user the TAB to move inside a folder (when you type cs /home/p and use tab to get /home/peter)
View 2 Replies
View Related
Nov 3, 2010
After I succesfully instaled ubuntu 10.04 server, I applied
export PC1="[e[36;1m]u@[e[31;1m]h:w$ [e[32m"
and my prompt was nice and colorfull. But, when I make logout and login, my prompt appears all green ([e[32m.) After restart, nevertheless, it looses color settings (of course) and appears plain white.
What should I do in order to keep my prompt color settings permanently?
View 4 Replies
View Related
Jul 8, 2010
I have looked almost everywhere for how to change my default shell prompt. When I open my bash shell, the prompt is [fedora-dev@Fedora-Dev Documents]$. I would like it to open at fedora-dev@Fedora-Dev]$.
Can someone tell me where to change this at. I have looked in .bashrc, etc/profile, and environmental variables.
View 6 Replies
View Related
Oct 20, 2010
I need to create a shell script called 'custinfo' to prompt a customer to enter and display back the following: name, age, address, phone number, and product.
Below is what i have so far.
View 7 Replies
View Related
Jun 14, 2011
I would like to run some existing scripts and send it to a text file:
Note: 'script' is an exist shell script
Note: '/opt/2011jun15/my.db' auto generates everyday with only changes to the directory 2011jun15 base on the current date
currently i will need to run the script manually and make changes to the path below, change directory name 2011jun15 daily and text file new2011jun15.txt ./script -f /opt/2011jun15/my.db > new2011jun15.txt
Am i able to write a shell script to prompt me for a change of path for only '2011jun15' and 'new2011jun15.txt'?
It will be great if i can automate the whole process?
View 11 Replies
View Related
Aug 8, 2011
Whenever I go inside a directory in Linux, it shows the file path at prompt like:
root@vivek-HP-Pavilion-dv6-Notebook-PC:/var/www/abc/def/
How can I change it to show short names instead?
View 1 Replies
View Related
Jan 28, 2011
I have no user name or password and cannot log in. In recovery mode, I after I enter "drop to root shell prompt" my keyboard does not respond when I try to "give root password for maintenance" or try to enter "Control-D" at the blinking cursor.
View 3 Replies
View Related
May 31, 2010
I have a problem when tried to upgrade my fedora 12 to fedora 13...
I run this command :
su -
yum update rpm ---- running success
yum -y update --- running success
After this, my laptop hang so i force to shutdown by pressed power button ! Next problem which is after i boot my laptop, it always shows me, GRUB prompt shell, GRUB > (commands GRUB) !
Code:
GNU GRUB version 0.97 (640K lower / 3072K upper memory)
[ Minimal BASH-like line editing is supported. For the first word, TAB
lists possible command completions. Anywhere else TAB lists the possible
completions of a device/filename. ]
grub>
I already run this command :
Code:
grub> find /grub/grub.conf
(hd0,5)
grub> root (hd0,5)
Filesystem type is ext2fs, partition type 0x83
grub> setup (hd0)
Checking if "/boot/grub/stage1" exists... no
Checking if "/grub/stage1" exists... yes
Checking if "/grub/stage2" exists... yes
Checking if "/grub/e2fs_stage1_5" exists... yes
Running "embed /grub/e2fs_stage1_5 (hd0)"... 30 sectors are embedded.
succeeded
Running "install /grub/stage1 (hd0) (hd0)1+30 p (hd0,5)/grub/stage2 /grub/menu
.lst"... succeeded
Done.
But when I reboot, it always shown me GRUB prompt shell.
View 7 Replies
View Related
Aug 19, 2010
I've run into something odd:
Code:
jdougher jdougher> cd
jdougher jdougher> echo $PS1
u W>
jdougher jdougher>
For some reason, rather than replacing $HOME with "~", my prompt just displays the name of my home directory.
View 2 Replies
View Related
Mar 24, 2010
I was attempting to change the bash shell color prompt on my RHEL / CentOS 5 server. When I login as my user account on my server I can see my 'PS1':
Code:
[carlos@srv1 ~]$ echo $PS1
[u@h W]$
I want to change my PS1 to:
PS1='[e[1;32m][u@h W]$[e[0m] '
When I look in ~/.bashrc, I don't see my 'PS1' line so I am confused and wondering how I do this on RHEL / CentOS systems.
View 2 Replies
View Related
May 29, 2011
I'm trying to change the Xfce Terminal Emulator prompt from bash-4.1$ to something like what kconsole has. If i issue a /bin/bash -l in the terminal, then I get the prompt and the colors that I want, but I'd like this to automagically happen when I click the Terminal icon in the Xfce panel.This is for Slackware 13.37 (32bit) and Terminal 0.4.6
View 2 Replies
View Related
Feb 19, 2010
I'm playing around with my prompt, and for some reason under certain conditions part of the prompt is output twice.
- When my terminal window isn't maximized it always outputs the prompt correctly.
- When the window is maximized it outputs the prompt correctly when I enter an empty command (ie, when I just hit enter).
- When it is maximized and I enter any command, it outputs the second line of my prompt twice.
I'm using urxvt.. I tested in xterm and it seems to work correctly, so I guess it's an issue with urxvt. My prompt code:
Code:
#!/bin/bash
function redblue {
local BLUE="[33[0;34m]"
local RED="[33[0;31m]"
local LIGHT_RED="[33[1;31m]"
[code]....
View 3 Replies
View Related
May 30, 2011
I'm currently on a Linux machine and the shell prompt is showing me the last return value and number of executed commands (picture included, with these numbers shown in purple).
My own computer doesn't have this, how can I configure it? I'm using Xubunto, if more details are needed let me know -- I'm not much of a Linux user (I don't know what's relevant here).
View 3 Replies
View Related
May 6, 2010
I would like to change the formatting on my BASH prompt from this:
anon@machinename.domain.poo:~/some/very/annoying/long/path$
to something like this:
anon@machinename.domain.poo:~/some/very/annoying/long/path
$
The idea is that I would be able to type a reasonably long command on one line without it wrapping to the next line so quickly.
View 2 Replies
View Related
Feb 2, 2011
I have one account on an Ubuntu server with the correct PS1 variable and I want to make one of my other accounts on the same server have the same PS1 variable, so that my prompt on this new account (when I ssh into the machine) is the same as the original account.
Is there a way that I can pass this PS1 variable between accounts so the prompt is the same?
I have tried printing it out, copying the output, and then reassigning it to PS1 on the new account, but it just doesn't work.
Here is what is printed when I type echo $PS1:
[e]0;u@h: wa]${debian_chroot:+($debian_chroot)}[�33[01;32m]u@h[�33[00m]:[�33[01;34m]w[�33[00m]$
I want to assign that prompt (shown above) to my new account.
View 2 Replies
View Related
Apr 17, 2011
After writing a new prompt for Bash, I noticed that one character of my commands were being lost when it wrapped to the new line. Here is an image of the example (I typed 1234567890 over and over):
Here is my $PS1
PS1="
[[e[0;90m]d [e[0m]] [[e[0;90m]$(/bin/ls -1 | /usr/bin/wc -l | /bin/sed 's: ::g') files, $(/usr/bin/du -sh | cut -f1)[e[0m]
[[e[0;36m]#[e[0m]] [e[0;95m]u[e[0;90m]@[e[1;92m]h[e[0m]: [e[1;34m]w [e[1;30m]$[e[0m] "
What have I done wrong?
View 1 Replies
View Related
Jan 25, 2011
I'm trying to change the bash prompt and based on the man pages $ should show a $ which changes to a # for a SU. However, this doesn't happen on my machine, it's $ for both user and SU.The line in .bashrc is:export PS1="u@h:w$"
View 7 Replies
View Related
Feb 28, 2011
Everytime I log into the linux server at my workplace (I use putty), I don't get the bash prompt right away. I need to execute the command 'bash' to get it. Anyway to make this automatic? e.g.
Code:
host:1>
host:1> bash
user@host:~$
View 17 Replies
View Related