New answers tagged

1

What you are asking does not seem to be developed on linux yet : Terminator has an open issue, somebody seems to be working on it actively : https://bugs.launchpad.net/terminator/+bug/1301605 Gnome-terminal doesn't seem to have any support. No bug has been filed related to this feature anyways : gnome-terminal bugs Konsole neither : ...


0

Use public key authentication In the source host run this only once: ssh-keygen -t rsa # ENTER to every field ssh-copy-id myname@somehost That's all, after that you'll be able to do ssh without password. Coming to your question, use below command now, ssh apple@192.168.1.117 'ls -l /applications'


0

You can run the command in a non-login, non-interactive shell session using ssh: ssh apple@192.168.1.117 'ls -l /applications'


2

When you use tab in bash (which is the shell used by default on OSX), it first tries to complete what you have typed up to now, then show non-ambiguous completion, then (third tab) all completions. You can change this behavior by creating a file named .inputrc in your home directory, and put in it: set show-all-if-ambiguous on This will remove the ...


1

Any program can allocate a pseudo-terminal, it doesn't have to involve a login. It's just another form of inter-process communication, which is useful if the application needs to emulate a terminal. An example is the Expect program. It allocates a pseudo-terminal when it spawns a program, so that the program will act as if it's being run interactively by a ...


3

If you don't like the idea of dedicating a whole terminal to watching the output of df, you could consider a tool such as conky. There are countless examples of using conky to monitor everything from HDD usage, HDD temp, ram usage, local weather, news headlines... you name it.


14

As Julie said, you can use df to display free space, passing it either the mount point or the device name: df --human-readable /home df --human-readable /dev/sda1 You'll get something like this: Filesystem Size Used Avail Use% Mounted on /dev/sda1 833G 84G 749G 10% /home To run it continuously, use watch. Default update interval is 2 seconds, but ...


2

df is a simple command line utility that shows you disk usage, including free space. Check man df for details.


2

Another common remedy for this problem is to type Ctrl-VCtrl-O at the shell prompt. The first puts the shell into "literal" mode so that it won't modify the following character, which is the terminal reset command understood by almost all common terminal types. You might need to echo this instead, on some terminals.


3

That happened because the output you produced included codes that your terminal interface interpreted as control codes. This is normally resolved with either reset or stty sane.


0

You have several tools to configure the network on Centos 7. nmtui (From the package NetworkManager-tui) mmcli (From the package NetworkManager) nm-connection-editor (If you have a GUI running Gnome Desktop Environment) Please take note that in Centos 7 the default network service is managed by the NetworkManager which is a dynamic network control and ...


1

There is simple TUI command to configure whether you are configuring the network on Server or on Local System. Use the below command and follow the steps-: $ sudo nmtui After configure the network. Activate the network. Restart the network service. $ sudo systemctl restart network


0

