FAQ Database Discussion Community


How to change terminal background to photo in OS X

osx,terminal,background-image,osascript
In order to help differentiate between terminal windows from a 30k foot view, I'd like to have different background pics for my terminal windows. Every time a terminal window opens, I'd like to set the background to a random pic from a certain folder. I know you can change the...

How can I run the Jenkins jobs through terminal?

jenkins,terminal
I heard an version that webhooks could be used for this. Please help)

cd command stopped working when not in su mode in terminal [closed]

linux,bash,terminal
I am using Scientific Linux 6 with bash shell. When I am trying to change to any directory when not in su mode it fails to do it. There are no error messages printed out. I am trying to change directory in my home folder where all documents are registered...

Compiling C++ code from vim

c++,linux,vim,terminal
My .vimrc file looks like that: set exrc set secure set number set tabstop=2 set shiftwidth=2 set expandtab set autoindent set background=dark set vb t_vb= set colorcolumn=110 highlight Pmenu ctermfg=2 ctermbg=0 guifg=#ffffff guibg=#0000ff highlight ColorColumn ctermbg=darkgray autocmd CompleteDone * pclose compiler g++ But, when I am opening some C++ files,...

Is there a way to save a mac terminal output directly to a file?

excel,osx,terminal
I am carrying out a research project for which I need to do quite a lot of calculations. I basically calculated a lot of features for structures present in a .sdf file. I automated the entire process and carried it out in the terminal of my mac. The thing is,...

How to get CPU utilization in % in terminal (mac)

osx,terminal,cpu
Ive seen the same question asked on linux and windows but not mac (terminal). Can anyone tell me how to get the current processor utilization in %, so an example output would be 40%. Thanks

Replace multiline string in all files in terminal

regex,perl,terminal
I have a couple of files in a directory, in which I have a piece of text between two separators. Text to keep //###==### Text to remove //###==### Text to keep After an extensive search, I found the following Mac OS X Terminal command, with which I can remove the...

how to get multiple column layout for terminal on mac?

osx,terminal
I consistently have 3 tabs open in terminal and have to switch between all three tabs all the time. I would like to have all them show tabs split vertically? like below what i want to achieve is to show each tab at the same time. Is that possible? like...

rake db:seed yields syntax error, unexpected '\n', expecting => [closed]

ruby-on-rails,ruby,terminal,syntax-error,rake
When I enter rake db:seed in terminal, I receive: SyntaxError: /Users/-/src/-/db/seeds.rb:17: syntax error, unexpected '\n', expecting => Tasks: TOP => db:seed ...where db/seeds.rb has: Category.create(kind: 'Food/Drink') #line 9, everything above is commented out Category.create(kind: 'Entertainment') Category.create(kind: 'Organization') Category.create(kind: 'Business') Category.create(kind: 'Collegiate') Location.create(area: 'Downtown NB') Location.create(area: 'College Ave', Location.create(area: 'Cook/Douglass') #line...

code . shortcut fails on OSX

osx,terminal,vscode
I've tried adding the 'code .' shortcut to launch your current directory in Terminal in Visual Studio Code, but I was promptly returned the following error: LSGetApplicationForInfo() failed with error -10814 while trying to determine the application with bundle identifier com.microsoft.VSCode. Visual Studio Code is installed on my machine successfully....

How do I get mdfind to include folder matches in addition to files?

osx,bash,terminal
In terminal I am using mdfind 'kMDItemFSLabel = 6' to find everything with a Red file label on my Mac. However, it seems to be excluding folders with a red label. I'm trying to get it turn also return folders but I can't seem to even get any of these...

How do I force jquery terminal to remain the same size?

jquery,scroll,terminal,position,jquery-terminal
I am using Jquery terminal and it seems pretty cool. I've been looking around for several hours now, and I can't find a way to get the console to remain stationary when text is inputted. Instead, the console increases in size for every line of input that I enter. Does...

Macports switch PHP CLI version

php,bash,drupal,terminal,macports
I'm trying to switch my Terminal PHP version to 5.4 because I ran into some issues with Drush while updating my Drupal core. http://drupal.stackexchange.com/questions/112090/drush-command-errors The reason for these issues is my Terminal PHP version is different then my localhost. php -v in Terminal returns PHP 5.5.13 (cli) but my localhost...

