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 7 years ago.
Improve this question
I'm running a script on terminal and it is supposed to produce a long output, but for some reason the terminal is just showing me the end of the result and I cannot scroll up to see the complete result. Is there a way to save all the terminal instructions and results until I type clear.
The script I'm using has a loop so I need to add the output of the loop if Ill be redirecting the output to a file.
Depending on your system, the size of the terminal buffer may be fixed and hence you may not be able to scroll far enough to see the full output.
A good alternative would be to output your program/script to a text file using:
user#terminal # ./nameofprogram > text_file.txt
Otherwise you will have to find a way to increase the number of lines. In some terminal applications you can go to edit>profiles>edit>scrolling tab and adjust your settings.
You can either redirect the output of your script in a file:
script > file
(Be careful to choose a file that does not exist otherwise the content will be erased)
Or you can buffer the output with less:
script | less
Related
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
Is there any way/too in window7 to see the total size of files of particular type ? For example if I have directory which has 5 files. 2 files are Jpg, 1 is log file and 2 are docx file. In such case, it should report something like below
jpg - 2 files- Total size -10 MB
log file - 1 file- Total size -5KM
document file - 2 file - Total -45 MB
-Rajesh
Is there a way to do this in linux (e.g. some form of ls or grep)? If there is, it is probably supported by cygwin.
In other words, you could install cygwin and then run something like the 'find' command shown here: https://askubuntu.com/questions/558979/how-to-display-disk-usage-by-file-type.
Also, if you put the cygwin executable directory in your PATH environment you can run all of the cywin commands from a windows command prompt.
And if you just want a good way to see where all of your disk space is being used there are a number of good tools for that. I personally like spacesniffer.
You can start a command window and use dir.
ex:
dir *.txt
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 6 years ago.
Improve this question
Is there any way to filter out absolutely useless messages in bash session by default?
For example, I would like to never see this absolutely useless message: Binary file ... matches while running grep .... It's extremely hard to type something like grep ... 2>/dev/null each time, especially considering how often I need to run this command. Besides it will filter out useful messages as well and this is unwanted.
What I would like to see, is some sort of file in /etc where I could put a bunch of regular expressions of the useless messages line by line. This filter must apply to tty only, i.e. redirected output must stay untouched!
There are some ways to play with your stderr, but there are a number of issues that make that undesirable. For example:
exec 2>/tmp/errorfile
will put all the STDERR output in the errorfile. You could start a
tail -f /tmp/errorfile | grep -v 'Binary file' &
in your .bashrc to get the other messages as well. You will see some funny side effects; for example I found that the prompt is written on STDERR.
You will probably have to create a more elaborate command than the tail|grep to filter-out the undesirable messages and do something about your prompt as well. And you might need to clean-up your errorfile as well.
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 8 years ago.
Improve this question
I'm using SSH Shell to work with a Unix system and I have a really long query in the command that I would like to edit.
However the part I need to edit is way at the beginning and the only way for me to get there is to hold down the left arrow button for about a minute (each time I need to make a new edit).
Is there a faster way to navigate?
If you are using a ahell with emacs mode command line editing commands you can use the following movement commands (Here a complete reference):
Ctrl-a Move to the start of the line.
Ctrl-e Move to the end of the line.
Alt-f Move forward a word, where a word is composed of letters and digits.
Alt-b Move backward a word.
You may be a bit faster with these.
To get emacs mode with the different shells:
bash: you have to do nothing
ksh: invoke with ksh -o emacs
tcsh: call bindkey -e
Edit: to find out the shell currently in use:
ps -p $$
Example output:
PID TTY TIME CMD
3701 pts/1 00:00:00 ksh
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 8 years ago.
Improve this question
I set my prompt to have colors: PS1='\e[3;32m[\u#\h:\W]$ \e[m'
However, now very long commands no longer automatically cause a new line to appear. Instead, commands that go longer than one line will start appearing at the left side of the current line, overwriting the current characters.
Non-printing characters in the prompt need to be enclosed in \[...\] so that bash can accurately compute the visible length of the prompt.
PS1='\[\e[3;32m\][\u#\h:\W]$ \[\e[m\]'
^^ ^^ ^^ ^^
bash itself doesn't know that those bytes will not be displayed by the terminal; it is your terminal that, instead of displaying the 7-byte sequence \e[3;32m, simply changes the color used to display the following characters. \u, on the other hand, is replaced by the users name by bash itself, so you don't have to do anything special to tell bash how to properly handle it.
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 am using the terminal program called screen, which can create several "virtual terminals" in a single "real" terminal (the words "virtual" and "real" here are quite relative, the "real" terminal can be a konsole tab as well, not necessarily tty1-tty6). The problem is that I cannot create more than 40 windows inside a single screen. When I try to create more, screen says "No more windows." After some googling I found that that this is controlled by something called MAXWIN, but I didn't find any information how to modify this MAXWIN. How can I increase the maximal number of windows inside a single screen?
I use Debian 6 "squeeze".
PS I understand that I can run several screen's in several "real" (in the above sense) terminals, but this makes it harder to use multiple display mode (screen -x).
That's a compile time option. Using strictly packages from upstream, it can't be done. If you wanted to compile screen yourself, you could accomplish this. Look in the config.h.in file. Near the top will be # define MAXWIN 40. Change that to your new limit.
(more info)