So you want to change into a certain directory each time you open a shell? In this case you can add the cd command to your ~/.bashrc (or the appropriate rc file for your shell if you don't use bash). Another approach would be to create an alias in ~/.bash_aliases, e. g. alias pd='cd /my/project/dir' and enter pd each time you want to get there.


1

If you have history set up, you can use history | grep cd to see your recent cd commands.  You should be able to use them to figure out where you were working last time.


0

This worked for me in your ~/.xinitrc replace exec gnome-session with exec dbus-launch --exit-with-session gnome-session Source: https://bbs.archlinux.org/viewtopic.php?id=203918


0

In OS X you can use AppleScript to run JavaScript in Chrome: xj(){ osascript -e'on run{a}' -e'tell app"google chrome"to tell active tab of window 1 to execute javascript a' -eend "$1"; } Firefox does not support AppleScript.


3

Most of the terminals you are likely to use implement escape sequences for saving and restoring the cursor position. Those are the sc (save cursor) and rc (restore cursor) capabilities in the terminal description, which you can use via tput (just like cup): tput sc tput cup 50 10 echo some stuff echo more stuff tput rc However, if your program writes ...


2

An alternative, if you have a fairly recent pinentry/gpg2 (tested with 0.9.7 and 2.1.11 respectively on Arch Linux), is to use http://elpa.gnu.org/packages/pinentry.html. Install pinentry from M-x list-packages, then put allow-emacs-pinentry in your .gnupg/gpg-agent.conf and put (setenv "INSIDE_EMACS" (format "%s,comint" emacs-version)) ...


0

It seems there is nothing wrong with the .desktop file. Hence there must have been something wrong with my setup of Lubuntu. After switching to a clean install of Devuan everything works as expected.


2

You are describing the feature of VTE (used in XFCE Terminal) which translates wheel-mouse scrolling into up/down cursor-keys when using the alternate-screen. That happens if you are running screen in something like xterm. You can avoid that by preventing screen from using the terminal's alternate screen feature. For example (see How to disable alternate ...


1

This came to me after I asked the question in another forum AskUbuntu: vim.desktop - changes lost when terminal exits and a lot of experimental *.desktop files demonstrating that gnome-terminal would allow vim to be killed without warning even if it was running in an shell & even if there were other commands before or after it for bash or gnome-terminal ...


2

In the Edit > Preferences menu of xfce4-terminal you can disable the scrollbar. If you set the scrollback value to 1, it will disable scrolling back using the scroll wheel on your mouse. I'm using xfce4-terminal 0.6.3, the default version for Ubuntu 14.04.


1

ccze uses the curses output mode by default. (n)curses is a screen drawing library typically used by fullscreen applications. It switches to the terminal emulator's so-called "alternate screen" which does not have a scrollbar buffer, and the contents of the other, "normal screen" is restored upon exit. Instead of this, you should use its ansi output format ...


2

So there are a few open source fonts targeting programmers that support ligatures, namely FiraCode Hasklig Monoid Iosevka However, very few opensource terminals that run natively on Linux yet support this. But you can find an current list in the FiraCode docs Black Screen (slow in browser terminal emulator that runs on node) Konsole (terminal editor ...


1

According to the Emacs wiki, the recommended TERM setting for ansi-term is "eterm-color". That terminal description is provided by ncurses; you probably would have to use the package with the complete terminfo database for platforms which make a distinction, e.g., Debian with ncurses-base and ncurses-term. The eterm-color description provides 16 colors, ...


1

Set LogLevel INFO in your server /etc/ssh/sshd_config. It should hide the most of messages. Also search for other occurrences of this option in that file.


0

Solution that helped me was to force the script to run in interactive mode with a #!/bin/bash -i header. Advanced Bash-Scripting Guide warns about weird consequences though: Be aware that this can cause erratic script behavior or show error messages even when no error is present. However I haven't observed anything like this.


0

There is probably only one thing missing from your example, the option -f to flush the write each time. script -f >(while read;do date;echo "$REPLY";done >>session.log)


0

Sounds like ts, from moreutils. Lots of distros have it packaged. It just prepends timestamps to lines of input. Example use: $ while true; do sleep 1; echo hi; done | ts %s 1461198715 hi 1461198716 hi 1461198717 hi 1461198718 hi [ ... ]


0

this might be a partial solution, depending on your needs: if you include \d \D{} in your PS1 string, each command prompt will include the date and time. that will give you the time at which the previous command finished. in the simplest case, do PS1='\d \D{} $ ' do that after invoking script (or in your .bashrc or whatever) and you will get a ...


2

sshd is the daemon. You'd want to use the -q flag with the client (ssh). When connecting to your home machines, include the -q flag in the ssh command (i.e. ssh -q user@host). Alternatively, if that doesn't work, you could try redirecting stderr to /dev/null by connecting to your home machines like ssh user@host 2> /dev/null.


1

.bashrc is sourced by default. -bash-4.1$ echo 'echo I was read' >> ~/.bashrc -bash-4.1$ script asdf Script started, file is asdf I was read bash-4.1$ exit Script done, file is asdf


0

On urxvt, you have to issue chown root.utmp /usr/bin/urxvt chmod g+s /usr/bin/urxvt Then it starts working. I don't understand why, just copied (and tested) from http://permalink.gmane.org/gmane.comp.terminal-emulators.rxvt-unicode.general/1484.


3

You simply use wall; running it as root will ensure every terminal displays the message. wall Your attention please\! Older versions of wall only accept a file name on their command-line, or a message piped in: echo Your attention please\! | wall


4

man wall will give you what you need. You execute wall with either a filename, or you pipe content to it. For example, either, wall file.name to broadcast the content of the file file.name or echo "Dive\!" | wall to send the message Dive! Update: As Stephen points out in this answer, later versions of wall can send messages by simply typing, wall ...


0

The behavior is unrelated to settings of the console/terminal. Rather, it is a feature of the terminal (or terminal emulator) itself. The terminfo database's predefined capabilities reflect existing practice across a few thousand terminal types. If you read through the list of predefined capabilities, you may notice that there are several definitions for ...


3

Perhaps you cannot have what you are asking. From the terminal's standpoint: screen is a full-screen (no pun) application just like vi or less. the terminal implements scrolling and an alternate screen. when the terminal is in alternate-screen mode, it does not add to its scrollback area as it would in normal mode. in gnome-terminal (and perhaps some ...


1

Add the -i option: clamscan -r --bell -i /


0

The odd thing is that htop uses ncurses, which can draw lines with/without Unicode. However, looking at the source-code in CRT.c shows the explanation: #ifdef HAVE_LIBNCURSESW if(strcmp(nl_langinfo(CODESET), "UTF-8") == 0) CRT_utf8 = true; else CRT_utf8 = false; #endif CRT_treeStr = #ifdef HAVE_LIBNCURSESW CRT_utf8 ? ...


6

With zsh: autoload colors; colors for color (${(k)fg}) eval "$color() {print -n \$fg[$color]; cat; print -n \$reset_color}" And then: $ echo "while" | blue while


12

Here's a little script that does just that. Save this as color in a directory in your $PATH (for example, ~/bin if that's in your $PATH): #!/usr/bin/env perl use strict; use warnings; use Term::ANSIColor; my $color=shift; while (<>) { print color("$color").$_.color("reset"); } Then, pass your text through the script, giving . as the pattern ...


16

You'd use tput for that: tput setaf 1 echo This is red tput sgr0 echo This is back to normal This can be used to build a pipe: red() { tput setaf 1; cat; tput sgr0; } echo This is red | red The basic colours are respectively black (0), red (1), green, yellow, blue, magenta, cyan and white (7). You'll find all the details in the terminfo(5) manpage.


0

Some of the comments suggested ncurses as a possible solution. There are pros/cons to that: ncurses is useful for drawing text while moving about the screen (either full-screen, or a full-line using filter). OP's example prints a fragment of a single line, and the discussion gave no clues whether this was a typical use, or part of something more ...


0

It depends on the terminal. As a rule, you cannot do this using "ANSI colors", because (while some terminals interpret the bold video attribute as "bright colors"), there is no standard way to change the brightness of the background. Some terminals support escape sequences for changing the color palette used by the terminal independently of "ANSI colors". ...


0

Depending on your terminal emulator, it may be possible to redefine the color "white" in the terminal's color scheme: echo -en "\e]PFffffff" setterm --foreground blue --background white --blink on


1

cat /some/file | ssh user@machine 'cat >/destination/file This does not work, because ssh truncates its stdin before displaying prompt and reading a password (security). Possible workaround is to use expect script, which will interact with running ssh process.


1

(Open)ssh reads directly from the tty. See: http://cvsweb.openbsd.org/cgi-bin/cvsweb/~checkout~/src/usr.bin/ssh/readpass.c?rev=1.51&content-type=text/plain where it calls readpassphrase. How does ssh prompt for a password when all input and output is redirected?


1

You seem to have messed up your $PATH, which determines where bash looks for programs. Normally the user programs reside in /usr/bin and you should be able to run then with their full path instead of just the name: /usr/bin/nano .bashrc or /usr/bin/vi .bashrc. Or you could run export PATH=/usr/bin, as recommended by Jeff in the comments.


0

in the menus of Terminal.app use Window->Merge all windows.


0

This was a requested feature in the original iTerm six years ago, but the only activity on it was to set the priority to low. From poking around in itermocil, I think you should be able to do it to either Terminal.app or iTerm(2) by using AppleScript. However, I know very little about AppleScript and can't find any real documentation on it.



Top 50 recent answers are included