How to search word in linux terminal [closed] - linux

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

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/

:wq! results in E212: Can't open file for writing Press ENTER or type command to continue [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 5 years ago.
Improve this question
I am just trying to exit my vim file with :wq! but it gives me the error:
E212: Can't open file for writing
Press ENTER or type command to continue
I press enter or type anything and it goes back to editing the file. Is there something wrong?
I am now stuck in my text editor.
You can get more details about the error via :help E212:
For some reason the file you are writing to cannot be created or overwritten.
The reason could be that you do not have permission to write in the directory
or the file name is not valid.
If you don't need the changes any longer, just :q! and be done with it. For multiple Vim arguments, there's also :qall!.
If you do want to keep the changes, one approach is to investigate the permissions issue, e.g. in another terminal or via the file explorer, and fix the issue (e.g. via chmod / chown).
Alternatively, you can persist the changes elsewhere via :w /tmp/changes, then :quit Vim, and then resolve the problem outside of Vim.
To address the "I'm stuck in Vim" (assuming it's not possible / tedious to start another session on the system): :suspend puts Vim in the background, and drops you into the original shell you started Vim from. :shell starts a new shell from inside Vim, to which you return via exit.

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