Trouble running C++ through terminal in Ubuntu

c++,linux,ubuntu,gcc,terminal
Hello Stack Community, My lack of reputation didn't allow me to post the picture of my problem. SO here it is in words- I wrote the following code after using "gedit take_input.cpp". #include <iostream> int main() { cout<<"please enter your name (followed by 'enter')\n"; string file; cin >> file; cout<<"hello"...

Error installing Gulp

node.js,terminal,gulp,taskmanager
I am pretty new to using terminal and installing gulp, but I am running through a few errors. Errors keep popping up and I am not sure why. My goal for right now is to install gulp globally, but not sure if any old files are interfering. Maybe a clean...

How to list the contents of a subdirectory after finding the directory

linux,bash,terminal
This is a rather specific question, but essentially what I was wondering is if there is anyway to list the contents of a directory below the one that I search for. My case is that I have a parent directory with a ton of subdirectories that I want to search...

How to execute a mongo command in sh file?

mongodb,terminal
I have a file named db.sh in bin folder and when I try to execute this command $ sh bin/db.sh I receive bin/db.sh: line 2: mongod: command not found in console what is wrong there? #!/bin/sh mongod --dbpath db --rest --jsonp; ...

Set PATH when launching a new terminal from a script in Mac

osx,bash,command-line,terminal
I need to launch a new terminal window from a script and set an environment variable in this new terminal so I can run a few commands there. This is what I have so far: #!bin/bash PATH=$PATH:$1 open -a Terminal /my/path/ Notice $1 is a value I'm sending when running...

“nvm” command not recognized in new command line windows/tabs despite presence of “NVM_DIR” variable in both ~/.bashrc and ~/.bash_profile

node.js,osx,unix,terminal,nvm
My colleague recently installed Node Version Manager on his Macbook using Homebrew, and ran the two commands suggested at the end of the install script: export NVM_DIR=~/.nvm source $(brew --prefix nvm)/nvm.sh Everything works fine in the terminal window in which the install took place, but if he opens up a...

Generate a Salted Hash in Terminal

hash,terminal,applescript,osx-mavericks
I want to make an AppleScript that generates a salted hash with Terminal. Is there a specific Terminal command that can generate a salted hash, preferably a secure one like SHA-512? If possible, I would like one that's a one-liner so I can use it with the do shell script...

Python command line arguments linux

python,linux,command-line,terminal,arguments
I have this little program(I know there is a lot of errors): #!/usr/bin/python import os.path import sys filearg = sys.argv[0] if (filearg == ""): filearg = input("") else: if (os.path.isfile(filearg)): print "File exist" else: print"No file" print filearg print "wasn't found" If i start it by typing python file.py testfile.txt...

How to enable branch hints in Mac OS git?

osx,git,terminal
In windows, when I use git bash, and for example want to to checkout to some branch, hitting tab shows me all the branches, or fills the branch name if I have written part of it. In my Mac OS, when I use git from my terminal, these features are...

Mac Terminal Auto Complete

osx,terminal
I have been looking for a while for a patch for this. Usually on a Unix/Linux terminal when you press tab it will auto-complete until there are several options and then it will list the options below for you to select. For example: cd he helpFolder/ helpMe/ heIsThere/ cd help...

Bash program/wrapper that allows you to edit with arrow/delete keys

linux,osx,bash,terminal
I am looking for the name of the bash program that "wraps" other commands which take input are interactive, and makes it possible for you to edit the input with arrow keys and the delete key. For instance, if you run aws configure, you are prompted for your access keys....

How to get all the output in terminal

linux,ubuntu,terminal,output,execute
I execute a program in terminal the problem is that there are a lot of numeric results and the terminal juste gave me the last results. First results were hid automatically. I search a solution to display all the results. This is the top of the terminal and i cannot...

“which nvm” command (nvm installed via homebrew) doesn't return path

terminal,homebrew,nvm
I have installed nvm via homebrew. I have followed through the caveats: mkdir ~/.nvm cp $(brew --prefix nvm)/nvm-exec ~/.nvm/ AddED to my .zshrc file: export NVM_DIR=~/.nvm source $(brew --prefix nvm)/nvm.sh I have restarted my shell and when I type "which nvm" I get the file output instead of a file...

