redirecting make output to file
hi
i want to redirect make output to a file since make process generates output so quickly it is unable to view. i tried this make >> hi.txt but only the initial part of the make process details (include files) are redirected. i tried the pipelining of less9(ie. make | less) to see the make output in command prompt but even that does not work i am using fedora is there any way thanks |
make | tee hi.txt
Make pipes the output through tee. Tee displays output on screen and writes the file hi.txt at the same time. |
thanks bigrigdriver
using make | tee hi.txt gives the same result as make | less |
Probably some output is going to stdout and some to stderr. You can ask bash (the interactive shell you are probably using) to send stderr the same way as stdout, like this:
Code:
make > hi.txt 2>&1 |
hatts off matthewg42 it had worked
can u give me a short description stdout and stderr , if not just tell me where can i find them. |
Each process gets a few "default" file handles, named stdin, stdout and stderr. Each file handle has an integer associated with it. 0 is stdin, 1 is stdout and 2 is stderr.
When a program is connected to a terminal (e.g. you run it from an interactive shell), stdin will be connected to the keyboard and can be used to read input from the user. stdout and stderr are connected to the terminal's display, and any text printed to these file handles will appear in the terminal window. By convention, stdout is used for "normal" program output, and stderr is used to print warnings and errors. From a borne-style interactive shell (like bash), you can re-direct output on stdout and stderr using the following syntax: Code:
program 1> put_stdout_in_this_file Code:
program 1> put_stdout_in_this_file 2> put_stderr_in_this_file Code:
program 1> put_stdout_in_this_file 2>&1 By the way > is just an abbreviation of 1> because it is much more common to re-direct stdout. Incidentally, the | (pipe) feature commonly used on the command line works by connecting the stdout of the command on the left side of the symbol with the stdin of the command on the right. For example: Code:
ls | sort |
many thanks for u r time matthew .
i dont know which shell(interactive or non-interactive) i am using.i know that i am using bash shell. whenever i use the shutdown command to logout using command prompt and then login i found a different command prompt(it covers full screen, background is black ). normally when start my computer i get gui since i have gnome.the look of terminal here is different(it starts in a window ,background is white). but i need to get the terminal which i get using shutdown command from gnome. is there a way. |
Typically Linux distros are set up so there are some text-mode virtual terminals which run "outside of X". You can usually access them by pressing control-alt-f1 ... control-alt-f4. When in a text mode vt.
Once in a text mode vt, you can press alt-f1 ... alt-f4 to select which one you want - there are several running at once, and you can log into each of them separately. You can switch back to X using alt-f7 (if that doesn't work, try alt and each of the f-keys in turn from f5 to f12. f7 is typical). bash is typically the interactive shell which is used on most general purpose Linux distros. At the prompt you can do this command to find out: Code:
echo $SHELL A terminal used to a a piece of hardware attached to the computer on a serial port. This is still possible, but not so common these days. Mostly now special programs called terminal emulators, or virtual terminals do the same thing a physical terminal does, but in software. An interactive shell reads its input from the virtual terminal and writes it output to it. In this way, it appears that the shell runs "inside" the terminal. There are any alternatives for both virtual terminals and shells. Commonly used virtual terminals include: konsole (the KDE terminal), gnome-termainal, xterm, ETerm, aterm, rxvt. Commonly used shells include: bash, ksh, zsh, csh and tcsh. I hope I didn't confuse you! |
thanks matthew :)
i am not confused ,at least at making the distinction between a shell and a terminal . what i had understood is : a shell is a command intepreter. a terminal is a visual representation of a file system which works using command intepreter. Quote:
and when i switched to text-mode virtual terminal by using ctrl-alt-f7, i found that the first letter is not visible since it is out of the screen(this happens in every line ). Is there a way to move the texts displaying on the terminal to move one position right and then display such that i can see the full output of the terminal. |
i found a difference.when i executed a program (c++ program which uses qt libraries) in text-mode virtual terminal it gives a error message saying that
cannot connect to Xserver but the same thing gets executed in the command prompt which is started from the gnome . but the ls command and other commands(shell) work in both. whats happening i cant understand .:confused: |
Because qt depends on running under X-win environment.
Gnome runs under X-windows. Pure text mode is (more or less) the same as using a true console ie it's strictly text only. Incidentally, the stdin/out/err stuff applies to all Unix shells (afaik). Whether you access the shell via X-win or directly (console) makes no never mind as far as shell cmds eg ls are concerned. If you started your system up with a console only (init mode 3), you can then run X by typing startx so you can think of X as running on top of a console. init mode 5 means run X automatically. Here's a good ref: http://rute.2038bug.com/index.html.gz |
Quote:
Quote:
Quote:
If configured to support the feature, the text-mode virtual terminals have a modest scrollback buffer which can be accessed by pressing shift-pgup and shift-pgdn. |
thanks mattew
i think i did not explained my problem clearly. in the virtual terminal (ctrl-alt-f1) i get a screen such that the first letter is out of screen. i used shift-pgup and shift-pg down it works just like a scroller(vertical).i want a horizontal scroller(just to scroll one letter of space ) |
What application are yo using which produces too wide an output?
|
no application i am using.
example, user@localhost:~$ ls click Desktop d.gif Documents Download eclipse this is what i am getting in bash(which is invoked using gnome) ---------------------------------------------------------------- ser@localhost:~$ ls lick esktop .gif ocuments ownload clipse this is what i am getting in text-mode virtual terminal(using ctrl-alt-f1) the first letter in the second para is missing in everyline. |
All times are GMT -5. The time now is 06:46 PM. |