Bash is a free shell for Unix-like operating systems from the GNU Project.

learn more… | top users | synonyms

-1
votes
3answers
78 views

How to copy file in clipboard buffer when running ssh on linux?

For example I am Using Mac and ssh'ed to Linux server(Ubuntu, no X-session) and need to transfer SSL certificate from one server to another (also Linux console, Ubuntu, no X-session), how would I copy ...
-2
votes
1answer
247 views

Can I enable the new Ubuntu/bash in Windows without installing the Insider Preview?

Microsoft has announced that bash and Unbuntu will be coming to Windows. As far as I understand it I can wait for the Anniversary update this summer or install the Insider Preview of Windows 10 to be ...
0
votes
3answers
53 views

Shell script Copy file from one directory to another not working

Hi I am trying to automate the android build system through jenkins. Here I am trying to copy the image file from one directory to another directory but always getting " No such file or directory" ...
0
votes
2answers
40 views

What exaclty is <() in bash (and =() in zsh)?

I'm pretty confortable with bash, but recently I ended up in a substitution I didn't know. What exactly is <(<command>) in bash? How does it compare to the =(<command>) in zsh? I ...
0
votes
2answers
569 views

How to enable Bash in Windows 10?

Although it may seem to be duplicate to this question, the fact is, that Microsoft recently announced that bash will be running directly from windows Obviously I am preferring that solution before ...
0
votes
3answers
42 views

Bash/Shell: Get the list of newest files by ctime in directory, sort and retrieve only 3 for each of them

I have following files in a directory: trunk_rev.94564.zip trunk_rev.94565.zip trunk_rev.94566.zip trunk_rev.94567.zip trunk_rev.94568.zip trunk_rev.94569.zip v15_rev.94560.zip v15_rev.94561.zip ...
0
votes
1answer
22 views

Batch and Count inifite stdin

Assume you have some linux/shell command (i.e. nc) which outputs to the stdout some line-break separated strings. This commands never finishes with outputting (or outputs for a long time). I'm ...
0
votes
3answers
48 views

converting a simple sh script to the equivalent batch script on windows

This is the script that I need to convert to batch file in windows : #!/usr/bin/env sh TOOLS=./build/tools $TOOLS/caffe train \ --solver=examples/cifar10/cifar10_full_relu_solver_bn.prototxt ...
0
votes
1answer
24 views

Starting rsync command on every hour