How should I add a stationary progress bar to a C++ program that produces terminal output (in Linux)?

c++,linux,terminal,progress-bar
I have an existing program that contains a loop over files. It does various things, providing lots of terminal output. I want to have an overall progress bar that remains stationary on the same line at the bottom of the terminal while all of the output from the file operations...

Running a jar file from terminal in ubuntu

java,ubuntu,jar,terminal
I have a jar file , which when i execute by java -jar firstjar.jar I get the following errors Error: Invalid or corrupt jarfile firstjar.jar Here is my manifest file Manifest-Version: 1.0 Created-By: 1.7.0_79 (Oracle Corporation) Class-Path:mysql-connector-java-5.1.28.jar Main-Class:JavaApplication1 Contents of jar file 0 Wed May 13 14:09:06 IST 2015 META-INF/...

Runtime.getRuntime().exec() doesn't execute some commands

java,linux,terminal
I'm beginner at java and have some problems. I've read several topics about this theme but none of them worked for me. Here is my code: try { Console console = System.console(); String command; while(true) { command = console.readLine("Enter input:"); Process proc = Runtime.getRuntime().exec(command); // Read the output BufferedReader reader...

How to copy files and add prefix at the same time?

osx,bash,terminal,command
I am not familiar with osx terminal command. I have a java project containing many package. Some classes have same name in different package. I need to copy all of the class files into a directory, so I need to add corresponding package prefix on each files. For example, I...

when install cocoapods get Error?

terminal,cocoapods
I try and gem install cocoapods I get an error : ERROR: While executing gem ... (Gem::FilePermissionError) You don't have write permissions for the /Library/Ruby/Gems/2.0.0 directory. what does it mean???...

Why I'm getting different java versions

java,terminal,java-8
I just upgraded my Java from 1.8 update 31 to update 45. Once done, I checked in the Java Console it shows Java 8 update 45. But, when I checked in the terminal it shows java version "1.8.0_31". I checked using Verify Java Version, and it show You have the...

Executing a Linux command in Terminal from Java

java,eclipse,ubuntu,terminal,virtuoso
I am currently using a command called "curl" from Terminal in Ubuntu, tu upload my .RDF files to a Virtuoso RDF Store. curl -T FILE URL -u USER:PASSWORD I want to automatize these process, so that I create a Java function in eclipse. This code is not working. String[] command...

Why is it slower to print directly to console/terminal than redirecting?

linux,io,terminal
Why does it take significantly more time to print multiple lines to the terminal rather than redirecting it to a file which seems to be almost instant ?

How do I find out exact characters in a text input or file?

bash,terminal
I would like to find out which exact characters are in a text file. I have copied and pasted a bit of code from Stackoverflow and the seemingly perfect code caused a syntax error. When I wrote the exact same thing myself, it worked. Then I ran both snippets through...

Receiving an error upon heroku login not sure why permission seems to be the issue

git,heroku,terminal
I keep getting this error but if I do sudo heroku login it works... How do I fix this, I even tried to do ssh generate but it works with sudo only too... The-MacBook-Pro:prod lior$ heroku login ! Error reading /Users/lior/.netrc ! Permission denied - /Users/lior/.netrc ! You may need...

Whats wrong with my Mongo query?

mongodb,terminal,vi,hybrid-mobile-app,.bash-profile
I've recently set a path in my vi .bash_profile to my mongo commands. I know this works because it was working yesterday. However when I do it now I get this error: AMAC02MX3APF8J3:~ james.flan$ mongo MongoDB shell version: 3.0.3 connecting to: test 2015-05-19T11:34:58.708+0100 W NETWORK Failed to connect to 127.0.0.1:27017,...

How can I run a command line command from within a ruby file?

ruby,file,terminal,command
I have a gem installed that displays a ascii image of a train moving across the terminal screen when someone types "ls". I also have a file called runner.rb. If it's possible, how can I input the "ls" command to the terminal from within the ruby file?...

C++: Re-use line printed to console [duplicate]

c++,terminal,console,formatting,output
This question already has an answer here: How to rollback lines from cout? 3 answers Edit: Thanks to user mah's comment, I found what I was looking for. I want to rollback the line, see this question. I always print information to the console using std::cout and std::endl, but...

Which Linux command determines if message queues or shared memory are in use?

c,linux,terminal
I would like to know if there is a Linux command to use in the terminal to know if a message queue or shared memory are open.

Unable to install jade in a node.js project

node.js,osx,terminal,jade
I am trying a sample node.js based project by referring this tutorial: How To Write A Simple Node.js/MongoDB Web Service for an iOS App. I have configured my package.json like this: { "name": "mango-server", "version": "0.0.1", "private": true, "dependencies": { "express": "*", "jade": "*" } } Problem is - when...

nano: Move forwards/backwards one word with META+Left / META+Right

unix,terminal,nano
One can move forwards / backwards one word using Ctrl+Space and Meta+Space respectively. How can I bind META+Left arrow to move backwards one word / META+Right to move forwards one word? Thx for helping....

How do I edit $PATH (.bash_profile) on OSX?

osx,path,terminal,osx-yosemite
Hello I am trying to edit a entry to PATH, as i added something wrong. I am using OSX 10.10.3 I have tried touch ~/.bash_profile; open ~/.bash_profile Bu the file editor open, with nothing inside. What it is: I am trying to Install ANDROID_HOME to my PATH I miss typed...

CLion cout opens command prompt window instead of using CLion's terminal

c++,terminal,command-prompt,cout,clion
When I do cout << "test" in clion and then build it instead of writing it to IDE's terminal like IntelliJ, PHPStorm or any other of the Idea IDEs it opens a new command prompt window, writes it to that and them immediately closes the command prompt window so I...

Python modules not found over terminal but on python shell, Linux

python,linux,ubuntu,terminal
I have installed ubuntu on my laptop and i have installed python, after installing python2.7.5 i was trying to run a python script on terminal, but it said module no found, i started to download all the modules but it still said module not found. After upgrading to python2.7.9 it...

Is there a way to go two directories back in cygwin (linux)?

terminal,cygwin,cd
I know that you can go back one directory in cygwin by using the dash (-). But, how do you go back more than one directory in your history? I've tried cd -- it doesn't seem to work. Thanks! This would be very very helpful. ...

Terminal says 'No such file or directory' when open

osx,git,bash,terminal
In the last couple of days my terminal has been saying -bash: /usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/git/bin: No such file or directory However, all of the above do exist. I was playing around with $PATH variable last week but the error I am now getting appeared days after I stopped playing with the $PATH...

How do I open file list outputted from find command?

osx,bash,terminal
I have a working find query find . -type f | gshuf -n2 which returns two lines of files. I know I can open files in text edit through open -a TextEdit ./text.txt but how would I put these together so Textedit opens them after finding instead of me manually...

Error when trying to run carthage

ios,swift,terminal,carthage
I tried to setup my dependencies for a new iOS project. I wanted to use carthage for that. I setup a Cartfile in the root directory of my project github "Alamofire/Alamofire" >= 1.2 github "SwiftyJSON/SwiftyJSON" >= 2.2 and then ran carthage update, getting this error: dyld: Symbol not found: __TMdVSs9Character...

How to get Mouse support for dtterm terminal in solaris

terminal,solaris,gnu-screen
When i run vim inside screen, with TERM set to dtterm, there is no mouse support. How do i enable mouse support for dtterm TERMINAL. Running TERM with xtermc is not feasible as this garbles the background color in vim when running inside screen....

Trim audio file and get the part between silence

linux,audio,terminal,speech,sox
My goal is to get the parts of audio file that contains non-noise sounds by using SoX. I have read the effects of SoX and found noisered and silence which I consider helpful. The problem is that I have not found command that can trim the audio file based on...

How to make a scrolling menu in python-curses

python,terminal,curses,python-curses
There is a way to make a scrolling menu in python-curses? I have a list of records that I got from a query in sqlite3 and I have to show them in a box but they are more than the max number of rows: can I make a little menu...

How to check whether std::cout support colors?

c++,terminal
I am aware that you can output colors using special escape sequences, if the terminal supports this. For details I refer to this question. However, I understand that there are some terminals that do not support color codes/those escape sequences. How do I determine programatically in my C++ programm whether...

When to use quotes in command line? cp versus find

command-line,terminal,quotes,double-quotes,cp
I'm wondering if there is some pattern or trick to remember when or when not to use quotes in command line arguments. e.g. what is the difference between: find -type f -name "*<extension-with-quotes>" and cp <extension-without-quotes> ../<new-folder> One needs quotes and one does not, else it gives an error. Why?...

C passing terminal commands and print answer

c,variables,terminal
I am trying to execute a command in terminal and analyze the result, but i can´t get the output written in the variable. I have made an example code that shows my problem: extern char commandResult; int main() { char commandResult; commandResult = system("[ -f /etc/hosts ] && echo "Found"...

Issue with Mac OSX Terminal, shows special character codes like space, brakets

osx,utf-8,terminal
I have recently used "localedef" command to add support for the multiple locales. After doing that I noticed on my terminal for every "space, backslash, forward slash etc" it is showing UTF code like <0200> <002d> etc. I really want to disable this behaviour as it is really difficult to...

hGetLine from /dev/pty/N?

haskell,terminal,filehandle,pty
I'm trying to read from a pseudoterminal. My eventual goal is to hook up input/output from the pseudoterminal to reactive-banana events, but right now I'm just trying to from the pseudoterminal in Haskell code and write to it in the shell. I have the following code in Main.hs: import System.Posix.Terminal...

Shorten Error Message in Terminal

ruby-on-rails,ruby,error-handling,terminal
Rails error messages in terminal are too long and contain often useless information. Is there a gem/solution to shorten rails error messages? Example: 2.2.2 :012 > puts 1.red What I currently get: NoMethodError: undefined method `red' for 1:Fixnum from (irb):12 from /Users/Ben/.rvm/gems/[email protected]/gems/railties- 4.2.1/lib/rails/commands/console.rb:110:in `start' from /Users/Ben/.rvm/gems/[email protected]obal/gems/railties-4.2.1/lib/rails/commands/console.rb:9:in `start' from...

Extract string with grouping in regular expression on terminal

regex,linux,bash,terminal
I have a text file that conatins some HTML information like this: <li><a href="https://www.youtube.com/watch?v=YDubYJsZ9iM&amp;list=PL5-da3qGB5IBC-MneTc9oBZz0C6kNJ-f2">Lab: K-means Clustering</a> (6:31)</li> <li><a href="https://www.youtube.com/watch?v=4u3zvtfqb7w&amp;list=PL5-da3qGB5IBC-MneTc9oBZz0C6kNJ-f2">Lab: Hierarchical Clustering</a> (6:33)</li> <li><a...

having trouble with piping multiple times

bash,terminal
So, this program writes some stuff to a file and some stuff to the terminal ./program input.txt > output.txt In addition to what it dumps to output.txt, it prints out some stuff to the screan. I tried to direct what it prints in the terminal but I failed: ./program input.txt...

Find each word in audio files

linux,terminal,speech,sox,audacity
I have watches a way of doing this with audacity by using sound finder option. But since audacity is only gui it cannot be used with terminal commands. So is there a program that does the same work but in command interface like sox for example.

How to print combined words on terminal?

printing,terminal,zsh
From PHOTO(By on my zsh): I wonder how to print combined word on terminal? it looks so cool. Is there any tool to do this. Anyone knows? THX ...

Error in reading Ubuntu 14.04 mouse event file (/dev/input/event3) with java programmig

java,events,ubuntu,terminal,mouse
I want to handle mouse event in Linux terminal via java programming. I wrote two program via c++ and java that they do same process. when i use c++ programming to open and read file ("/dev/input/event3"-mouse event file), there is no problem while running executable file. (Ubuntu 14.04 terminal and...

How to run multiple brew commands with one line

osx,bash,shell,terminal,homebrew
I often run the following commands, one after another. I wonder if it can be done with one line? brew update brew upgrade brew cleanup ...

provide custom terminal session to incoming ssh connections in c++

c++,unix,ssh,terminal
We have a server that run with certain functionality. We want to enable some users with ssh authentication so that if an ssh session is initiated by the clients on certain port to the server, the sever will provide a custom terminal which supports only very few commands we have...

reverse every other line in a file, write to a new file in unix [closed]

python,perl,unix,awk,terminal
Say I have a file, wassup.txt The lines of which read: wassup donut skateboard ? teeth. ! I'd like to reverse the characters of every other line, starting with the second line, and then save as a new file pussaw.txt, the lines of which would read: wassup tunod skateboard !...

“Error: Could not find or load main class” JavaFX Terminal

java,ubuntu,javafx,terminal,javafx-8
I'm using the following class from my JavaFX Tutorial: import javafx.application.Application; import javafx.stage.Stage; public class HelloFXApp extends Application { public static void main(String[] args) { // Launch the JavaFX application Application.launch(args); } @Override public void start(Stage stage) { stage.setTitle("Hello JavaFX Application"); stage.show(); } } I'm using Ubuntu and I have...

Python (3.4) run SSH commands on local terminal [closed]

python,ssh,terminal
I'm writing a script that I'm running through a terminal, and would like it to run BASH commands in that same terminal. All solutions that I found were geared toward connecting remotely through SSH, whereas I just need to run SSH commands on the same machine. Can someone please point...

If/Else Statement's Shell Comparing more than 2 Values?

bash,shell,date,if-statement,terminal
Quick question regrading if/else statements in shell, Right now I am trying to test if two different values are equal to a third echo "CompareDateValues" if [ "${TodaysDate}" = "${prevDate}" & "${currDate}" ]; then echo "Dates Are A Match : TodaysDate:${TodaysDate} = savedStateRunDates:${prevDate}" else echo "Dates Are Not A Match...

How to find only the total RAM in Python

python,linux,shell,terminal,command
I am creating a bunch of Python functions for use in a later script and they find things like free RAM, Total RAM, and RAM in use. I want to only find the number, nothing else. Is there a Python module or something to find only these numbers? I have...

Terminal line resetting after about 50 characters

terminal
My command line prompt will reset after around 50 characters, including the prompt. For example, if the prompt looks like: [email protected]$ and I start to type [email protected]$ blah blah blah blah blah blah I'll eventually get to the point where the command line starts to reset like so: blah blmputer$...

Programmatically changing color scheme for Xcode through Terminal

xcode,shell,terminal
Is there any way to change the settings of Xcode programmatically through Terminal? i.e. color scheme, key binding, etc. I'm aware of Apple's Commandline Tools for Xcode for building, but there seems to be no command for altering the settings of the GUI. It doesn't have to be an official...

Capture a value outputted in terminal with php

php,terminal
I have this function: exec("sudo /root/modbus/writeForceReg 2 0"); located in a php script. When I execute the script in terminal, it returns either 1 or -1 in the terminal window. My question is how to capture and store these two values in a variable in the same php script?...

Eclipse CDT - No Console Output on OSX

c++,eclipse,osx,terminal,64bit
New to the C++ world and wanted to fiddle around using Eclipse's IDE for C/C++ called CDT. I am on OSX 10.10.2 using eclipse-cpp-luna-SR2-macosx-cocoa-x86_64. Sadly this simple example is not printing anything in the eclipse terminal. #include <iostream> using namespace std; int main() { cout << "Hello World" << endl;...

Do executable files always open a terminal window on MacOS?

osx,terminal,executable,app-bundle
I'm on MacOS X, and I'm pretty new to app-bundle-type things. I am writing a program that opens a window and registers mouse input -- not a command line tool. When I compile my code (written in C, if that is important) into an executable file (a "unix executable file")...

Why can't I access my vi folder?

mongodb,path,terminal,root,cd
I keep getting this error on my terminal which stops me accessing the vi folder. I've been trying to set a path to the MongoDB bin and when experimenting on how to do this, I think I've broken the folder. Can someone please help? Last login: Mon May 18 10:31:54...

Using a command-line utility to perform the following map-updates

shell,command-line,awk,terminal
I'm a complete newbie to using command-line utilities and am wondering how to process information as following: mapping.txt: 80 001 002 81 011 012 013 014 82 021 022 ... input.txt: 81 103823044 80 103823054 81 103823064 ... Desired output.txt: 103823044|011| 103823044|012| 103823044|013| 103823044|014| 103823054|001| 103823054|002| 103823064|011| 103823064|012| 103823064|013| 103823064|014|...

Excel vlookup-like command line function or tool?

osx,bash,replace,command-line,terminal
I have a source file that has 2M+ lines of text that look like this: 388708091|347|||||0010.60|N01/2012| 388708101|348|||||0011.60|N01/2012| 388708101|349|||||0012.60|N01/2012| 388719001|348|||||0010.38|M05/2013| 388719001|349|||||0011.38|M05/2013| I would like to map and replace the second column (which has values like 347,348,349,etc.) with a map that looks like below: 346 309 347 311 348 312 349 313...

Delay packets using Netem on Virtual Machine

ubuntu,networking,terminal,virtualbox
I'm trying to delay packets using Ubuntu on a virtual machine, but when I type in the terminal: tc qdisc add dev eth0 root netem delay 100ms I get: RTNETLINK answers: Operation not permitted. I'm working as an intern and I got assigned to a clock synchronization project on a...

loop through different arguments in Rscript within Korn shell

r,terminal,ksh
I have an R script which I'm running in the terminal by firstly generating a .ksh file called myscript.ksh with the following information: #!/bin/ksh Rscript myscript.R 'Input1' and then run the function with ./mycode.ksh which sends the script to a node on the cluster in our department (the processes that...

Gem installed but 'command not found'

ruby-on-rails,ruby,wordpress,terminal,rbenv
I've installed a Ruby gem called wordmove to work with pushing and pulling my Wordpress sites but when I run wordmove commands I get the error command not found. I've done some research and I haven't come up with much, I've come to the conclusion based on what I've seen...

How do i make a condition that will end the program, and prevent further cout statements?

c++,terminal
I'm currently making a text-based game just for kicks, which gives the user three options to choose from. One of the options allows the user to continue, while the others end the game with a "GAME OVER" text. I thought that making an endGame() function would do the trick, but...

Keep stdin line at top or bottom of terminal screen

python,terminal,curses
So I am writing a project where I run a program that constantly receives/sends messages to other computers running the same program. The receiver/sender of data is running on a thread and prints to stdout. I get stuff like this: [INFO] User 'blah' wants to send message to you. [INFO]...

Installing gphoto2 on mac os x Yosemite - issue with ./configure

xcode,osx,terminal,libgphoto2
I am trying to install gphoto2 on my macbook pro. I installed the tar.gz from their website and from terminal I cd Downloads and run ./configure as the README file recommends doing. I keep receiving this error: checking for pkg-config... false configure: error: *** Build requires pkg-config *** *** Possible...

Run python function from terminal

python,osx,bash,terminal
I have a nice python class and I need to instantiate the class, and then I need to run a specific function in that class. Basically, we are using a language like PHP to run shell commands. Here is my python class (lighting.py): #!/usr/bin/python from phue import Bridge from pprint...

Where can I read the ANSI terminal standard?

terminal,standards
I'd thinking about creating my own Terminal Emulation library, and I'd like to start by trying to get the latest standard for ANSI terminals. I know there are a lot resources out there, but I'd like to read the actual standard if I can. If the standard costs "a lot...

virtualenv does not get activated in new bash shell

linux,python-2.7,terminal,virtualenv
I activate python virtualenv in one bash and tries to use in another bash shell. virtualenv simply does not work. I opened a terminal, activate the virtualenv through sourcing activate file. It got activated in my terminal it shows () in front of terminal address. I opened a new terminal....

When was a file used by another program

osx,performance,terminal,stata
I have a file with a series of 750 csv files. I wrote a Stata that runs through each of these files and performs a single task. The files are quite big, and my program has been running for more than 12 hours. Is there is a way to know...

Script to get List of logged in users

linux,shell,scripting,terminal
I'm writing a Shell script to get a list of logged in users, i want to show a list like this one : The user AAA is on tty3 The user BBB is on pts/0 Here's what i've written so far : echo "The user " | who | awk...

(SOLVED) Not working scp command: Connection closed by remote host (Mac OS X)

osx,unix,terminal,scp
I'm working on a remote server through Mac terminal, since i updated it to OSX 10.10 (from 10.5) i started receiving this message every time i try to scp from server to my computer: ssh_exchange_identification: Connection closed by remote host lost connection If i perform scp backwards (copying from mac...

terminal command for running sublime text 3 from on ubuntu

linux,ubuntu,terminal
I've installed a new dev machine using Ubuntu 14.02. I have also installed all the relevant software. php/apache2/sublime/composer etc. I'd like to be able to open files with a sublime or subl command in the terminal, but can't seem to find the command to point things correctly. My sublime executable...

Terminal in mac weird user?

osx,unix,terminal,user,osx-yosemite
Whenever i login into terminal i get the following before my user: Last login: Wed May 13 12:52:32 on ttys000 stange-name:~ andy$ Where is jhps-gardens coming from?? I have no idea what it is, or where it is coming from. I know im not in that directory. And i haven't...

Patch scrolling back in suckless ST terminal to support mouse wheel

c,unix,terminal,x11
The ST terminal has a patch for scrolling back. I want to update said patch to enable mouse wheel up and down signals in additions to "PageUp" and "PageDown". I suspect that a small change in config.h is what is needed but I have no experience in terminal code thus...

xargs echo colored output

terminal,xargs
I have the following command: somethingRegex | xargs -I {} sh -c 'echo -e "found \e[34m{}\e[39m";dummy {}' The color part of the echo does not work, example output: -e found \e[34mresult\e[39m dummy output repeat A plain echo does work with {} being nice blue echo -e "found \e[34m{}\e[39m" How do...

remove the first 15 characters from every other line in a file

bash,unix,terminal,bioinformatics,qiime
I have some txt files that look like this (they contain DNA sequences and sample codes): >SRR1502445.1 GACTACACGTAGTATACGAGTGCGTTCCTGCGCTTATTGATATGCTTAAGTTCAGCGGGTAGTCTCACCCGATTTGAGGTCAAGGTTTGTGGGTCGAGTCACAACTCGAACATCGTCTTTGTACAAAGACGGTTGGAAGCGGGTTCCAAGGCAACACAGGGGGATAGGNNNNNNNNNNNNNNNNNNNNNNN >SRR1502445.2 GACTACACGTAGTATACGAGTGCGTTCCTGCGCTTATTGATATGCTTAAGTTCAGCGGGTAGTCTCACCCGATTTGAGGTCAAGGTTTGTGGGTCGAGTCACAACTCGAACATCGTCTTTGTACAAGACGGTTGGAAGCGGGTTCCAAGGCACACAGGGGATAGGNNN >SRR1502445.3...

Why is Unix/Terminal faster than R?

r,bash,shell,unix,terminal
I'm new to Unix, however, I have recently realized that very simple Unix commands can do very simple things to large data set very very quickly. My question is why are these Unix commands so fast relative to R? Let's begin by assuming that the data is big, but not...

How Do I make Date a Variable?

bash,shell,variables,if-statement,terminal
Right now i am trying to build a script that when run will get the date and store it as a variable so down the line it can be compared with another date value to see if they match My question is how do I do that and in what...

Using Yeoman aspnet generators (Updated)

asp.net,terminal,yeoman,yeoman-generator,yosemite
I am trying to develop ASP.NET applications using a macbook computer with the Yosemite operating system. I've retrieved the DNVM using Homebrew with the following commands: brew tap aspnet/dnx brew update brew install dnvm I've also setup the ASP.NET generator using the following commands: npm install -g yo generator-aspnet npm...

Iterate over specific files in a directory using Bash find

bash,command-line,terminal
Shellcheck doesn't like my for over find loop in Bash. for f in $(find $src -maxdepth 1 -name '*.md'); do wc -w < "$f" >> $path/tmp.txt; done It suggests instead: 1 while IFS= read -r -d '' file 2 do 3 let count++ 4 echo "Playing file no. $count" 5...

How to exit if statement in bash without exiting program?

bash,terminal
Let's say I have a script which is executable. It looks like this: if true then echo "started if statement" exit fi echo "hello" When I run this script, hello is not printed, because exit exits the entire shell. Is there a way to make exit (or some other statement)...