Tag Info

Hot answers tagged

25

Try the unicode utility: $ unicode ‽ U+203D INTERROBANG UTF-8: e2 80 bd UTF-16BE: 203d Decimal: ‽ ‽ Category: Po (Punctuation, Other) Bidi: ON (Other Neutrals) Or the uconv utility from the ICU package: $ printf %s ‽ | uconv -x any-name \N{INTERROBANG} You can also get information via the recode utility: $ printf %s ‽ | recode ..dump UCS2 ...


6

You can translate special characters (binary data) into ordinary characters that are safe to display by piping your tail command into cat -v: tail --follow=name my-rolling-file.log | cat -v The -v (verbose) option of cat (also known as --show-nonprinting) displays "nonprinting" characters using the ^ and M- notations: 0x00 is displayed as ^@ 0x01 is ...


5

If you issue the command stty size it returns the size of the current terminal in rows and columns. Example: $ stty size 24 80 You can read the rows and columns into variables like this (thanks to Janis' comment): $ read myrows mycols < <(stty size) Obtaining the size in pixels requires knowledge of your screen's resolution and I don't think ...


5

Run gedit as: gedit file.txt & The & at the end will cause the process to run in background and you will be able to use the current terminal interactively again.


4

# is the comment character. If you don't want it to be, you need to either escape it, or quote it. echo 2 \# 2 echo 2 '#' 2


4

In most terminal emulators, long command lines […] are wrapped to a new line before the user submits the command by pressing Enter. This is not a function of the terminal emulator. It is a function of your shell. Your shell is not a full-screen application, but it is doing cursor addressing. When you are editing a command line in a shell, ...


4

What about this, tail --follow=name my-rolling-file.log | strings The default for strings is that it will only output printable characters in lengths of 4 (or more), but you can change this with -n {number}.


4

You can use this command: gedit abc.txt & disown Source In the bash shell, the disown builtin command is used to remove jobs from the job table, or to mark jobs so that a SIGHUP signal is not sent to them if the parent shell receives it (e.g. if the user logs out).


4

You can use Perl viacode function from charnames module: $ perl -Mcharnames=:full -CLS -nle 'print charnames::viacode(ord)' <<<"‽" INTERROBANG $ perl -Mcharnames=:full -CLS -nle 'print charnames::viacode(ord)' <<<"🐄" COW charnames was first released with perl v5.6.0


4

The best way I know is through Perl's uniprops. It comes with Perl's Unicode::Tussle module. You can install it with sudo perl -MCPAN -e 'install Unicode::Tussle' You can then run it on any glyph you want to test: $ uniprops ‽ U+203D ‹‽› \N{INTERROBANG} \pP \p{Po} All Any Assigned InPunctuation Punct Is_Punctuation Common Zyyy Po P ...


4

You can use unicode, which also outputs some more information than just the name: # unicode – U+2013 EN DASH UTF-8: e2 80 93 UTF-16BE: 2013 Decimal: &#8211; – Category: Pd (Punctuation, Dash) Bidi: ON (Other Neutrals)


3

Convert (some troublesome) characters to . with tr: tail -f data | tr "\000-\011\013-\037\177-\377" "."


3

If the PIDs are e.g. 340 and 520, then you can try the following: $ watch --interval 2 --difference "ps -p 340,520 -o pid,ppid,%cpu,cputime" Here watch will mark the difference of outputs running with 2 seconds interval, here we have used the output formatting -o option to get only process ID (pid), parent process ID (ppid), percentage of cpu utilization ...


3

My first thought was xsetroot but I think that the following Python snippet will do it better: import gtk import sys def create_window(): window = gtk.Window() window.set_default_size(200, 200) window.connect('destroy', gtk.main_quit) color = gtk.gdk.color_parse(str(sys.argv[1])) window.modify_bg(gtk.STATE_NORMAL, color) ...


3

This is more a "terminal application" feature/configuration option than a bash option. Bash is not aware of fonts or spaces, that's something related to the terminal. For example: Mac Os X's terminal program allows to setup more space between the lines: http://osxdaily.com/2015/01/05/increase-line-spacing-terminal-mac-os-x/ If that's what you're looking ...


3

If you have root access to the remote box, install the package ncurses-term. This will provide the rxvt-256color terminfo entry. As a non-root user, you can also copy over the rxvt terminfo entries to $HOME/.terminfo/r/ on the remote machine, and export TERMINFO=$HOME/.terminfo. ssh <host> 'mkdir -p .terminfo/r' scp ...


3

Use W (capital w) to save the top configuration after you made your changes.


2

There is currently no way to do this. See this accepted answer on stackoverflow which suggests changing pane-borders instead. You can set values for pane-active-border-style and pane-border-style in your ~/.tmux.conf. See this answer for more details configuring these values (and some inconsistencies between tmux versions).


2

Ok, we have a couple bad assumptions to overcome here. Firstly both terminfo and termcap provide mappings between desired functionality and terminal control commands for multiple terminals. for example they answer the question how do I clear the screen on a televideo 922. Secondly they are not used on a per session or per machine basis, they are used on a ...


2

Here is something using find to rename *.png.png -> *.png: find ./ -name '*.png.png' -type f \ -exec sh -c 'mv {} ./$(basename -s .png.png {}).png' \; It isn't really gerenic, so you have to customize it for the other file extensions.


2

It means that mouse clicks will be reported to whatever is reading the terminal as standard input, the position and click will be encoded in an escape code similar to a special function key. Text mode mouse-aware applications (e.g. aptitude) can then use that to perform functions like any "real" graphical use interface (GUI) programs use a mouse. Such ...


2

If you call the binary in /etc/rc.local, notice that rc.local is called as /bin/sh -e. -e means that the script immediately exits if any untested command fails in it. You call the binary in the background and another command in the script may exit with an exit code that is not 0. That has the effect that your binary is sighup-ed. An untested command ...


2

When working interactively, you can use history expansion for this: mkdir /Some/really/long/path/to/a/directory/ cd !$ There are loads of variants to this which allow you to access other parameters from the previous command or any other command in your history. See Bash, insert last used argument of current command for details...


2

In bash (and some other shells, like zsh), you can use $_, which contains the last argument to the previous command: mkdir /path/to/file cd "$_"


2

echo can't move back past the position it started at. No matter how many backspaces you use, once you've erased everything you've output it stays at the initial position. That's why you always see the 'c' character, however many times you backspace.


2

This is nothing to do with the echo command. You'd see this same behaviour if you wrote the output using cat, printf, or some other program. This is an aspect of your terminal. And terminals can differ amongst themselves in this regard. The terminfo database will or won't have, for your terminal, an auto_left_margin capability, known as bw in termcap. ...


2

You said you wanted to grant read and write permissions to all subdirectories and files under: /home/user/workspace/MinimalDbaseExample ... right? Octal 0777 permissions grant rwxrwxrwx symbolically. Octal 0755 permissions grant rwxr-xr-x symbolically. Octal 0666 permissions grant rw-rw-rw- symbolically. To set read/write/execute permissions to the ...


2

You can use a trap to achieve this: trap 'echo -ne "\e[0m"' DEBUG According to bash's man: a trap on DEBUG executes before every simple command, for command, case command, select command, every arithmetic for command, and before the first command executes in a shell function So every time you execute the command, the shell will insert \e[0m ...


2

Using screen -x allows you to connect to a session that it currently attached, without forcing it to detach. For example, if you do this in two separate xterms, you will see input and output of both instances simultaneously. This is useful when logging in from several locations; it avoids having to reattach once you go back to the location where you first ...


1

You can have it call whatever interpreter you wish (bash, csh, zsh, sh, perl, or anything). #!/bin/sh is POSIXly-correct and it should run. What is the output from ls /bin | grep s? Also, you may want to check your file permissions. That killed me when I was writing my first scripts (chmod +x ./myscript.sh).



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