Tag Info

New answers tagged

3

The FORMATS section of man tmux has a complete list of the values that you can use in your status line. As well as these, you can pipe the output of shell commands, making it possible to include any information that is accessible from your shell in the status line. Your hostname, for example, can be printed with #H, or #h for the short name (without the ...


1

To set hostname to right part of tmux statusbar: set -g status-right "#H" You can find more commands in this tmux cheatsheet under "Customizing tmux" section: http://www.cheatography.com/bechtold/cheat-sheets/tmux-the-terminal-multiplexer/


5

In your case it printed previous backgrounded job result [xxx@host]$ /usr/bin/echo test>/dev/null & <Enter> [1] 4559 [xxx@host]$ <Enter> [1]+ Done /usr/bin/echo test > /dev/null


12

It will do nothing as far as I know. The ¬ will just be treated as an argument to the command: $ ls ¬ ls: cannot access ¬: No such file or directory


2

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

sh <<-STRESS & $( printf 'myprog &\n%.0b' \ `seq 1 ${MAX_CONCURRENT_PROCS}` ) STRESS echo "$!" I agree with the comment @msw makes above. This will write you a script to be launched by a backgrounded sh process and print out the child sh process's pid so you can monitor it and its children as it works.


0

tmux has this capability. (along with many other useful capabilities in the same vein)


5

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.


9

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 ...


19

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 ...


15

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 ...


0

On Linux you can use strace to see which system calls a program uses. The following will list all "open(2)" system calls and filter them through sed to show, hopefully, the terminfo file used by tput to translate the terminfo capability for the current terminal. TERMINFO_FILE=$(strace -e open tput cud1 2>&1 | sed -n -e ...


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 ...


0

You can do that using the ANSI control characters: some-command | sed 's/symbol-sequence/^[[0;32;2m symbol-sequence^[[0;0m/' The characters ^[ are not a regular ^ followed by a regular [. It is an unprintable character. You can get it on most terminal by typing Ctrl-v Ctrl-Esc. The second [ is a real [ though. If you prefer full-ascii, here is a ...


1

Putting this in my .tmux.conf file was the trick: set -g history-limit 20000


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


1

Can I enable framebuffer support in xterm? No. X runs in something parallel to the framebuffer, so they cannot both be used at the same time.


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 ...


0

There are two de facto standard escape sequences for cursor keys; different terminals, or even the same terminal in different modes, can send one or the other. For example, xterm sends \eOA for Up in “application cursor mode” and \e[A otherwise. For Down you can encounter both \e[B and \eOB, etc. One solution is to duplicate your bindings: whenever you bind ...


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 ...


0

You are switching for a normal user and this user doesn't have a $PS1 set but in my opnion you add this user using useradd command in Debian Based that by default the shell wen you use useradd is sh , so you can try: chsh -s /bin/bash userName this command will change the shell for userName to /bin/bash. and than try again switch for that user. if you ...


0

You are switching from one normal user (you) to another normal user, say joe, right? The following is your shell prompt, defined in the environment variable PS1: user@user directory $ After switching to joe, you see joe's shell prompt. And he did not configure to show anything fancy in the prompt, so only the default prompt is shown, which looks just ...


0

I generally switch to another virtual console. I'm using Fedora 19 so Ctrl+Alt+F1 would be the primary one you're using now to display X. So I'll often times switch to Ctrl+Alt+F2 where I can either maintain a logged in console, or I can quickly login to there and run the necessary kill commands to halt whatever process is going wild. Other distros make ...


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 ...


0

Your terminal must support 256-colors and have appropriate TERM environment variable set. You likely do not have 256-color support enabled. For xterm: export TERM="xterm-256color" For urxvt: export TERM="urxvt-256color" For tmux/screen: export TERM="screen-256color" I would place it in ~/.bashrc, ~/.bash_profile or ~/.profile depending on ...


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*' ...


0

That depends on the exact make(1) you have got, and the makefile being used. For example, GNU make helpfully assumes a set of default rules and macros. I.e., the macro CC gives the name of the C compiler, CXX the C++ one; CFLAGS are flags for CC and CXXFLAGS for CXX. It also defines a slew of default rules, i.e., to create a foo.o from foo.c by calling ...


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

You want the CFLAGS environment variable. For example: $ export CFLAGS='-ggdb3' $ make test cc -ggdb3 test.c -o test


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 ...



Top 50 recent answers are included