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

learn more… | top users | synonyms

8
votes
6answers
712 views

In Bash (Mac/Linux terminal shell), can the up and down arrow keys be made to function as they do in text editors?

In text editors, if I press the up and down arrow keys, it moves the cursor between lines of text. In Bash, if I’m typing a long command that spans multiple lines and I press the up and down arrow ...
3
votes
1answer
496 views

Raspberry Pi: open browser using bash and crontab

I'm trying to setup a simple bash script. I want to open the browser. chromium-browser <url> works if I do it in the cli or in the bash script if I run the script by ./scrpt. But if I put ...
0
votes
2answers
643 views

Bash - Recursively move all files in folders with given name to their parent directory

I have a document library where all of my files are in folders based on category name but then they are also all in subfolders called 'pdf' as well. Is there a way in bash to scan through all of the ...
22
votes
3answers
10k views

How do I configure ConEmu to run Cygwin Bash?

I created a new task {Bash} passed my home directory /dir "C:\Users\TMB\" and added bash as an application C:\cygwin\bin\bash.exe When I open Bash, it is unable to use the basic ...
4
votes
2answers
135 views

Attempting to test an embedded nand flash chip by filling up a file to drive capacity

I'm trying to test an embedded nand flash chip using the dd command (write random data to a file): dd if=/dev/urandom of=/nand/storage/testnand/test.raw bs=100000 count=50 2> /dev/null However, ...
0
votes
2answers
202 views

find out if the server root password is known with php or a bash-script

Is there a way to find out if the shell Ubuntu root password is a certain word? I deliver an image with a full Ubuntu installation to my customers, that has a certain root password. I would like to ...
0
votes
2answers
570 views

What is the difference in various commands for compressing files in linux?

What are the commands for compressing files in linux and what are the difference between them? (for example: tar, gzip, rar). I'm working on Linux Mint 11 and doing a script for compressing files. I ...
0
votes
1answer
35 views

Partial ignore case tab completion

First, let me go through a specific case and then explain the general case. Suppose I have two directories A and B. The contents of A are: foo Bar The contents of B are foobar Foobar I would ...
3
votes
2answers
2k views

Debian - bash is default shell, but “man sh” gives dash

On Debian squeeze. Running ps -p $$ shows bash is my current shell, ls -l $(which sh) shows sh is a symlink to bash. So why, when I run man sh, do I get the man page for dash? Is this just a bug in ...
0
votes
2answers
71 views

Find recursively a directory and remove it

I have a directory db-cache-db and there are a bunch of them under /home/{USER}/public_html. I know there is a way to write a script to that but I am not sure where or how to start. I tried the ...
0
votes
1answer
2k views

How can I use a bash script to run nmap and capture both IP and hostname?

I want to scan my network; and return an output like this: Network Scan for 192.168.0.* 192.168.0.1 computer1 192.168.0.2 computer2 192.168.0.3 computer5 echo Network Scan nmap -sP -n ...
2
votes
1answer
402 views

How can I remove these bash errors?

I'm using Mac OS X 10.6.8. When I'm launching Terminal, I'm getting these messages. How can I remove this error? I want get rid of this configuration from the bash profile. -bash: ...
-1
votes
1answer
223 views

Can I have 2 folders from 2 different servers in sync one way

Can I have 2 folder from 2 different server in sync one way! I have a Windows server, Server 1 :public server a Windows server, Server 2: local on my network :under NAT The problem is that I get ...
1
vote
1answer
472 views

qsub -hold_jid -afterok loop not starting

I am trying to run a series of jobs submitted to the cluster, one after the other, by suplpying the following .sh script: Annotation_Loop.sh : #!/bin/bash job=`qsub run_IntersectBed_1.sh 0` for i ...
1
vote
1answer
2k views

Sending email through Gmail with mailx gives error “Send options without primary recipient specified”

I am trying to send an email with a Bash script with my Gmail account using mailx. I have the following code in the script: mailx -v -s "$SUBJECT" -S smtp-use-starttls -S ssl-verify=ignore -S ...
2
votes
2answers
203 views

Split view of a CSV in Bash

I'm trying to view large CSV files in a terminal (not huge; simply more than can be displayed in the terminal window at once). The best solution I've currently got is this: column -s, -t -n < ...
6
votes
4answers
753 views