im new in linux just want to asking you : How to add this command to start every hour on the computer : rsync -a --ignore-existing 130.68.124.219:/home/pi/Desktop/* /home/pi/test/ Thanks
2
votes
1answer
23 views

Search sub folders for symbolic links to a directory?

In /var/www and its subfolders I have symlinks to /var/src, spread around in various locations. How can I list all those links?
0
votes
2answers
36 views

SSH - Too many authentication failures

I understand why this is happening. My ssh-agent is sending multiple keys to the server, and only one of them is good. So it hits the max number of login attempts on the server and disables the login. ...
3
votes
2answers
50 views

Is there a way to keep already executed commands on some sort of cache in bash?

Is there another program or app than would let you keep a list of previously executed commands on a cache or something similar, so you can then press a key and acces or search on a list of previously ...
0
votes
3answers
23 views

Delete lines that are not n consecutive lines starting with the same id

I have a file that looks like this: 194104,41.8,38.3 194104,46.7,39.6 194104,47.4,39.7 194104,49.8,44.3 194104,50.8,47.5 194136,39.9,36.3 194136,45.2,37.8 194170,46.9,42.2 ... I want to keep the ...
1
vote
1answer
22 views

Find only unique named files recursively

I'm having a problem finding only unique named files over directories and subdirectories. Files must be unique by their name, not md5 sum or content. I've managed to get list of unique files, but ...
0
votes
0answers
12 views

How do I make cut/kill from iTerm2 go to the system clipboard (Mac)?

This is not inside emacs or vim or anything just at the commandline. If I Cmd-k the current commandline I'd like it to go to the system clipboard. Is that possible?
0
votes
1answer
13 views

Using an array as search criterea for find command

I'm wondering if it's possible to declare an array of file types to then be searched with via the find command? So fileTypes=(*.omf *.jpeg *.xml *.otf) find . -name ${fileTypes} Instead of: find ...
0
votes
1answer
9 views

How to run Octave scripts from bash?

pavel@pavel-VirtualBox:~/projects/csv_converted$ sh plot.sh plot.sh: 2: plot.sh: Syntax error: "(" unexpected pavel@pavel-VirtualBox:~/projects/csv_converted$ ./plot.sh 'usr/bin/octave-cli: ...
0
votes
0answers
12 views

Current Working Directory at the Top of the Terminal (Not in Tab Title)

Is it possible to do this in bash or do I need to use something like screen? This is on Mac OSX running bash inside of the terminal. I'm looking for a line that just sits on top of everything and is ...
1
vote
1answer
59 views

How do I remove the current directory (“.”) from my PATH?

I recently updated OSX to El Capitan, and in the process of running through the steps needed to update my development environment, I discovered something rather disturbing: bash is behaving as if . is ...
-1
votes
1answer
41 views

Moving pdf with string it and print ok or not found in every file search

I'm using the following command with pdf to search for specific strings inside several pdfs, and move for a target directory, if there is a match: pdfgrep -H "DESIRE STRING" TARGET/* | grep ...
-1
votes
1answer
55 views

File does NOT exist but ls shows “No such file or directory” error

File system ext4 // which ls -> /bin/ls // Bash -> 3.2.57(2)-release // whoami -> admin If I run ls then I firstly get a list of files with error "No such file or directory" and ...
0
votes
0answers
44 views

Ubuntu Server on Hyper-V - How to get the ip address of the host?

I'm running ubuntu server 15.10 in Hyper-V on a Win10 Host. I use autofs on ubuntu to automatically mount a network share during boot. Everything is working as expected - As long as the ip address of ...
2
votes
0answers
25 views

Cannot import colour presets into iTerm 2

Long time user of the standard terminal, short term user of iTerm 2. I've found a colour preset I want to use, however after importing them when I select them from Preferences > profiles > load ...
1
vote
1answer
23 views

Execute multiple commands over ssh without reconnecting

I'd like to execute multiple commands through ssh from the script on my local machine, but without the need to reconnect for each command. Normally, I'd go with something like: $ ssh [user]@[server] ...
7
votes
6answers
330 views

/usr/bin/env: php: No such file or directory

I want to use .sh script for deployment of my app. That script is on my home server (Ubuntu 15.10 Server), marked as executable. Access to this script is done through ssh, using this tutorial, I have ...
3
votes
2answers
471 views

Using sed within a vi buffer

In a long text file listing dups-23Mar16.listing I want to delete lines beginning, for example, with .local. Here are some lines in this file: ...
2
votes
1answer
57 views

Why did my root change to -bash-4.1?

My root@servername automatically changed to -bash-4.1@servername in one of the servers. I have the same .bashrc on both servers. Also when I do echo $PS1 I get the following, and it's the same on ...
2
votes
1answer
30 views

How to avoid terminal to scroll down to last message in bash?

I write a bash script that run some other commands in new terminal: #!/bin/bash # Sample script gnome-terminal --title="blah blah" -x bash -c ffmpeg -i udp://239.1.2.1:60001?fifo_size=50000000 ...
0
votes
0answers
69 views

In Debian XFCE 4.10, how do I change the default Terminal shell from dash to bash?

I have a Debian-based Linux system (Kali Linux) running on AWS with the XFCE desktop environment. When I click on the "Terminal" icon in the application selector at the bottom of the screen, the ...
0
votes
0answers
13 views

Automatic documentation of dotfiles/config files configuration options

Has there been any work done on the front of automatic config file documentation? For example it is a good practice to add a comment line above/next to your config option, such as (source links at ...
0
votes
1answer
29 views

Ctrl-enter for fish shell

I had tried to create some accept completion and execute right away combination in fish on pressing Ctrl+Enter. function fish_user_key_bindings bind \c\n accept-autosuggestion execute end ...
-1
votes
1answer
46 views

Search for string inside pdf with pdfgrep and outputs only file name

I'm using pdfgrep to search for a name inside a pdf: pdfgrep -H 'Fatima Alves' RE/* This commands will output the file name and the name: RE/2011-01-RE_60822079000168_23022016_153923(1).PDF: ...
1
vote
1answer
31 views

Rename files with counter over subdirectories

I have a parent directory with a number of directories in it. Within those I, again, have multiple subdirectories, they contain many images: Parent | ├──dirA | ├──sub_A1 | | ...
1
vote
1answer
28 views

How can I control my minecraft server when I run it at boot with a rc.local script?

I have a question your you guys. I'm running a MC server so far so great. In order to make it autonomous I run it at boot with a bash script load in rc.local, simple. #!/bin/bash cd /home/minecraft ...
2
votes
3answers
30 views

Using a wildcard in a condition to match the beginning of a string

Trying to have a variable meet a string of text that varies by length. The part of the string that matters is the first couple of characters. var1=hello if [ $var1 == hello ]; then echo ...
1
vote
2answers
14 views

If Statement not evaluating as expected. Am I setting up my variables incorrectly?

I am trying to create a command that will allow me to check websites for specific words. I used \ at the end of the line to wrap it to the next, (not sure if I used those correctly here) these ...
1
vote
1answer
24 views

How to use the “sed” command to remove all lines that do not end up on the pattern?

How to use the "sed" command to remove all lines that do not end up on the pattern? Example (.txt - pattern) aaa aaa.com b b b b.txt ccc ccc.gif dd dd dd.txt I want to get: b b b b.txt dd dd ...
-1
votes
1answer
41 views

How can you pass output of find command to a diff command with multiple files?

I find 5 files ending with .csv. Now I want to compare the content of these files using diff command. How can I perform both actions in one command on a Linux terminal on bash? I want to do something ...
2
votes
2answers
380 views

Zip all uncompressed file in a folder in one line

I have a lot of text files that I want to compress. Each file must be compressed separately. But some of them are already compressed. How do I, in one line, compress all files that end with .txt by ...
0
votes
1answer
22 views

Downloading multiple files in parallel with changed names

I'm writing bash script and don’t know how to solve my problem. I want to to download multiple files at the same time , but ... I want to save the files under modified names. I have a variable ...
1
vote
1answer
34 views

Replace multiple files recursively

I have a file structure like this: experiment/ ├── foo.txt ├── source-foo.txt └── subdir └── foo.txt I want to take the file source-foo.txt and replace the other foos with it. Just like doing ...
1
vote
1answer
16 views

Check hash and then do a certain function

I am trying to check a hash (doesn't matter which), and if a certain hash is met, then run certain commands. Currently my code is if [[ md5sum $file -ne $sum ]] then $commands fi However, ...
0
votes
1answer
363 views

Shell provision script not creating .bash_aliases

I'm using Vagrant with VirtualBox to create an Ubuntu guest VM, on a Windows 10 host. Here's my Vagrantfile: # vi: set ft=ruby : Vagrant.configure(2) do |config| config.vm.box = "ubuntu/trusty64" ...
0
votes
2answers
12 views

How can I expand both a variable name and a wildcard in a file name?

I have a bash script where $DIR is a directory name that may contain spaces. This: rm "$DIR/*.MOV" gives the error "No such file or directory". There is no file literally named "*.MOV"; I want the ...
0
votes
2answers
56 views

How to POST file contents using cURL?

I want to do an HTTP POST of the contents (as a string) of a local file located at path/to/my-file.txt to a URL endpoint at http://example.com/. For example, I might want to do the following: ...
1
vote
1answer
120 views

Cannot move ./test to a subdirectory of itself, './test/test'

When trying to convert some files to lower case I noticed something which seems strange to me. When executing this in bash: find . -iname 'test' | while IFS='\n' read item; do mv $item $(echo $item ...
0
votes
2answers
45 views

script to ssh multiple servers with different password

I have a script that executes same commands on multiple servers via ssh . spawn ssh [lindex $argv 0] send "sudo /usr/sbin/useradd ytkatchen" expect "password:" send "Unix\@999\r" My password is not ...
0
votes
1answer
35 views

Unable to install rpm in a particular path (cpio: mkdir failed - No such file or directory)

My .rpm files like this.. $> rpm2cpio bq1510-15.10.01.06-1.i386.rpm | cpio -it ./opt ./opt/td ./opt/td/client ./opt/td/client/15.10 ./opt/td/client/15.10/bin ./opt/td/client/15.10/bin/bq ...
-2
votes
3answers
281 views

How can I write a bash function that checks if an integer is even or not?

How can I write a shell predicate function event that takes an integer argument and tests if it's even or not?
0
votes
1answer
31 views

Using windows Git Bash in MobaXterm

I have custom macros etc in my mobaxterm, but I have worked for a half a year on a remote linux machines, now I have my code on my local PC and I use git bash. Can I use it through MobaXterm?