What are your LS_COLORS? [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 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

Related

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!! :-)

Using the linux filters program to change buffer text? [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 8 years ago.
Improve this question
I am trying to figure out how to perhaps issue a command in gvim on Debian stable to convert buffer text into say text filtered into jive, chef as used by the filters program. Have tried using :r and a few various other tips found but none seem to really work out well. I am probably missing something which upon revelation will be easy. Any suggestions?
It be as simple as
:[range]!jive
Fo' de current line, dig dis:
:.!jive
Fo' de visual selecshun:
:'<,'>!jive
Fo' de whole document, dig dis:
:%!jive
Wow, this filter is horrible! Quick: $ sudo port uninstall jive
The various filter commands are documented in section 4.1 of the vim documentation, "Filter commands", accesible via :h filter.

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.

How to set green screen in Ubuntu? [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
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.

Resources