How to selectively navigate through Bash command history on a Linux terminal [duplicate]

Everyone knows (or should know!) that on a terminal the up and down arrow keys are used to navigate through the history of used commands. When you use the terminal on a daily basis, your command ...
1
vote
1answer
1k views

How to set NIC in promiscuous mode on mac book air?

I am trying to run my nic on MacOSx at promiscuous mode and then use tshark / tcpdump Option1: ifconfig en0 promisc but I get this message: ifconfig: promisc: bad value Option 2: I tried sudo ...
2
votes
2answers
357 views

~/.inputrc causes CTRL+arrows not to work

When ~/.inputrc does not exist, hitting Ctrl+Left Arrow and Ctrl+Right Arrow on a Bash command line moves the cursor back and forward by one word, respectively. However, if ~/.inputrc exists ...
10
votes
2answers
293 views

How to move folder in unix using mv, only when target is on the same drive

I need to move a folder using unix mv command, but only if the target is in the same drive or the same filesystem. What would be the best approach?
2
votes
3answers
373 views

weird filename sorting (bash, ls, sort)

Good day, everyone. I'm trying to feed my music to mplayer, like this: mplayer *, but getting wrong track order. Here's what I get with ls (as well as ls -1, ls -1 | sort), note the order of the ...
1
vote
1answer
550 views

Running source ~/.bashrc doesn't load the right version of node when using nvm

I have placed this at the bottom of my ~/.bashrc: # NVM . ~/nvm/nvm.sh nvm ls nvm use 0.8 nvm ls This is the output when I load a terminal: Last login: Mon Apr 29 16:28:17 on ttys010 v0.4.7 ...
1
vote
1answer
335 views

Cannot get Vim to remap CTRL+S to `:w`

I've been trying to get Vim to remap CTRL+S (or ^S) to :w by editing my .vimrc file, however it doesn't work. This is my current ~/.vimrc configuration: nmap <c-s> :w<CR> imap ...
-1
votes
2answers
282 views

how to remove color from mac terminal

When I am on the Mac, the terminal is bringing up colors on the path, is there a way to remove them? This is what I have:
2
votes
1answer
168 views

one sudo for multiple terminals

Sudo root permissions are given for specific time, but only for one terminal. If I want to use sudo in another terminal in that time period, I have to type password again. How to force sudo to works ...
0
votes
0answers
61 views

which program is really running?

I am running a self-compiled version on python2.7, --prefix=$HOME, so as not to interfere with the standard installation of python2.6 (on Ubuntu 10.04). Had some problem importing the ssl modules, ...
0
votes
3answers
145 views

does ssh have a facility to exchange files when already connected?

I never heard this possible, so probably the answer is not. But maybe someone knows better. I know you can use sftp to exchange files between host and remote, and you can both: sftp from host to ...
1
vote
4answers
669 views

Auto propagation of bash settings across many machines?

I need to console to many machines through SSH. Including Linux, Mac, mobile devices, virtual machines. Sometimes I need to login to more than 10 machines in one day. I enjoy my personal .bashrc or ...
2
votes
1answer
812 views

imagemagick image conversion piped in avconv fails

I am trying to write a script that should take all sort of images (format, size...) and create a video with avconv. I've managed to make it work with a series of jpg (all the same size though) and I'm ...
1
vote
1answer
72 views

Information flow in Linux - how to tell who is currently active and typing?

I'm currently playing a mafia/werewolves game with my cyber-security class. The basic idea is: on one machine, the moderator starts a server program all the players ssh into the machine and launch ...
2
votes
1answer
440 views

Is it possible to kill a loop in bash without killing the instance of bash running the loop?

Suppose I execute (in an interactive bash shell) a loop that spawns a bunch of processes in sequence, such as the following. for i in `seq 15 42`; do if [ -f F$i.flv.mp3 ]; then play F$i.flv.mp3; fi; ...
3
votes
3answers
375 views

Can't delete file with foreign letters

I have a file: På hjul.mkv When trying to move or delete file I get rm: can't remove 'På Hjul.mkv': No such file or directory The same thing happens when trying to issue $ rm *P* or the like: ...
7
votes
3answers
2k views

List file range with UNIX wildcards

