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

learn more… | top users | synonyms

1
vote
2answers
46 views

Subdirectories in prompt?

I'm working on making my prompt as useful as possible. Right now, it contains the date, time, and directory, along with a colored divider line so I can easily see where each batch of input starts. I ...
1
vote
1answer
544 views

ffmpeg - join / merge on top of each other

I'm trying to join together two videos on top of each other. I already did these two ffmpeg commands: ffmpeg -i 2_Out_of_Control.VOB -aspect 16:9 \ -vf ...
2
votes
2answers
354 views

Why did my bash prompt turn to gibberish after I accidentally ran `cat` on a .coverage file?

I had just installed coverage and run it a few times when I noticed a .coverage file hanging around in my repo, which is -- according to the file utility -- a 8086 relocatable (Microsoft) file. And ...
1
vote
4answers
2k views

Linux: Run command on a batch of files, with matching output files

A simple task: given a directory of files and a command that takes one file as input and produces one file as output, I want to process all the files in a directory at once and output them with ...
0
votes
2answers
139 views

What does the * mean next to a filename in the ouput of the command ll? [duplicate]

I have a doubt related the output of ll command. When, in my shell, I execute the ll command I obtain this output: -rwxrwxr-x 1 andrea andrea 104215 ott 15 15:56 atmosfs* Why I have the * next to ...
6
votes
4answers
2k views

How to check if cygwin mintty/bash is run as administrator?

Problem Statement: What is the most elegant and robust way to test if Cygwin mintty bash session is "Run as adminstrator"? Why, specifically? I have typically several mintty terminals open when using ...
1
vote
1answer
29 views

How to configure bash to prompt history?

With fish-shell, if I type a few words of a ran command, I will get a prompt of the whole command line. Then I just use Right Arrow key to complete the whole line. But on other things, fish-shell ...
0
votes
3answers
156 views

What is the terminal I use in OS X Terminal?

I go to OS X Terminal, sometime people just give me the command grep , ls, some people called it is shell script , some people call it unix shell. I also got a term bash shell, Bash command. So, I ...
0
votes
1answer
438 views

How can a bash script run several others scripts?

I try to make a bash script to run multiple scripts located in different directories. I tried to do something like #!/bin/bash path1="/path/to/folder1" path2="/path/to/folder2" ...
1
vote
1answer
121 views

Using the secondary IP in a bash script

I have a Primary IP set for all the system related tasks. Sometimes I have to use my system to carry out different tests and most of the time I have to deal with bash/shell scripts. I want the ...
1
vote
3answers
2k views

SSH session hangs when trying to open a shell

Since this morning I cannot login normally on my server using SSH anymore. Typically, when typing this: ssh foo@bar.org The shell hangs and does not acquire shell. The last line of verbose with ...
0
votes
2answers
275 views

create file in directory without x permission set on directory : How?

From this page, http://content.hccfl.edu/pollock/aunix1/filepermissions.htm, I understand that I need the +w bit set in a directory to create a new file and +x bit to cd into it/access its inode. So ...
1
vote
1answer
79 views

If you're using stdout-stdin already, could you somehow use a higher file descriptor?

Can the following be done without creating a temp.pem? openssl pkcs12 -passin pass:notasecret -in $DATASTORE_PRIVATE_KEY_FILE -nocerts -nodes -out temp.pem cat myfile | openssl sha -sha256 -sign ...
1
vote
3answers
67 views

String replacement in filenames in linux

I have a tonne of files called File30_i.txt for i=1, 2, 3, 4, 5... Is there an easy way to quickly rename then File20_i.txt for example?
1
vote
2answers
88 views

How to use 2x$$ together linux

the questing is how to use two variables togheter.. ex. $1,$2,$3 are set numb=2 I need to use command: head $$numb that must be the same as: head $2 I tried everything, I need to know what ...
0
votes
0answers
87 views

Installing jdk 1.7.0 java -version not working

I have installed java jdk, following the steps as described here but the problem is when i do which jav it gives me the output /usr/bin/java but when i do java -version it says bash: ...
1
vote
0answers
109 views

Ncat throws errors while being run from crontab

I have a simple script set up on my OpenWrt box to check if one of the computers in a local network is streaming, and if it does, the script starts wget | madplay to play the stream. Script works ...
3
votes
2answers
125 views

