Tag Info

New answers tagged

2

Usually by testing if a relevant filehandle is attached to a tty: % perl -le 'print -t STDOUT ? "yes" : "no"' yes % perl -le 'print -t STDOUT ? "yes" : "no"' > out % < out no % Or via C, something like: #include <sys/ioctl.h> #include <stdio.h> #include <stdlib.h> #include <unistd.h> ... int foo; if (ioctl(STDIN_FILENO, ...


0

Best way is to look from the outside ie put the hdd offline. Any live-cd containing a version of parted or fdisk will do. Easiest is probably gparted at gparted.org


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


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


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


1

Why is the ftp resource being downloaded after I drag the link to my Terminal? (instead of being pasted as text, like http-URLs) The resource is not being "downloaded", but queried for its path and type. When dropping a file or URL on Konsole, it will try to convert it to a URL or path. Try for instance dropping a file:///tmp/ URL from Firefox to ...


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


22

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


0

Add the following lines to your tmux.conf (~/.tmux.conf) set -g c0-change-trigger 150 set -g c0-change-interval 100 More info can be found at http://blog.fraggod.net/2014/09/23/tmux-rate-limiting-magic-against-terminal-spamflood-lock-ups.html


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


0

With the information you provided, I have two guesses: Font configuration is somehow incorrect. Customized prompt with some special character messing with the character encoding. For the first guess, since you are using a graphical interface, check that the font configuration is correct under System->Preferences->Appearance->Fonts tab and play around the ...


1

As mentioned before you can try picocom. The latest release (2.0) can also be used (safely) to set-up a "terminal server" since it does no longer permit shell commands injection. See: https://github.com/npat-efault/picocom/releases


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)


0

Along the tmux and screen worth to mention byobu as well. http://byobu.co/ https://help.ubuntu.com/community/Byobu


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


3

$ sleep 5 & [1] 1234 $ disown


0

Unchecking "Scroll alternate screen" in Terminal->Preferences->Profiles->Keyboard fixed it for me.


0

Your existing login session didn't load with the wheel group membership. Now that it's been granted, you can incorporate it by entering: newgrp wheel ... without having to log out or reboot.


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


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


-1

The $TERM variable is normally set in /etc/profile or .bashrc depends on the distro ur using. Read http://www.tldp.org/HOWTO/Keyboard-and-Console-HOWTO-11.html


0

As @fiximan suggested , I tried to test if tmux session exists or not and then execute some code and finally, with a little tweak I am successful in getting the layout I wanted. Here is what I added to my .bashrc : test -z "$TMUX" && (tmux new-session -d && tmux split-window -h && tmux split-window -v && tmux -2 ...


0

For Ubuntu 14.04 starting with htop -s=MEM did the trick for me.


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.


0

dvips is provided by texlive (on Ubuntu/Debian, at least). Try installing texlive and see if that fixes things!


1

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


1

I did itusing a bit of a hackier way: Using tcsh I put the following in my .cshrc # escape sequence to set the screen title alias stitle 'echo -n "^[k\!*^[\\"' # shorthand to set the screen title to the hostname alias H stitle `hostname -s` # shorthand to set the screen title to the filename, launch vim, and then set it back alias ...


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


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.


0

Neither of the commands in the first answer had the desired effect but based on those, I experimented with the following: has open, flag f = open "$@" Now, a rifle.conf file comprising just that one line does seem to be effective. If I understand correctly, the one and only condition, satisfied, is that open is installed (i.e. located in $PATH). Google ...


0

In bash I find CTRL+l moves the cursor to the top of the screen, but CTRL+L (i.e. CTRL+SHIFT+l) moves the cursor to the top of the screen, and inserts around a screen of space beforehand. Ideal! Thanks @Anthon.


0

After adding the line below into .tmux.conf set -g default-terminal "screen-256color" You still need to add the line below into .vimrc set term=screen-256color Finally, the alias need to be added to .bashrc alias tmux='tmux -2'


0

What have you tried so far? According to one of the ref links you posted, the line: has open, flag f = open -a "$1" or has open, flag f = "open -a" "$1" would be where I would start. I'm unable to test, not having access to OS X.


0

The program is buggy as it pads the numbers with spaces to 3 characters. E.g. prints "[[48;5; 42m (with space) which doesn't work instead of ^[[48;5;42m (without space) which would work.


0

The standard spelling is “framebuffer”, without space. In Linux kernel, fbdev is an (optional) graphic abstraction layer for video hardware (a.k.a. video card). Different video hardware needs different drivers (that may be loaded as kernel modules), but user-space software, such as mplayer, uses unified API writing to it. The word framebuffer itself means a ...


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


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


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


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


0

In your program, by default file descriptors 0 (stdin), 1 (stdout), and 2 (stderr) will be associated with the terminal, unless you use redirection or pipes in the command you use to invoke the program.


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.


0

You probably have an older version of installed via homebrew. Run this command to see what versions you have: find /usr/local/Cellar/openssl-osx-ca -maxdepth 1 -type d To remove all but latest version of openssl-osx-ca run the following command: brew cleanup openssl-osx-ca Lastly, you probably want to remove your mail messages. If so, run the ...


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.


0

You should have .bash_profile and .bashrc at least and may have .profile, .bash_aliases, .bash_logout and many, many other files in your home directory that affect bash. The exact structure of such files changes with the OS and personalization by the user. For a full answer you need to provide the full output of ls ~/.bash* and if ~/.profile or ...


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


0

I solved this by updating the schema file org.gnome.desktop.wm.preferences.gschema.xml using the actions listed below sudo gedit /usr/share/glib-2.0/schemas/org.gnome.desktop.wm.preferences.gschema.xml Search for visual-bell-type & modify the default value.


-2

bash fn + up_arrow: page up fn + down_arrow: page down cmd + up_arrow: line up cmd + down_arrow: line down



Top 50 recent answers are included