Say for example I have the following files in my working directory: mjk0001.fits, mjk0002.fits, ... numerically increasing all the way to mjk9999.fits. Is there a way to use UNIX wildcards to list or ...
0
votes
2answers
429 views

Writing Unix script (bash) that creates a directory in the location specified at the command line

I currently have a Unix script (written in bash) that executes several commands to modify a group of files, which I specify with an flist containing their paths. The general idea of the script is to ...
0
votes
2answers
413 views

Deleting line from file using SED in MultiUser Case

I have a scenario where multiple users are connected to a server using SSH. I have a file which is read and written by all the users. The file contains numbers like this - 14554 14887 23451 15135 ...
2
votes
2answers
448 views

Bash change user info (like usermod) but without root privileges

I am writing a small GUI program for a user to edit their own account. You cannot run usermod as a regular user, I am looking for that kind of functionality. Changing a users fullname is the most ...
1
vote
1answer
570 views

Trap Ctrl+C and repeat the while loop in Bash

I was trying to trap CtrlC or CtrlZ and clear the screen and repeat the loop without exiting – it's working but I need to press Enter to repeat the loop. #!/bin/bash trap 'clear' 2 20 while : do ...
1
vote
2answers
260 views

Remove X number of characters from command STDOUT

I'm running an application that is outputing lines, piping to GREP to select only specific lines, but want to remove the first X characters which are worthless. Specifically: varnishlog | grep Hash ...
0
votes
1answer
38 views

On ec2 how do I use navigation shortcut keys?

Whenever I ssh to ec2 I notice that ctr+a (beginning of line), ctrl+e, and other navigation keys do not work in terminal. Is there a way to set up my ec2 terminal so that I can use these navigation ...
1
vote
1answer
61 views

Bash and double echo

I have the following code. In all cases I'm expecting to get 1 1. Could someone explain why I do not get the expected output in the first case? The question seems to be very simple and I think I'm ...
0
votes
1answer
62 views

Tab key prints an “ i ” to the console instead of executing tab complete

I have been using Linux for 27 hours now and I am just now getting aquainted with the command line interface. In my instruction, tab complete should execute the remainder of a directory name such as ...
2
votes
1answer
1k views

How to log bash command with its output?

I want the actual command line be logged together with its output. I routinely execute important commands like this: PERL5LIB=${PERL5LIB}:/something/extra my-command.pl many arguments which I want ...
6
votes
3answers
397 views

How can I easily see the man page for builtin shell commands?

If I see a command in a script that I don't know and I type (for example) man pushd or man umask I see the man page for builtin commands. I know that I can do man bash and scroll to find the help for ...
0
votes
1answer
3k views

Remove all symbolic links of files in one command

I want to remove all the symbolic links of files. I have a directory structure like /usr/local/instantclient/11.2.0.3 which contains lots of files and i have symbolic links of these files in ...
2
votes
2answers
360 views

ssh backspace deletes one character instead of two (utf-8 symbols)

Im accessing a remote computer using ssh and running a bash command to input symbols using standard input stream: read test;echo $test It's ok to input english letters and use backspace to ...
1
vote
1answer
166 views

How can i set the flags with gentoo prefix

I have install the LFS system , after that I tried to install the gentoo prefix on my system. But it comes error: I'm going to check for some variables in your environment now: it appears ...
0
votes
1answer
307 views

output of `svn status -uq` has no newlines in script

function runstatus { echo "SVN Status -uq:" echo status=$(svn status -uq) echo $status echo $bigline } This prints something like: SVN Status -uq: rd_backup ...
0
votes
2answers
1k views

Bash script fails with “syntax error in conditional expression”

I'm new to bash scripting, and I just want to do a simple little thing, but everything I read online seems to not work for me! So I have this script here: #!/bin/bash if [[ $1 = "32"]] then ...
1
vote
1answer
77 views

Writing a script to tell which users are currently typing? [closed]

I'm working on a lab for a cyber-security class and need to find out when certain users are communicating with each other (through named pipes). The users use: python gameProgram.py And then that ...
0
votes
2answers
586 views

permanent powertop changes with systemctl

I have got a .sh-script, trying to make powertop changes permanent. 'auto' > '/sys/bus/pci/devices/0000:00:02.1/power/control'; the commands in this .sh-script are all of this type. I have a ...