How do I store all command outputs and errors?

Hi there! I need to capture all command, stdout and stderr without any addition to the commands. I mean, that I have to save/store the output of these: $ echo 'test' $ ls -l $ cat some_file ...
0
votes
1answer
94 views

Why is OS X creating two bash processes per tab?

So when I have 3 tabs open, ps aux | grep bash reports: $ ps aux | grep bash root 629 0.0 0.0 2486024 4812 s002 Ss 8:01pm 0:00.02 login -pf moon /bin/bash moon 513 0.0 ...
0
votes
4answers
245 views

Changing multiple lines in to single line with spaces in linux

I have following data with multiple lines username: joe empid: 1111 status: resigned username: tom emid: 1234 username: kate empid: 2222 status: resigned What I want is to get the data in to ...
0
votes
1answer
27 views

Replacing values in a file using vi

I have a file which as multiple entries like "allowed_users 100", "allowed_hits 100", "allowed_users 10000". Want to replace the values of "allowed_users 100" to "allowed_users 1000". Best Wishes, ...
0
votes
0answers
53 views

Take back Ctrl-/ from Debian console configuration

My Debian Testing console is stealing my Ctrl-/ and using it as Backspace; Ctrl-/ is the single key-press Undo in bash and emacs. After some research, it looks like the Ctrl-/ -> Backspace mapping ...
14
votes
1answer
2k views

Why do we have login, non-login, interactive, and non-interactive bash shells?

So the bash man pages explain what login and interactive shells are: A login shell is one whose first character of argument zero is a -, or one started with the --login option. An ...
2
votes
1answer
63 views

Shell commands executed from Vim behave differently

I have mapped a key in Vim to run curl-based tests on my API with :map ,t :w\|:!quizzical tests.sh <CR>. The tests run as expected when I press the key; however, the tests which take longer to ...
1
vote
1answer
55 views

Filtering out incomplete log entries

I'm trying to get some garbage collection logs into Splunk. However, when java starts garbage collection, it starts the log entry, then when it's done it puts in the end of the entry. Splunk treats ...
7
votes
3answers
4k views

How to upload multiple files to FTP from linux server?

I have for example database backups in my linux server and I would like to write a script to upload it to remote FTP. I tried put command, but it can only transfer one file at a time. Then tried mput ...
1
vote
0answers
58 views

shell script for finding the unix noun phrase

one entry in the on database is: LPE-1*story#1/1 of pearl#1/2*historia de la perla*storia della perla* histoire de la perle* história da pérola*istoria perlei*TOPIC The fields are separated by ...
0
votes
3answers
267 views

Shell is interpreting IFS=$'\n' as IFS='n'

