Tag Info

Hot answers tagged

18

The output of the clear command is console escape codes. The exact codes required depend on the exact terminal you are using, however most use ANSI control sequences. Here is a good link explaining the various codes - http://www.termsys.demon.co.uk/vtansi.htm. The relevant snippets are: Cursor Home <ESC>[{ROW};{COLUMN}H Sets the cursor ...


14

It works by issuing certain ANSI escape sequences. Specifically, these two: Esc[Line;ColumnH          Cursor Position: Esc[Line;Columnf            Moves the cursor to the specified position (coordinates). If you do not ...


8

The output sent by clear(1) depends on your terminal type, defined by $TERM in the shell environment. It does the same thing as the command "tput clear", which is looking up the escape code for the current terminal type and sending that string to standard output. The terminal receiving the escape code from clear/tput interprets it and executes the command ...


4

In addition to all nice answer above, we can do some strace to see what happen: $ strace -e trace=write echo -e "\x1b\x5b\x48\x1b\x5b\x32\x4a\c" write(1, "\33[H\33[2J", 7 $ strace -e trace=write clear write(1, "\33[H\33[2J", 7 You can see, two command provide the same ANSI escape sequences.


3

Some programs set the window title and forget to reset it before terminiation. You can add something like the following lines to your '~/.bashrc' to set the window title before each new bash prompt. The case statement makes this happen only on terminals known to be capable of changing the window title with an ESCape command. I suggest to add 'screen*' ...


3

For tmux you can alter its scrollback buffer with set-option history-limit 10000 The default is 2000. You can put this directive in your ~/.tmux.conf or at the tmux command prompt (prefix + :). It looks like iTerm is integrated with tmux. See: https://code.google.com/p/iterm2/wiki/TmuxIntegration


2

gnome-session-properties can be used to configure startup applications. Also, if you want an application to run at system boot, you can add a rule like the following to your crontab (edit crontab with crontab -e): @reboot /run/this/program/at/boot >/dev/null 2>&1


2

One approach is to use a terminal multiplexer only on remote machines. Running each shell in a separate terminal emulator has the advantage that you can put multiple shell windows side by side. On a remote machine, resistance to disconnection is a big win that justifies terminal multiplexers, but locally, they have fewer advantages. If you do want to nest ...


1

I'm surprised other answers have not mentioned TERMINFO (or TERMCAP) Use the man pages Luke man clear says ... NAME clear - clear the terminal screen SYNOPSIS clear DESCRIPTION clear clears your screen if this is possible. It looks in the environ- ment for the terminal type and then in the terminfo database to figure ...


1

Some commands are built-in; they don't exist on disk, but are executed directly by the shell. These will be documented in the shell's man page or other documentation. Other commands might exist anywhere on disk, but typically will be stored in a directory which appears on the search path. This is represented by the PATH environment variable, whose value is ...


1

But I have another question. This command create /home directory but It is empty. Is some command to initialize /home for new user? The solution to the second question will also solve the first one. Your new user doesn't have all the default configuration files in it's home directory and therefore the new shell doesn't show a fancy prompt, etc... The ...


1

Creating a "custom application" would be re-implementing telnet / ssh. This is, of course, possible, but not necessary. If there is sshd (or telnetd) on the host you can start it from your netcat-shell session with e.g. /usr/sbin/sshd -p <port> -D 2>&1 and then do ssh -p <port> root@<host> on your client. You might need to add ...


1

[Edit] From the GNU make man page: If no -f option is present, make will look for the makefiles GNUmakefile, makefile, and Makefile, in that order. Passing arguments are only possible if you have a variable for example CFLAGS defined in your Makefile: CC=gcc CFLAGS=-g -O -Wall -Werror all: foo foo: foo.o $(CC) $(CFLAGS) $< Here you are ...


1

Generally when you type make test if you're missing a Makefile the make tool will attempt to use a vanilla compile command. Example Say we have the following test.c: $ cat test.c #include <stdio.h> int main() { printf( "I am alive! Beware.\n" ); return 0; } Without a Makefile when we run make test we'd get the following behavior: $ make ...


1

If echoing or yesing input to an interactive program isn't enough to fool it, this is usually because it tries to be clever and checks whether its input is really a terminal or a pipe. For that, you need a larger hammer; the one that people usually wield is expect, which was written to circumvent this problem.



Only top voted, non community-wiki answers of a minimum length are eligible