Tag Info

Hot answers tagged

21

Ctrl+4 sends ^\ Terminals send characters (or more precisely bytes), not keys. When a key that represents a printable character is pressed, the terminal sends that character to the application. Most function keys are encoded as escape sequences: sequences of characters that start with the character number 27. Some keychords of the form Ctrl+character, and a ...


12

These are ANSI escape codes. The ^[ represents an ESC (escape) character, the next [ is an actual left square bracket, and the letter indicates the function of the escape code. The Esc[ part is called the CSI (Control Sequence Introducer). So the sequence CSI A means arrow up, or CUU (CUrsor Up). Anyway, this scheme dates back to the time of the VT100 ...


8

Your Ctrl-r is being intercepted by the kernel-based terminal cookied line processing engine. While sleep is running, the terminal is in cooked mode, which means that the kernel-based tty line editor is working. The tty line editor supports rudimentary command line editing. The erase key (usually set to Ctrl-h (backspace) or Del) and the kill key (usually ...


6

To logout from UNIX or Linux you can either: type exit and press [ENTER] on a command line where you haven't typed anything press [CTRL]-D to log out.


5

In addition to Gilles answer let me add, that you can always input non-printable characters in bash with Ctrl-v+key (Ctrl-v+Ctrl+4 in this case) and check the character code with $ printf '^\' | od -An -tu # input ^\ as C-v C-4 28 you get the decimal code of the character, which as you may check in man ascii corresponds to file separator (FS).


5

Although you could disable Ctrl-c and Ctrl-z by disabling those terminal settings or setting the terminal to raw more or other solutions, you are usually much better off leaving them enabled and reacting to the resulting signals instead. You can install handlers for the signals and let the handlers do nothing. The way to install handlers depends on the ...


5

I suppose TERM is set to linux for the init process (pid 1) by Linux kernel here and there. You can see it in /proc/1/environ (sorry the following output is from Ubuntu 15.04): $ sudo strings /proc/1/environ HOME=/ init=/sbin/init recovery= TERM=linux BOOT_IMAGE=/boot/vmlinuz-3.19.0-25-generic.efi.signed PATH=/sbin:/usr/sbin:/bin:/usr/bin PWD=/ ...


4

Due to the fact that "etc/motd" is a plain text file, commands are not executed, but instead printed as so: #!/bin/bash echo "$(tput setaf 2) .~~. .~~. '. \ ' ' / .'$(tput setaf 1) .~ .~~~..~. : .~.'~'.~. : ~ ( ) ( ) ~ ( : '~'.~.'~' : ) ~ .~ ( ) ~. ~ ( : '~' : ) $(tput sgr0)Raspberry Pi$(tput setaf 1) '~ .~~~. ~' '~' $(tput ...


4

If you stick a serial loopback adapter in the specified serial port: Yes. If you want to debug an application talking through a serial port, you could use this command: socat /dev/ttyS0,raw,echo=0 SYSTEM:'tee input.txt | socat - "PTY,link=/tmp/ttyV0,raw,echo=0,waitslave" | tee output.txt' (From http://unix.stackexchange.com/a/225904/127903)


4

First you want to install sshpass Then you create a little script called openRootShells.sh or something similar. Insert the following: #!/bin/bash read -s -p "Enter Password: " PASSWORD konsole -e sshpass -p $PASSWORD ssh root@localhost konsole -e sshpass -p $PASSWORD ssh root@localhost konsole -e sshpass -p $PASSWORD ssh root@localhost konsole -e sshpass ...


4

No, there is no way to undo a command(at least not universal). This is often a problem when users run rm with wrong regex, without realising that it covers more files than they would like to remove. Also, it would really be impossible to implement undoing ANY command from terminal. Imagine command that sends an e-mail, or plays some sound. There is no way ...


3

Bash needs to put the terminal into character-at-a-time mode while it's waiting for you to type in a command line, so that you can edit the command line using emacs or vi-like editing characters. That's the mode you saw when you looked at the terminal's attributes from another terminal in your example. Just before it runs a program (in your example, stty), ...


3

$ sleep 5 & [1] 1234 $ disown


3

Ctrl+\ is one of the control characters that cause the terminal to send a signal (SIGQUIT), like Ctrl+C (SIGINT) and Ctrl+Z (SIGTSTP). You can run stty -a to show what characters have a special meaning to the terminal; see Clear / erase a mistyped invisible password on a shell / terminal in Linux for more details. The upshot is that when you press Ctrl+\, ...


3

This means capture an underscore. Examples of matches include: A A_ AAA A_123 A_abc Use a site such as https://regex101.com/ to test your regular expressions and get an explanation on what each part means.


2

The effect you are seeing isn't a terminal window graphical trick, it is gui emacs running in X. You correctly identify the customization to get emacs to draw that, but these are only rendered when emacs is run in X. To illustrate, I have my mode-line themed with: '(mode-line ((t (:background "gray10" :foreground "green" :box (:line-width -1 :style ...


2

The way I understand this Wikipedia Page (though I would very much like to be proven wrong on this specific issue): Style Underline exists, not limited to cursor. They call it code 4. Style Framed exists, as in 4 borders around each character, they call it code 51. Note: That does not enable framing a string of characters without borders between the ...


2

It looks like you're using a variable width font in your terminal in the first picture. This is why characters are smashed. Terminal prompts should be used only with fixed width fonts (e.g. Monospace, FreeMono, Courier).


2

Group changes on unix are not recognized by existing login sessions; assuming, say, a Linux system with the usermod command: $ groups user $ sudo usermod -G wheel $USER ... $ grep user /etc/group | grep wheel wheel:x:10:user $ groups user To see the group change, any existing sessions (e.g. SSH, X11, etc.) must be exited, and a new session made (e.g. open ...


2

Firstly, you have your /dev/sdX numbers mixed up between your screenshot and your summary. Hence, the four partitions from df are /dev/sda4 mounted on / /dev/sda2 mounted on /boot /dev/sda1 mounted on /boot/efi /dev/sda3 mounted on /home /dev/sda1 is not empty; df shows it contains 191M. Type: Microsoft basic in the partition table ...


2

There is no universal way of undoing a command like this. However, providing you have not overwritten any files it's not too difficult to use the list of source files to identify the set that must be removed from the destination: You accidentally ran this: cp ~/local/* ./ So to find the set of files to remove, something like this can be used: for SRC ...


1

There are two parts in this. One is the grub part which is hidden by the boot screen. You can enable its output for textual consummation by changing the line GRUB_CMD_LINE_LINUX_DEFAULT in /etc/default/grub on Ubuntu machines and remove quiet splash: #GRUB_CMDLINE_LINUX_DEFAULT="quiet splash" GRUB_CMDLINE_LINUX_DEFAULT="" run update-grub after this for ...


1

I'v found a solution. It appears that ttygif allows You to use a starting command with flag -e So it's enough to do ttyrec file_name -e "tmux a" Or in my case record-session -e "tmux a -t my_session"


1

There are more than one solutions here: Use tmux-logging plugin. Use a .bash_profile to log the output to a script. If you want to use record-session you can always use tmuxinator to setup the ENV and run the commands. There are probably more ways to do it, but best way IMHO would be to use the plugin.


1

Resolved the issue the package I was using for PyX was only for python3


1

You can just enter ► directly in the config file, without any escaping. Note that the progressbar_look setting must contain exactly two or three characters.


1

There is a tool, often used as sysadmin, called clusterssh to have command line interaction to many machines with the feature to write once by sending the typing to all of them (together with the possibility to write to the individual consoles. You didn't mention the operating system of your pc. I use it in debian and there is a package for it. The command ...


1

There are a couple of ways to the get the file descriptors: You can run something like: lsof -p $$ | grep /dev/pts or ls /proc/$$/fd File descriptors 0 (stdin), 1 (stdout), and 2 (stderr) are all standard FDs used by all programs.


1

I am stupid... The problem was the exports. I forgot that I moved the definition of /usr/local/bin in PATH to ~/.exports from /etc/paths. All I had to do was source the ~/.exports first in ~/.bash_profile. The ls color problem was from GNU core utilities that I installed via homebrew. Apparently it doesn't support the G flag, like os x's ls does.


1

It's called blink mode. If your terminal supports it, syntax is echo -e "Normal \e[5mBlink" Bash tips: Colors and formatting ANSI/VT100 Control sequences



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