I am using a Bash shell on a Ubuntu 12.04 LTS server, and it seems that IFS=$'\n' is being treated as IFS='n'. Script in use: concat=$(echo -n "concat:" && find ...
2
votes
1answer
3k views

How do I run “yum -y update” from Bash Script?

When I try to run "yum -y update" from a Bash script it doesn't work. Here is what the script looks like. #!/usr/bin/ echo "--> Updating CentOS System" yum -y update I run the script with this ...
2
votes
1answer
94 views

Execute bash command if wireless network is deleted?

As part of a plist I'm writing for OS X, I need to execute the "say" command if a wireless network is successfully deleted using: networksetup -removepreferredwirelessnetwork If a network isn't ...
5
votes
3answers
6k views

BASH - merge directories when using mv

I just started using BASH, so I can move all contents of a directory to another. But the issue is, I was expecting it to merge the directories. I am using cron job to run this script. #!/bin/bash ...
1
vote
1answer
149 views

Recursively move files in sub-dirs to new sub-dirs of same name

I have a batch of files all ending with the same string, ie: *_ext.dat located in several sub-dirs along with several other files, in a given main dir. This is the structure: ...
6
votes
4answers
639 views

Why does checking whether a folder exists using -d on an empty string return true?

I was writing some scripts and wrote something like ARTIFACTS="/SOME/PATH" [ -d $ARTIFCATS ] && rm -rf $ARTIFACTS/* What happened is that out of stupidity I executed the second line without ...
2
votes
2answers
2k views

rm command: remove files with file names containing brackets

I am trying to remove all files in a Windows 7 directory with filenames containing brackets; ( and ): Using MinGW: rm *(*)* I get an error: sh: syntax error near unexpected token '(' I assume ...
3
votes
1answer
236 views

Combining multiple MP3 files from a specific day

Everyday I have about 10 different mp3 files created on my server. What I would like to do is setup a cronjob to run at night and combine the current days tracks into one mp3 track. I don't care so ...
0
votes
1answer
93 views

Terminal auto-complete with @ symbol?

I have multiple directories that include the @ symbol within the directory name. When I do the normal tab to auto-complete a directory name it chokes if there is an @ symbol included in the name; ...
2
votes
2answers
26k views

How to ssh with username AND password linux automatically from bash

Im trying to ssh with the Username AND password provided. Restrictions: 1. I DO NOT want to have to set up a public key for each of the servers I am trying to ssh into. 2. I DO NOT want to/have ...
0
votes
1answer
360 views

Debian ssh user TAB behaviour changed - how to revert it?

I have created new user with: useradd u passwd u When logged as u via PuTTy the TAB key behaviour is changed: autofill dir/filenames and commands not working the tab is placed instaed (4 spaces) ...
1
vote
2answers
64 views

How to save linux command?

I am using grep -r [^a-zA-Z0-9]myVariableName[^a-zA-Z0-9] -n JS_files/ as mygrep file grep -r [^a-zA-Z0-9]$1[^a-zA-Z0-9] -n JS_files/ and then sh mygrep myVariableName But then I lose the ...
5
votes
1answer
345 views

How can I delete a just-typed newline character in bash?

I sometimes copy-paste paths into the terminal, and often accidentally copy the newline character. For example, I want to find then read the contents of foobar.txt. $ locate foobar.txt ...
4
votes
2answers
758 views

Get value from .XML file in Linux

Anyone got a nice solution for this: I want the value: /PlayDirList/PlayDir.1378803204 from this XML. <settings> <setting id="ask_set_logo_to_bg" value="false" /> <setting ...
1
vote
1answer
845 views

wget execute script after download

I need every time you complete a transfer program wget this run a script. this is my full command line: wget -i urls-to-downloads.txt My problem is that I want to go subtracting it downloads the ...
4
votes
1answer
2k views

xargs -I replace-str option difference

From my understanding, the following should mean exactly the same: ls -1 | xargs file {} ls -1 | xargs -I{} file {} if -I option is not specified, it is default to -I{}. I want to list all files ...
1
vote
1answer
600 views

Cannot execute commands in Terminal

My Terminal does not show my username when I open a new window. Additionally, I can't execute any commands either. This is what is in my window: ... Last login: Sat Oct 5 22:27:07 on ttys000 ls -1 ...
0
votes
1answer
98 views

trying to install Astromenace on my linux mint 14 cinnamon pc

so i am following this tutorial as it is the only one i can find and any that i can find are the same as this one: http://linuxg.net/games-on-linux-how-to-install-astromenace-on-ubuntu-and-fedora/ ...
0
votes
0answers
5 views

trying to install Astromenace on my linux mint 14 cinnamon pc [duplicate]

so i am following this tutorial as it is the only one i can find and any that i can find are the same as this one: http://linuxg.net/games-on-linux-how-to-install-astromenace-on-ubuntu-and-fedora/ ...
1
vote
1answer
93 views

Problems after installing Microsoft Services for UNIX

I had Cygwin installed and everything worked liked a charm. At some point I installed Microsoft Services for UNIX on my computer and the problems started. When I open up a commnad shell an wanna try ...
1
vote
1answer
114 views

Sorting services in Linux

I have a few Linux servers, all running different services. When I run service --status-all, I get a couple screens of output. I thought I'd be smart and pipe it to sort, and see as a group what ...
3
votes
1answer
394 views

How to subscribe to a youtube feed from linux command line?

I want to subscribe to a youtube channel and automatically download new videos to my linux machine. I know I could do this e.g. with miro, but I will not watch the videos using Miro, want to choose ...
2
votes
3answers
97 views

See all past comand line activity / records

Is there a way that you can see all past activity / records for the command line, like a 'history' feature in a browser? Bit of background I'm using OSX terminal to interact with the command line.