New answers tagged

0

When you add a new program to the path, you need to type rehash For it to be known to the shell.


-1

Check this link out. Can you try running this and rebooting and see if it works after that? csrutil disable


0

One solution is to use the -S (--chop-long-lines) command line option for less. This tells less to truncate lines to the width of the screen. To view the truncated lines that are wider than the terminal, the left and right arrow keys can be used to scroll the window horizontally. You can enable this behavior by adding -S to the command line or setting the ...


1

Run a script at login on OS X OS X can run scripts and applications at login. The procedure is simple. Open System Preferences->Users & Groups. Select a user from the list at the left. Click the Login Items tab. Drag a script or application to the login items, or click the + icon to use Finder to locate the script. Close Users & Groups. Here'...


0

As a fast fix you can make an alias. Add to you ~/.bashrc file this: alias main='/home/user/Downloads/program/./main' then run exec bash in your terminal and it should work. If you're not using bash something similar would work for other shells. For example writing to the file ~/.zshrc for the zsh shell.


2

It looks like you need to add that directory to your path. The exact command to do this depends on which shell is in use. For bash, you'll need something like: export PATH=$PATH:/home/user/Downloads/program/ Explanation: The PATH=$PATH keeps the existing path as part of the new path your are creating. The :/home/user/Downloads/program/ adds that ...


1

this is my script to add my logo to the latest image and remove all video files, i run it via cron every 5 minutes #!/bin/bash cd /mnt/dietpi_userdata/webcam/dump composite -geometry +30+10 /mnt/dietpi_userdata/webcam/logo.png "$(ls -t *.jpg | head -1)" /mnt/dietpi_userdata/webcam/webcam.jpg convert /mnt/dietpi_userdata/webcam/webcam.jpg -gravity North -...


0

What do you want to do with ImageMagick? If you just want to display the image and sort by the timestamp in the filename, you can do this: display "$(ls *.jpg | sort -k1.4 | tail -1)" The parameter -k1.4 makes it to be sorted by the fourth character (ignore 01_ in the beginning).


0

First, your terminal emulator has to recognize that printf '\e]1;Some Text\a' is a request to change the text in title bar (or tab) to Some Text. Most do. It would also be up to the terminal emulator to treat any other escape sequences as something other than literal text to display. That is, there is nothing you can do to force the title text to be a ...


-1

AFAIK, it's impossible. The text on the tab is defined by the settings in the preference panel of the app, the IO just affect the text on the screen.


1

I have never used ImageMagick, so I don’t know what its commands are.  I presume/hope that you know how to open a file given its name.  (I can imagine that it might be something trivial and straightforward like imagemagick filename or open filename.) You’re almost there: you should be able to do what you want with command "$(ls -t *.jpg | head -1)" Notes: ...


1

I just wrote this function for the same reason. I never know which shell has admin privileges. function isadmin() { net session > /dev/null 2>&1 if [ $? -eq 0 ]; then echo "admin" else echo "user"; fi } It adapted from this answer http://stackoverflow.com/a/11995662/307968 for windows cmd shell. Net Session returns 0 status if you ...


0

Additionally, you can execute the following command (or add it to the end of your .sh shell script) in order to kill the Terminal application: kill `ps -A | grep -w Terminal.app | grep -v grep | awk '{print $1}'`


3

To see all the lines sorted by value: $ sort -k3,3 propfile | sed -E 's/[[:space:]]*$//; s/[[:space:]]+/ /g' key1 = value1 key3 = value1 key7 = value2 key2 = value2 key4 = value3 key5 = value4 key10 = value5 key6 = value5 key8 = value5 key9 = value6 To see the lines sorted by value with non-repeated values removed: $ sort -k3,3 propfile | sed -E 's/[[:...


2

Perl solution: perl -ne ' s/\s+/ /g; s/\s+$//; ($v, $k) = split / = /, $_, 2; push @{ $h{$k} }, $v; }{ 1 == @{ $h{$_} } and delete $h{$_} for keys %h; print map { $k = $_; map "$_ = $k\n", @{ $h{$k} } } sort keys %h' < input-file The first two substitutions normalize the whitespace. Then, keys are hashed ...


0

The command you run is called when you install uncompyle6 is uncompyle6, not uncompyle. The command you run when you install incompyle2 is uncompyle2. Both of these programs require a compiled Python program. See this for a discussion of what the .pyo and .pyc extensions mean. There was a bug in earlier versions of uncompyle6 that didn't install the ...


