New answers tagged

0

The related posting Mac OS X terminal and GNU screen scrollback essentially advises you to suppress switching to the alternate screen of xterm. While in the alternate screen, you would not necessarily be able to use the scroll-wheel to see xterm's scrollback. A program running in xterm would only see the escape sequences if it enables the xterm mouse ...


1

OK, to answer my own question... After reading this question: OpenSSH, FreeBSD screen overwrite when closing application I decided to get familiar with termcap and after a few headbangs I finally made it work as expected. Below I provide the entries to my $HOME/.termcap # $HOME/.termcap xterm-256color|xterm with 256 colors and clear:\ ...


1

You could install and use xttitle (Note the doubled t in the name). I use it like this in a file sourced by my ~/.bashrc: # from the "xttitle(1)" man page - put info in window title update_title() { [ $TERM = xterm -o $TERM = xterm-color ] && xttitle "[$$] ${USER}@${HOSTNAME}:$PWD" } cd() { [ -z "$*" ] && builtin cd $HOME [ -n ...


-1

What i assumed from your question is you want to explore tweaks/settings of an application. You can read preferences of an app with this trivial command defaults read NSGlobalDomain or defaults read com.google.Chrome to read chrome writeable preferences from defaults write command which you asked for.


0

For exemple why the creation date is different on the same file? There is no creation date info from you MediaInfo output. You have "only" recorded date (when the source was recorded), encoded date (when someone encoded the source file to another format), the tagging date. None of them is the file creation date (the date when the file was created on ...


0

If you are working in OS X, install MouseTerm with SIMBL (simple plugin loader). Then configure .tmux.conf as follows ( for Tmux 2.0, newer versions will vary): set -g mode-mouse on set -g mouse-resize-pane on set -g mouse-select-pane on set -g mouse-select-window on I found that using option key on my Macbook Pro running Yosemite will enable ...


0

With terminal, there are many ways to do this. One option is to use find(1): find /your/dir -type f \! -name 'x300' \! -name '300x' -exec echo rm -f {} \; Replace /your/dir with the location where your files lie. Once you're absolutely sure the find command hits only those files you actually want to delete with rm, remove "echo" from the exec-part and ...


0

You can have multiple versions of Java JDK installed at the same time. You can, then, set the version of the JDK to use within terminal. You can also set the version you want as the default in, ~/.bash_profile export JAVA_HOME=`/usr/libexec/java_home -v '1.6*'` export JAVA_HOME=`/usr/libexec/java_home -v '1.7*'` export JAVA_HOME=`/usr/libexec/java_home -v ...


0

You can swap between installed versions of the JDK on the fly, within the terminal, using; export JAVA_HOME=`/usr/libexec/java_home -v '1.6*'` export JAVA_HOME=`/usr/libexec/java_home -v '1.7*'` export JAVA_HOME=`/usr/libexec/java_home -v '1.8*'` (use the same command in your ~/.bash_profile to set the required default, too!)


0

How to prevent opening same program on terminal server by the “same user” with command prompt? I have multiple users logging on to this "terminal server" and running the same .BAT file...so what happens is when "User 2" logs on, they don't get Outlook started because it already shows as running in the task manager under "USER 1" Give the ...


0

scp uses uppercase P for the port option: scp -i server.pem -P 2222 source-file ec2-user@IP:path/dest Or did that gave an error? Which one?


0

You can add a PING test before it. How reliable it will be I don't know, but certainly more reliable than just calling it regardless: set ipToTest=8.8.8.8 ping -n 1 %ipToTest% | find "TTL" if %errorlevel% == 1 ( netsh wlan connect name=Fursan-WIFI-03049815768 if %errorlevel% == 1 ( netsh wlan connect name=DIFFERENT_NETWORK_HERE ) ...


1

The code is fine, but it was written for a different runtime. WScript is very different from node.js (just like both are different from the "usual" web-browser environment) – for example, it does not support require() nor console. (Technically it's not even JavaScript but JScript.) You will have to download node.js for Windows.


2

The CMD prompt such as C:\> is always displayed at the beginning of a line. In order for CMD to be able to guarantee that, it must insert a newline after a console program ends, since the program itself might have left a line not terminated with a newline at the end. Hypothetically, if CMD did not automatically insert a newline after the program ended, ...


0

The terminal features are not available with all terminals, and may differ with versions of tmux. I see the description cited in tmux 1.6 on Debian 7. Ubuntu 14.04 is a little old, and has tmux 1.8 (same description). The example given in the manual page looks like DECSCUSR, which is supported by xterm starting with patch #252 in 2009. Refer to XTerm ...


0

Thanks to @DanielBeck for his detailed answer. Here is a very quick and dirty solution, useful to quickly check the label of some file on ssh: #!/bin/bash color_08=$'\e[44;30m' #blue color_02=$'\e[47;30m' #gray color_04=$'\e[42;30m' #green color_0E=$'\e[46;30m' #orange/cyan color_06=$'\e[45;30m' #purple color_0C=$'\e[41;30m' #red color_0A=$'\e[43;30m' ...


0

It only stays in monitor or promiscuous mode when a running process is holding it in that mode. While this holds true most of the time when we run (on El Capitan): # sudo tcpdump -p -I -i enX -y IEEE802_11 The interface may get stuck on monitor mode after tcpdump exits (where X is a wireless network card that supports monitor mode). Note that I say ...


1

The simplest way to get the first 2 chars of each line is cut -c 1-2 extracter.txt Your question is not clear about what you want to save into a variable.


0

pandoc probably can't be found in the PATH for the root user. If you can log in as root, run env | grep ^PATH


0

rm has the option -i which asks every time before removing a file. I think that's not what you want because it asks EVERY time before removing a file which would often go into many hundreds of acknowledgments if you want to recursively delete, for example, a git repo. What you want is probably a simple script which "replaces" rm like this one #!/bin/bash ...


0

You cannot directly delete all tables at a glance. If you work with PHPMYADMIN you can select all tables and go for drop option. Otherwise, you can use command-line with commas to delete multiple tables in mysql database. see the example: drop table users,countries etc.


1

The bash exec -l command replaced your current shell session with a newly initialized shell (like a login) and that does not contain any of the aliases and temporary symbols which were established with source activate. Perhaps your shell initialization does not set the PATH variable in the same way that your ordinary interactive sessions do. You could do ...


0

A Terminal is a text-based interface (possibly to a shell) The difference between console and shell is one I don't yet grasp, but I can tell you how a terminal is different from a shell. The terminal is (according to Wikipedia) "a serial computer interface for text entry and display. Information is presented as an array of pre-selected formed characters". ...


0

Given your question I'm betting that you may want, in your bash script, to run osascript more than once - hoping to save the terminal's ID and reuse it ?!? I had trouble making this work without fail initially. Window #s change - tab #s change - with the creation/deletion of these. Associated ID's (created by Terminal.app) can come and go as well - ...


1

Found the problem. I noticed when I opened my .bashrc in vim, there was a little [dos] in the bottom. I then ran dos2unix .bashrc to convert it to Unix file endings and the problem is fixed. Upon further reading, it seems like Cygwin may have had something to do with the dos line endings. See ...


0

I think you need to use double quotes for that. Double quotes preserve the complete meaning of what you type, while single does not. Read this for more info. So your code should look like this alias ls="ls --color"


0

I assume you are using a Bash CLI. There are at least two ways to do this, depending on how much you do want to plan ahead. If you type a command and enter, and then decide you want to run some other command when that finishes, you can do this: 001 $ date; sleep 10 002 Mon, Jan 25, 2016 3:08:35 PM 003 tty; date 004 $ tty; date 005 /dev/pty2 006 Mon, Jan ...


0

You can type or paste your new command in the shell window where the current command is being executed and the shell will see it and execute it after the current command finishes. No additional menu entry needed. E.g.: $ command1 command2 $ $ (the repeated prompt is printed because the shell will prompt you after executing command1 before starting ...


0

I'm not sure I understand your setup fully from the way you phrased your question, but the answer is probably that you need to edit /etc/exports to add -32bitclients to the entry for that exported directory. If you're really new to the Terminal, I should probably mention that /etc/exports is a text-based NFS configuration file that specifies how you want ...


1

Screen-4.3.1 has solved this bug. Just do the following: 1-Download Screen-4.3.1 wget http://www.linuxfromscratch.org/blfs/view/svn/general/screen.html 2-Decompress tar -zxvf screen-4.3.1.tar.gz 3-Go to directory cd screen-4.3.1 4-Run configure to create Makefile ./configure 5-Make and install make make install 6-It will probably ask you to ...


1

Apparently, the profiles created in 14.04 are not usable in the default gnome-terminal of 15.04 and 15.10. I just opened a gconf.xml in an editor and manually copied all palette colors to the gnome-terminal profile preference. You can view the settings you entered with dconf-editor instead of gconf-editor, in ...


0

Another approach is to use the CDPATH environment variable.  This works for the cd command the way PATH works for running programs — if you type a cd command with a parameter that doesn’t begin with / (or ~), the shell looks for a directory by that name under each component of CDPATH.  For example, if you want quick access to the following directories: ...


0

Adding terminalapp to .zshrc didn't work for me so I looked for the plugin ~/.oh-my-zsh/plugins/terminalapp and it tells me: # This file is intentionally empty. # # The terminalapp plugin is deprecated and may be removed in a future release. # Its functionality has been folded in to the core lib/termsupport.zsh, which # is loaded for all users. You can ...


0

Instead of open Terminal, you can invoke the application binary file directly (not the .app file). The following should work for your launchd. Note that Terminal will launch, run the script, and then exit. Depending on your Terminal.app preferences, the terminal window may disappear immediately, or just leave a dead window on the screen with the output of ...


0

http://www.dayid.org/comp/tm.html re-attach an attached session (detaching it from elsewhere) tmux attach -d OR tmux attach-session -d


4

find . -name "*.bmp" -exec mogrify -format pmg {} \; -exec rm {} \; Should do it from the toplevel folder. This will execute the second command only when the first one was successful. If you want to execute both commands even the first one was not successfull you have to: find . -name "*.bmp" \( -exec mogrify -format pmg {} \; -o -exec true \; \) -exec rm ...


2

This should work. for f in `ls`; do cd $f mogrify -format pmg *.bmp && rm *bmp cd .. done Or in one line: for f in `ls`; do cd $f; mogrify -format pmg *.bmp && rm *bmp; cd ..; done


1

It should sort the same way as Mac OS X by default. What is your locale? You can change LC_ALL by typing: export LC_ALL="C" If you don't want to change locale in your system you can make an alias and add it to .bashrc alias ll='LC_COLLATE=C ls -ahlF' To use it, simply type ll in terminal which will execute ls -ahlF command with locale give.


0

The SIGHUP signal is sent to the Process Group of the shell when the shell exits. The cleanest way is probably to tell Bash to run your process in it's parent process group, then any SIGHUP sent to the child pgid doesn't effect it. `-m' Job control is enabled (⇒Job Control). All processes run in a separate process group. E.g. Open a ...


0

well, I had the same problem using iTerm.. what solved for me was going to preferences > profiles > keys then selecting "normal" on "left option keys acts as" field (also did for right option key). its default was to act as +Esc so whenever i typed it it was sending esc+] signal.


