How to set green screen in Ubuntu? [closed] - linux

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this question
The default console in Ubuntu are white characters and purple background. I want to change it to green characters and black background, just like the old computer screens. I want to set all stuff to be green, including all files listed by "ls".(In the original console, different files may be shown in different colors, I do not want that).
What is more, how to set green characters in pure character environment? (Suppose I do not install X to my OS.)
Thanks a lot for your help.

Just edit your terminal profile.
gnome-terminal: Edit -> Profiles -> Edit
konsole: Settings -> Configure Profiles

Bash shows color in ls output using an alias. You can unset that command alias.
run unalias ls from command line, and colors in list command will become monochrome.
Add this line to your .bashrc file or .bashprofile so that it is set across your login sessions.
Changing console colors is very basic, a quick google will give you all steps what you need. For example this link.

Related

How to change the username displayed within terminal window on Linux Mint? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 4 years ago.
Improve this question
I am trying to change my current username on Linux Mint that shows up when I open a terminal window.
Currently:
john#myLinux
I want to change to:
gary#myLinux
I have tried:
(1) Start -> Settings -> Account Detail and altered the 'name' field.
(2) The steps mentioned here: https://askubuntu.com/questions/34074/how-do-i-change-my-username
(3) Altering the passwd file: https://www.cyberciti.biz/faq/understanding-etcpasswd-file-format/
Option #3 seems to affect the username displaying in the terminal window but causes issues with logging in(my password becomes incorrect).
How can I successfully change the username that is displayed in my terminal window on Linux Mint OS?
This assumes you are using bash, and might not work for a different shell.
This will only change the terminal prompt text, it will not update your user account or change any other system files.
in a terminal type DEFAULT=$PS1
next type PS1='gary#\h\$ '
last of all, if you want to return to your default prompt type PS1=$DEFAULT
Note 1: Make sure to save these settings in your .bashrc file under the home directory to have changes persist across terminal sessions.
Note 2: In step 2, \h tells the bash prompt to print out the computer hostname, the \$ prints out show the (#) symbol if you're ROOT otherwise show the ($) symbol.
More information can be found here: https://www.howtogeek.com/307701/how-to-customize-and-colorize-your-bash-prompt/

How do I format my zsh prompt based on a condition? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 1 year ago.
Improve this question
I'm using the answer given here: How do zsh ansi colour codes work? to format and add color to my zsh prompt.
Is there any way to format the prompt based on some conditions?
For example, if the hostname has the word PROD in it, then I'd like my prompt to have a red background. Otherwise, I'd like no background, and bold green text.
Its easy to do now you can use the conditional substring
This is the syntax %(condition.ifTrue.ifFalse)
export PROMPT="%(%m==PROD.ifTrue.ifFalse)"
You can set a precmd function that resets your prompt just before it is displayed each time.
set_red_prompt_background () {
if [[ ${(%):-%M} = *PROD* ]]; then
PS1="%K{red}$PS1%k"
else
PS1="%F{green}%B$PS1%f%b"
fi
}
typeset -a precmd_functions
precmd_functions+=(set_red_prompt_background)
This isn't tested, so I'd be surprised if it works as is. But here's how it's intended to work.
${:-foo} is a special type of "parameter" expansion which just expands to the word following the :-. Seems useless at first...
${(%):-%M} is the same as above, but has the (%) flag to instruct zsh to process any prompt escapes found in the expansion. This turns into a fancy way of getting the full host name that would appear in the prompt using the %M escape.
Check if it matches the pattern *PROD*, i.e., does the host name contain PROD.
Take whatever the value of PS1 is, and wrap it in %K{red}...%k to make the background red. Note that this might override any background colors already set in PS1.
Add set_red_prompt_background to the list of functions executed prior to displaying the prompt. If you add any functions after this, they could potentially override the color you set here.
Edit .zprofile file in your root Directory, with conditions applied on the specific user logged into.

How to search word in linux terminal [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about programming within the scope defined in the help center.
Closed 9 years ago.
Improve this question
I have used terminal window for long time, There is a lot of stdout prints. Here I need command to search some word in history of linux terminal(stdout). like find option in text document.
To search through the commands you have executed run the following command
history |grep 'your search word goes in here'
In case you are using bash, you can also open the .bash_history file with any standard text editor and operate on it.
Well, i use screen for running the linux terminal.
There you can just do ctrl + a, followed by either / or ? and then the string to search in the stdout.
http://serverfault.com/questions/106388/screen-setup-tips
Check out the link to learn about screen, will make your life simpler!! :-)

OSX/Linux, slow down the output from terminal [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this question
I'm printing to screen a long text file that scrolls very very quickly on my screen, is there a way to slow down the scrolling? In other words is there a system setting that controls the speed at which output is displayed to screen (OSX/Linux).
Simple answer: No.
Extended version: There are other solutions. You could pick from one of the following:
Use pipes. Using pipes allows you to redirect terminal output and to review it in your own speed. The appropiate symbol is |. Redirect the output to programs like less ore more. Both allow you to scroll through the output via pressing return, you can exit any time by pressing q. For instance, for handling a long directory listing, you could use
ls | more
Redirect your output into a file. If your output is cached in a file, it's persistent and allows you to open it with an editor of your choice to view (and edit) it. The symbol is >.
touch log.txt # create the file
ls > log.txt
nano log.txt # use nano text editor to view
script allows you to record entire terminal sessoins. This might be an overkill for your use-case, but is really useful. From the man page:
script makes a typescript of everything printed on your terminal. It is
useful for students who need a hardcopy record of an interactive session
as proof of an assignment, as the typescript file can be printed out
later with lpr(1).
Use less to page through files; you can page back and forth, search, etc.
xterm has limited control over scrolling speed; most other terminal emulators have none, because that's the wrong way to step through a file when you can use a program like less to filter the output.

What are your LS_COLORS? [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 12 years ago.
Improve this question
After installing a full version of Cygwin, I open up the MinTTY shell and I like the green on black. However, when I do an 'ls', I get a dark blue for directories. It's not very readable. I found that the LS_COLORS environment variable controls the output of ls. Here is my current default:
no=00:fi=00:di=00;34:ln=00;36:pi=40;33:so=00;35:bd=40;33;01:cd=40;33;01:
or=01;05;37;41:mi=01;05;37;41:ex=00;32:*.cmd=00;32:*.exe=00;32:
*.com=00;32:*.btm=00;32:*.bat=00;32:*.sh=00;32:*.csh=00;32:*.tar=00;31:
*.tgz=00;31:*.arj=00;31:*.taz=00;31:*.lzh=00;31:*.zip=00;31:*.z=00;31:
*.Z=00;31:*.gz=00;31:*.bz2=00;31:*.bz=00;31:*.tz=00;31:*.rpm=00;31:
*.cpio=00;31:*.jpg=00;35:*.gif=00;35:*.bmp=00;35:*.xbm=00;35:*.xpm=00;35:
*.png=00;35:*.tif=00;35:
Changing from di=00;34 to di=00;94 makes ls much more readable. Has anyone found other useful tweaks?
For readability purposes, instead of changing the colors that LS_COLORS produces, it's smarter to change how your terminal interprets those colors by mapping "dark blue" to a more readable RGB value. If dark blue is unreadable for you in ls, it's going to be unreadable for you everywhere.
Generally, the main time you should change LS_COLORS is whenever you want ls to know about other extensions or to treat them separately.
I always just switch background to white and main text to black, for that very reason.
(I'm not a Cygwin user so I'm just referring to terminal sessions generally)
I never understood the preference for dark backgrounds..
hth

Resources