0

The command that worked was slightly off JakeGould's: mysql -u root -p DBNAME < /home/MJV/.../.../db_table_backup.sql If anyone can comment the difference between how these execute, I am sure people newer to Linux would appreciate the description. Thanks everyone!


0

Please pay attention to the symbols used in your title!, If you use special symbols like / you titles will be not saved. I have shared exactly my experience, I had the same problem today. I solved this problem today! This answer does not repeat or contradict the accepted answer it complements the existing answer, my point is important for beginners.


0

Your command is: mysqldump -u root -p DBNAME db_table < /home/MJV/.../.../db_table_backup.sql mysqldump is just a utility that will dump a MySQL database. You will never be able to import data into a MySQL database using mysqldump. Instead, you should just use the regular mysql command like this: mysql -uroot -p[password] db_table </home/MJV/.../......


0

I made the following script: #!/bin/bash pid=$$ # Current PID ps -f $$ | head -n 1 # Show the header of ps while [ $pid -gt 0 ]; do # No more parent when we reach 0 (the kernel) ps -f $pid | tail -n +2 # ps current pid and remove header pid=$(ps -o ppid $pid|tail -n 1) # Get parent pid done It takes the current PID ($$ in bash) and ...


1

If you're using GNOME Terminal or MATE Terminal, you can disable scroll on output: Right-mouse click your terminal window. Go to Profiles » Profile Preferences Go to the "Scrolling" tab. Uncheck "Scroll on output".


1

Using urxvt makes this very easy. Simply enable confirm-paste in your .Xresources. URxvt.perl-ext-common: confirm-paste, I think it comes with certain packages of urxvt or urxvt perls... But once enabled it will ask you to hit y or n on paste of primary or selection buffers, and display a line count. So if you see a million lines you can just ...


0

echo -en "\x1b[\x35 q" # changes to blinking vertical bar echo -en "\x1b[\x36 q" # changes to steady vertical bar Those are the two relevant escape codes you need to put in your .bashrc to change it. Take everything else you've tried out first. And of course choose between steady or blinking, and comment out the other in case you want it later. EDIT: To ...


1

Are we talking about the terminal prompt? If so, you're looking at the variable PS1. From bash, this can be changed by issuing for example export PS1=\u@\h\$ (which is most likely similar to what you already have). Change the part after = to whatever you want. Depending on what you want as your prompt, you need different variables in the export. Here's a ...


0

Could it be that the files are hidden? I had a similar problem and as I suspected, after deleting the files, they were moved to a hidden trash folder on the same drive.I followed the steps in the link Open terminal and enter the following: defaults write com.apple.Finder AppleShowAllFiles NO Relaunch finder by alt clicking the finder icon and click ...


0

To couple cygwin with ConEmu. Tested on ConEmu 160714 with terminals.v0.7.4.7z https://github.com/Maximus5/cygwin-connector/releases Extract conemu-cyg-64.exe from terminals.v0.7.4.7z and copied on C:\cygwin64\bin Modify the Predefined task on Settings->Startup->Tasks from set CHERE_INVOKING=1 & C:\CygWin64\bin\bash.exe --login -i -new_console:...


1

Signals nor tty ownership cannot be 'magically' carried over a socket. Over AF_UNIX, you could send the tty file descriptor itself (using sendmsg and recvmsg) and have the receiving side use it (and not the socket) as the subprocess' stdout/stderr. This cannot be done with plain socat, but this method is used internally by e.g. the tmux tool. With plain ...


0

Doesn't answer the original question but likely works in most cases: store everything from the environment that looks important to a temporary file send the following commands to screen: change to directory, source the temporary file, remove the temporary file, start the program Code: rm some_env.$$ for e in $(env | grep "PATH\|WHATEVERISIMPORTANT"...


0

Seems to have fixed itself with a few reboots. Very strange.


3

Looks like scp on Mac does not follow symlinks, and your symlinked files are the ones causing the problem for you. Two of many possible options are: 0. Use -r option of scp (manpage says it follows symlinks). 1. Tarball the files into one package, and send this single file over scp. 2. Copy the folder (dereferencing symlinks) and scp this new folder. 0) ...


1

Take a look at the project Bashhub. It's effectively exactly what you are asking for - a dropbox for bash history - but they have added tools to reference the history from all your machines, assuming they have access to the internet. There are valid concerns about sending your shell interactions to a third party (e.g. employer, privacy, working on sensitive ...


