All Questions
90
questions
0
votes
1
answer
551
views
BASH - combine .md files from subdirectories into a master .md
We have a growing list of subdirectories and we would like to summarize the content in each with a .txt or .md file. We would then like to consolidate those readmes into a single master readme. We ...
2
votes
0
answers
118
views
How to source from stdout for both Linux and macOS?
On Linux I can do:
source <(cat .env | grep ANDROID_GRADLE_TASK)
But on macOS, this doesn't do anything (no error, and no source)
What can I use for macOS?
Is there a command that works both on ...
0
votes
1
answer
712
views
"echo $VAR | base64 -di > file" fail to execute on MacOS
On Linux I can do:
echo ${ANDROID_KEYSTORE} | base64 -di > android/keystores/staging.keystore
But on MacOS, the same commands gives:
base64: option requires an argument -- i
Usage: base64 [-hvDd] ...
0
votes
2
answers
21k
views
How to use ls command to show all the files including hidden files, but not showing the files named '.' and '..'
The working directories contains several subdirectories, and each subdirectory contains some hidden files that start with ..
How could I use the ls command to display all the files including the ...
0
votes
1
answer
545
views
Two users (admin + non-admin) what is the right usage of su/sudo?
I have two users on a macos. U1 is a non-admin user and U2 is a admin user.
I cannot add U1 to the sudoers. Is there a way to use U2 to act as if it was U1 issuing sudo <command>?
My thinking:
...
1
vote
0
answers
1k
views
Is the macOS/Linux shell the same thing as Bash?
sorry if this is a silly question, but are there any differences between Bash and the macOS/Linux shell? (not all Linux distros use the Bash shell right?)
3
votes
1
answer
1k
views
Filter stdin of process executed with socat client
My question is: is there a way to pre-process the stdin of a command executed via socat client.
Context:
I am launching a reverse shell with socat using this command:
$> socat -T30 "openssl-...
0
votes
0
answers
172
views
Including chmod in shell script - will it work for everyone?
I have a large wrapper.sh file which does a lot of things, but in the end runs catalina.sh tomcat.
Problem is that users who run this wrapper.sh are experiencing error: no permissions to execute ...
0
votes
0
answers
313
views
Terminal opens with a command not found error
I checked the .bash_profile and .zprofile, but it is empty.
Also .bashrc or .zshrc do not exist in my home directory.
Terminal window
0
votes
0
answers
100
views
Unable to redirect `coproc` streams using FD 5 and 6, but not 3 and 4. Why?
On OSX, while attempting to expose a service implemented as a bash script, and started with coproc, to a client implemented as a bash script, by passing the IO streams of the service to the client, I ...
2
votes
1
answer
488
views
Sort files by date added not modified
I am trying to open the last application that was added to the /Applications directory on MacOS.
For now, in order to find the latest app and open it, I run:
open -a "$(ls -t1 /Applications/ | head -...
0
votes
1
answer
2k
views
What does this rm -r command do in following usecase on mac terminal?
First I'm directing to the destination folder by below command
cd /Users/myname/MyFolder/
Now I'm using below command here, what does this command will do?
rm -r ../build ../dist
rm command is for ...
3
votes
1
answer
3k
views
Is it dangerous to have /usr/local/bin ahead of /usr/bin in one's PATH?
I was reading a Stack Exchange answer here about a connected topic, and part of the accepted answer said this:
never place user-writeable PATH elements ahead of those that can only be modified by ...
0
votes
1
answer
176
views
Moving files to matching folders on linux command line
I would like to copy or move files in to matching folders.
these are my filenames:
1-filename-aa.txt
2-filename-aa.txt
3-filename-aa.txt
1-filename-bb.txt
2-filename-bb.txt
3-filename-bb.txt
these ...
0
votes
1
answer
209
views
Anaconda stopped working when added DYLD_LIBRARY_PATH to bashrc
I am using Anaconda Navigator version 1.9.7 on macOS Mojave 10.14.5.
I found that most anaconda-navigator, pip, ... commands stopped working when I added the following command to .bashrc.
export ...
3
votes
1
answer
20k
views
How does "echo $0" work?
I found out on Ask Ubuntu I can use this command to figure out what shell I am in.
echo $0
I like this because it is simple as compared to more complex solutions like this one on the Unix and Linux ...
1
vote
1
answer
1k
views
Can you run a Python program using Nice in Mac Terminal?
I'm trying to assign a high priority level to a Python program as soon as it runs using Terminal. I'm thinking of syntax along the lines of:
sudo nice -n -20 pythonfile.py
This returns the error: ...
1
vote
0
answers
270
views
Problems installing RCPLEX
I get an error while I try to install RCPLEX on my Computer and I can't figure out what to do. There is no information what so ever on the internet regarding my problem.
R Marcel$ R CMD INSTALL --...
0
votes
1
answer
530
views
Added an external folder to a project in PHPStorm on MacOS Mojave
I'm working in PHP Storm, on a project that's using a package I'm developing in tandem. I've had a couple of workflows for this, but I'd really like to add an external directory (the package source) ...
2
votes
3
answers
3k
views
Possible solutions for "-bash: ./bolt: cannot execute binary file"?
users,
I hope some of you have an idea on how I can fix the following issue.
What I am trying to do:
I am trying to install/use a software called BOLT-LMM from a *.tar.gz file downloaded here as ...
1
vote
3
answers
15k
views
How to display colour text in terminal?
I want to display colour text in terminal(bash shell). Tried with this approach:
echo -e "\e[1;31m This is red text \e[0m"
But it doesn't change the text colour to red.
1
vote
1
answer
356
views
Bash Script; process macOS disk number based on drive size... GREP
I'm looking to script a few CoreStorage commands on drives automatically. The problem is one of the drives is external, which means it can appear mounted on the system as anything from disk2 to disk4 ...
1
vote
2
answers
88
views
OSX - Find if phone is connected to the WIFI Network
I'm trying to programmatically find whether my phone is connected to the current Network, given that I know my device's mac Address.
Something like this SOMETIMES works:
arp -a | grep "11:11:11:11:...
1
vote
1
answer
199
views
Why can't I create a symlink to a directory at the same level as that directory?
I have a directory called Foo. I want a symlink to it, on the same level as it, called foo.
ln -s Foo foo creates a symlink in Foo pointing back to itself.
$ mkdir lntmp && cd lntmp
$ mkdir ...
0
votes
2
answers
1k
views
bash broken osx "[Process completed]"
I had an error in a script, which ran 'brew unlink bash'. I then started getting: Warning: bash already installed, it's just not linked
I tried
brew update && brew install bash
sudo bash -c ...
17
votes
3
answers
22k
views
How to force ls terminal command to show results in Bytes while I have set the default to ls -h in bash profile?
I am following the snippet here to improve my terminal command in Mac OSX.
It sets the default value of ls results to human-readable by exporting alias ls='ls -GFh' to bash profile file. This is very ...
1
vote
1
answer
6k
views
unix/linux chmod to let everyone read every directory and file
I'm having file permission trouble backing up my MacbookPro through my LAN to my Windows computer.
I want to set permissions of all files and directories on MacbookPro to allow reading by all. On the ...
1
vote
1
answer
226
views
Fortran Compiler Installation Instructions for OS X
I try install fortran compiler for Mac OSX El captain.
Firstly;
I install install_f2c_osx.csh
Run installation script
$ chmod +x install_f2c_osx.csh
$ sudo ./install_f2c_osx.csh
It gives this ...
-1
votes
1
answer
371
views
high priority for I/O operations
I came across this:
http://linux.die.net/man/1/ionice
however, it seems that it is not working on os x, as i got message that command not found.
is there any alternative to it or way to install ...
2
votes
1
answer
249
views
Working with different implementations of cp across different environments
So I figured GNU's cp is different than OSX's (BSD).
While OSX copies the contents of a directory that ends with a slash, or the directory itself without the slash, GNU/Linux just treats somedir and ...
0
votes
1
answer
773
views
Why does terminal repeat "//: is a directory" after I source .bash_profile?
Sergios-MBP:~ home$ nano ~/.bash_profile
Sergios-MBP:~ home$ source ~/.bash_profile
-bash: //: is a directory
-bash: //: is a directory
-bash: //: is a directory
-bash: //: is a directory
-bash: //: ...
1
vote
1
answer
4k
views
What does a question mark after the file name mean using ls terminal command?
What does a question mark after the file name mean using ls terminal command?
I am using a Mac running OS X Yosemite (v.10.10.5)
When I do ls command at terminal, I get back a list of files (the same ...
9
votes
3
answers
78k
views
How to run a bash script via absolute path?
I have a file:
/Users/danylo.volokh/test/test_bash_script.sh
Content is very simple:
#!/usr/bin/env bash
echo "-- print from script"
I'm in folder "danylo.volokh"
This command runs fine:
Danilos-...
0
votes
1
answer
1k
views
Alias command from terminal that opens a new terminal on a specific folder
I have this command already working in my .bash_profile:
alias mysite='cd /Applications/sites/mysite;pwd; php artisan serve --port=9000 | open http://localhost:9000 | open -a Finder ./'
So it:
CD's ...
0
votes
1
answer
1k
views
Needing to open OS X bash script as via launchd IN a terminal window
I've got a lengthy and complex bash script which works OK, but I'm trying to automate my deployment process and I'm flummoxed at this point.
I can get the script to run as a LaunchAgent no problem, ...
0
votes
1
answer
2k
views
Cant view my Applications directory contents because of Chrome
I'm try to reach the contents of a specific application via terminal but every time I cd into the Applications directory and the ls I get the following
Admin-MacBook-Pro:~ admin$ cd Applications
...
0
votes
3
answers
3k
views
Scroll through shell history based on command or stub/stem?
Please forgive my ignorance.... I have a history of commands in Bash on OS X and Linux. At times, I want to go back to an item based on the command. For example, suppose I previously entered:
make ...
2
votes
3
answers
2k
views
How can I execute a script on a remote machine over ssh but source local files
I have a local script I want to run on a remote machine without copying it to the machine so I'm using:
ssh user@remote < local-script.sh
This works but if I add a source statement in local-script....
0
votes
1
answer
158
views
To fix permissions for backups in reading
I see the following kind of folders in reading my backup disc with OSX, similarly forbidden in reading by Debian Linux 8.1.
The SSD of my Macbook broke two months ago so I have had recover some ...
-2
votes
1
answer
158
views
Trouble setting up the class path for MySQL and running MySQL via terminal
Question: what is the easiest way to run the MySQL app from the terminal
What I have tried:
Using some stackOverFlow suggestions I have used the following commands
echo $PATH, produces
/usr/local/...
2
votes
2
answers
3k
views
How to tell what are my startup files for sh or bash?
From this question I understand that depending on the operating system sh and bash behave differently.
Doing env and alias I can tell that:
Every time I open a OSX Terminal or run bash the variable $...
8
votes
3
answers
571
views
How to have a better view when typing out directories in terminal?
I am currently using a Mac and learning to use the terminal, but the question applies to Linux systems as well.
I would like to ask, when typing out paths in the terminal/command line, is there a way ...
4
votes
3
answers
478
views
Prevent fork bomb when using interactive commands (like script) in .bashrc
I've often wanted to log the output of Terminal. So I tried to set script to run at startup; in my .bashrc file I put:
script ~/Logs/$(date "+%Y-%m-%d.%H-%M-%S")
Because the commands in my .bashrc ...
1
vote
1
answer
224
views
Bash history deduplication causing dangerous multi-shell behaviour
I am using the following code in my .bash_profile to filter and de-duplicate my bash history:
shopt -s histappend
HISTSIZE=100000
HISTFILESIZE=100000
HISTCONTROL=ignoredups:erasedups
PROMPT_COMMAND="...
0
votes
2
answers
393
views
Why does sudo -n on Mac OS X always return 0?
It looks like sudo -n on Mac OS X (10.10.3) always returns 0 as a return code.
So something like this will always show 0, regardless of whether the user has authenticated with his password first:
...
1
vote
2
answers
5k
views
How can I delete the content between two tags in a large xml file (>2GB)
The File in Question is XML but I want a Shell Script to remove all the binary (Base64) encoded images that are embedded. The files are generally huge (>2GB).
I want to delete everything between:
&...
0
votes
1
answer
3k
views
zsh completion for all executables in path
I have written a script which itself takes as an argument any arbitrary executable in my $PATH. Is there a way to create a zsh (or bash) completion function such that I would be able to type myFunc ...
1
vote
1
answer
3k
views
Enumerating every other array element in loop
I have a dynamic array with key-pair values and I’d like to enumerate every other value. In this case, just the names in the array. Since I’m not using bash v4, I have been able to use seq to step ...
1
vote
1
answer
964
views
Terminal new window always shows -bash: Searching: command not found
When open terminal, it always shows -bash: Searching: command not found. It does not affect other functions, just each time, even though open a new terminal window, it still pops up at the top of the ...
12
votes
3
answers
33k
views
What is the difference between terminal and bash? [duplicate]
When I open Terminal Window in Mac OS X, I can type bash and hit enter and I will see:
Last login: Fri Feb 20 14:30:56 on ttys000
Korays-MacBook-Pro:~ koraytugay$ bash
bash-3.2$
I can for example ...