0

You can install html2text (an advanced HTML-to-text converter) and the usage is straight forward: $ html2text http://example.com/ $ cat file.html | html2text -o file.txt Install by: Linux: apt-get install html2text OS X: brew install html2text Example with curl: $ curl -sL google.com | html2text Search Images Maps Play YouTube News Gmail Drive More ? ...


0

I've been using http://rclone.org/ with much success. I find it quite mature and robust. It also includes bandwidth throttling that works!


0

You need to use the right kind of quotes. Parentheses have special meaning in many shells, and shell variables won't work inside single quotes. Also, if your replacement contains such as / or $, the Perl syntax will be wrong and the replacement will fail. You can use the following script: perl -i -pe 'BEGIN { undef $/; } s/^## Exercise 1.*^## ...


1

After some experimentation, it seems that changes are persistent. My experience has been that disabling SIP lasts for only one reboot; i.e., you disable SIP via command terminal in OS Recovery mode and reboot the machine, and the SIP will be disabled for that session. SIP will remain disabled even if the computer is put to sleep. However, SIP will re-enable ...


0

On OS X, ssh-add has a special flag to connect to Keychain if you decide to store your private key in there. Just run ssh-add -K ~/.ssh/id_rsa. I believe this answers your question more fully. This OS X specific flag is hard to find documentation for but it's been working since at least OS X Leopard.


1

This is normal. It happens simply because the Linux kernel console does not support the 256-color mode. It wasn't written to use 256 colors, as in VGA text mode there's simply no way to do that. (In framebuffer mode it could, but the code still has the exact same constraints.) GNU Screen knows this and automatically translates from the 256-color palette to ...


1

Try this command pushd /Users/myUser/Desktop && zip -r ./temp.zip ./Assets && popd


1

If you want to zip a folder and its contents, you need the -r (recursive) options. For reference: zip(1) (OSX uses libarchive, which follows info-zip) info-zip


2

Regarding less, it is done all in the terminal emulator, because less is unaware of the mouse. The way it works with gnome-terminal is that it sees that the program switches to the alternate screen (an xterm feature) and since normal wheel mouse scrolling would be pointless (the alternate screen does not scroll), the developer chose to send up/down ...



Top 50 recent answers are included