1

I would think that you have lost the PATH command added by Anaconda. Add this to your .bash_profile export PATH="/Users/<username>/anaconda/bin:$PATH" (Replacing <username> with your username, of course.)


0

The only solution I was able to come up with is to modify the configuration header of st and change static int borderpx from default 2 to 0. It gets rid of the border on the right. It doesn't hide the border on the bottom however. If you found a better solution then please let me know.


0

It looks like there are 2 terminals available on the PocketC.H.I.P. out of the box: vala-terminal xfce4-terminal vala-terminal I've read the manual and it looks like this emulator doesn't provide an option to disable bars. xfce4-terminal I was able to disable the menu bar after tinkering with the ~/.config/xfce4/terminal/terminalrc file. I wasn't ...


1

First thing to point out is that you can do this via tmux completely independent of your shell. Add the following to your ~/.tmux.conf; for example: set-option -g set-titles on set-option -g set-titles-string "#S / #W" Also, you need to ensure iTerm2 is configured to let programs set the title via an escape sequence. See the "Terminal may set tab/window ...


0

The following script will do what you are asking as I understand it. It will run a sequence of gnuplot commands non-interactively and then continue the same gnuplot session from the command line. The comments in the script indicate where you should put the non-interactive commands. #!/bin/bash - # Cheap 'trick' to show gnuplot prompt # There are better ...


0

ssh in its normal interactive-session mode forwards all characters (except its escape, usually ~) to the remote host, including ^S ^Q. (Anything at the far end of a SSH/TCP/IP connection is 'remote' for this purpose, even localhost/loopback or virtual-LAN.) If you have a 'long' (propagation delay) and/or 'fat' (bandwidth) pipe -- and loopback is definitely ...


0

The vi command is running vim in compatible mode. Try disabling it by adding this to your .vimrc: set nocompatible or running this command: :set nocompatible More info: What is compatible mode in Vim?


0

As I am on a Mac and not using MacVim (but plain vim within a terminal) I have had some difficulty with key combinations not being sent through to the terminal. The most-compatible (and for me most comfortable) way to switch tabs quickly comes from the Vim Wikia site. Place in your .vimrc file: nnoremap H gT nnoremap L gt Now Shift-h (capital H) and ...


3

According to this source, the solution after installing npm is to run: source ~/.profile An equivalent but more portable command is: . ~/.profile More details There are various initialization scripts that the shell might use, such as, ~/.bashrc, ~/.bash_profile, and ~/.profile. There are also system wide files, stored under /etc, that are used for ...


0

I was able to regain root access via phpMyAdmin using the following command in the terminal killall -9 mysqld Followed by restarting the web service for this particular server. That seemed to fix the problem.


0

try brew cask uninstall [appname] --force


1

I use xssstate for such purposes. It's available in suckless-tools package in Debian or Ubuntu, or upstream. Then you can use the following shell script: #!/bin/sh if [ $# -lt 2 ]; then printf "usage: %s minutes command\n" "$(basename $0)" 2>&1 exit 1 fi timeout=$(($1*60*1000)) shift cmd="$@" triggered=false while true do tosleep=$(((...


-1

bsd ports (packages collection) has a program that can do this: http://man.openbsd.org/OpenBSD-current/man1/xidle.1 it's available e.g. here: http://distcache.freebsd.org/local-distfiles/novel/xidle-26052015.tar.bz2 build like: # apt-get install libxss-dev # for include/X11/extensions/scrnsaver.h # gcc -o /usr/local/bin/xidle xidle.c -lX11 -lXss note ...


-1

I wrote a node based clone of tree called tree-fiddy that honors gitignore settings. It's pretty alpha right now, but it's working fine on my machines.


1

Try Ctrl Insert to copy and Shift Insert paste. According to wikipedia this is in accordance with the IBM Common User Access (CUA) standard. It works in all the X11 terminals that I have tried it on (but it seems xterm for some reason adds 5~ while copying) and it also works in putty from Windows. I like it because I can use only my right hand (using right ...


1

Try using the keyboard combination: Ctrl + Shift + V


1

This should find the MAC for eth0. You may have to change that interface (eth0) to match your setup needs but it should work. DETECTED_MAC_ADDRESS=`ifconfig eth0 2>/dev/null|awk '/HWaddr/ {print $5}'`



Top 50 recent answers are included