Bash is the shell used in Ubuntu's command-line interface.

learn more… | top users | synonyms (1)

0
votes
1answer
27 views

How do I get past the space in the name of the root directory on my mtp-mount cell phone?

I have a Motorola Droid Maxx which I can access from Thunar and the command line, but not from inside a bash script. The problem is that the root directory on the phone appears as "Internal storage" ...
2
votes
1answer
35 views

cp -u copies all files, not just newer ones

I'm sourceing script that says something like cp -vau /home/jordan/local-directory/ -t /media/jordan/A368-480F/BACKUP/ , and that's it. A368-480F/ is the directory that appears when I plug my USB ...
2
votes
2answers
54 views

keyboard in tty behaves wrong after login as root

I am not sure if it's the keyboard layout or what. after sudo su the keyboard doesn't work correctly. For example there is no letter 'i' or '.' It really troubles that I can't use i. Can't even ...
-1
votes
1answer
53 views

Bash script kill not working [closed]

#name - name of killing process pidof name | kill Why it doesn't work?
1
vote
1answer
57 views

Connection closed by remote host after pressing tab for autocomplete

I am connecting to a virtual box installation of Ubuntu 15.10 using putty: Welcome to Ubuntu 15.10 (GNU/Linux 4.2.0-22-generic x86_64) If do simply cd folde [tab] a window opens "Connection closed ...
3
votes
1answer
42 views

Switching User From A sudoer to Bash to Root

On someone's ubuntu VPS I created a user, added them to sudo and logged in. Figuring I didn't need the root password anymore, I got rid of it. Then for whatever reason I felt I needed to go back to ...
4
votes
2answers
163 views

Problem with input from simple script that copies a file to a different directory

As someone trying to learn bash, I have been making simple scripts to test out various commands. In the following simple script, I am experimenting with the read command. #!/bin/bash read -p "Enter a ...
0
votes
2answers
43 views

Bash script for finding number of files, directories, and temporary files in a directory

I want to write a shell script that counts number of files, directories, and temporary files in a directory. The script below throws an error. #!/bin/bash cd '/home/Ubuntulover/Shell' file=0 dir=0 ...
19
votes
4answers
950 views

How to enter password only once in a bash script needing sudo

Data I want operator users on this machine to mount their own cifs shares The sudoers file already contains the /bin/mount -t cifs //*/* /media/* -o username=* command for all operators I want the ...
0
votes
1answer
23 views

Script for checking internet connection and password request

Good morning, I have a home server running Ubuntu 14.04.3 LTS. It's a desktop connected to my wi-fi connection via an USB adaptor. The issue here is that randomly it gets disconnected from the ...
1
vote
1answer
27 views

How to append another directory to an aliased `cd` command?

I have aliased a long path in .bashrc file as alias py="cd ~/Myprograms/Langs/workout/PythonScripts" Now assume there is an another directory in PythonScripts say "basics" How do I use the above ...
0
votes
1answer
36 views

Empty curly braces and semicolon in bash [duplicate]

What does {} \; string mean in bash? I've seen it a couple of times, for example, to find and delete all files by name one must execute find . -name "FILE-TO-FIND" -exec rm -rf {} \; What does ...
0
votes
1answer
35 views

bash: syntax error: unexpected end of file

[~/bin]: ./trashing_rm.sh ./trashing_rm.sh: line 70: syntax error: unexpected end of file [~/bin]: here's trashing_rm.sh: #echo $@ #dbg function help(){ if [[ $2 = "--help:setup" ]]; then ...
2
votes
1answer
26 views

Unix Sort with exponential values

I tried -g but still not sorting true my exp numbers : sort -g output.out > sorted.out and it gave me that output : 0.100159E+00 0.998410E+01 121.0000 0.100753E+00 0.992529E+01 126.8500 ...
3
votes
1answer
52 views

How do I extract test line by line from a text file in terminal?

So I have a .sh script that needs to wget a lot of files. I have a text file set up like this http://www.website.com/w4w4wbvert9rtr/video.mp4 http://www.website.com/wserteg444gs4r/video.mp4 ...
1
vote
1answer
35 views

Problematic line breaks in bash

I hope this is not a duplicate, haven't found it by myself so.... I have this question: when I do: echo "some very long text" it breaks some words, like if I use the word "elephant" close to the end ...
0
votes
1answer
44 views

Shell script does not run properly

I need help running a shell script. At my high school, I am competing in a cyber security competition, and we are given virtual machines of operating systems with security vulnerabilities that we must ...
3
votes
2answers
36 views

cron does not write in the file

I just start with cron jobs and I wanted to start with an easy task. Create a file in my home folder with the output of the ifconfig. So I created test.sh, which I made it executable with the: ...
1
vote
1answer
72 views

${debian_chroot:-} Why bother with :-? [duplicate]

.bashrc and bash.bashrc include: [ -z "${debian_chroot:-}" ] Bash manpage states the following on parameter expansions of the following form: ${parameter:-word} If parameter is unset or null, the ...
0
votes
1answer
81 views

How to cut some text from several files, replace them with names and some more?

This may be a big favor as I want you to help me write a complete script, but I appreciate anyone helping me in it and assure you that your answers help science improve :) If you don't have the time, ...
0
votes
1answer
53 views

Script: Recursively convert wma files to MP3, then remove WMA files

I'm trying to fix a script that recursively searches a directory tree for WMA files - converting them to MP3 files, and then removing the WMA files, leaving the converted MP3 files in their place. ...
2
votes
2answers
102 views

How to get real-time completion/suggestions in Linux terminal? [closed]

I would like to have something similar to everything in windows (using locate): every time I press a key, the file list that matches the current inputs gets updated immediately. I am wondering is ...
0
votes
0answers
49 views

Is the incomplete output by wkhtmltopdf caused by shell expansion or wkhtmltopdf?

My Ubuntu 14.04's wkhtmltopdf version is $ wkhtmltopdf --version wkhtmltopdf 0.12.2.1 (with patched qt) I want to convert several webpages into a pdf file using the program in bash. First I tried ...
-1
votes
5answers
107 views

Where can I learn all about `bash` so that I too can use the terminal effectively? [closed]

I don't get bash, and I mostly use commands without understanding them. Are there any resources that can provide me with a mostly complete understanding of bash? This isn't just about Ubuntu commands, ...
4
votes
2answers
174 views

One single cron job not running

I have a list of cron jobs. 00 21 * * * sh ~/db_backup.sh 20 21 * * * sh ~/update.sh * 5 1 * * sh ~/db_vacuum.sh The first job makes a backup of a database I have running on an Ubuntu server, ...
3
votes
1answer
36 views

Finding linked files

Trying to find where /usr/include/freetype2/ft2build.h file is linked in my system: sudo find -L / -samefile /usr/include/freetype2/ft2build.h This dives many errors File system loop detected ...
1
vote
1answer
163 views

script never completes last line

I wrote this script to get some files off a webcam server. The files, are all downloaded, but when I was running the script, the last line never ends, even after the file was downloaded. So, I would ...
-1
votes
1answer
33 views

Which config file has my path variable? [duplicate]

So in my "the linux command line" book, it says this "The PATH variable is often (but not always, depending on the distribution) set by the /etc/profile startup file and with this code: ...
3
votes
1answer
187 views

Swift installation error on Ubuntu 14.04(32 bit installation) - 64bit Machine

I have followed steps specified here https://swift.org/download/#linux When I try to run command swift --version It throws error bash: /home/dhiraj/swift2/usr/bin/swift: cannot execute ...
1
vote
0answers
48 views

Error: unknown type name '__int8_t' [closed]

I am trying to execute the buildall.sh script of python-for-android project.After the command bash buildall.sh I get the following Error: arm-linux-androideabi-gcc -c -DNDEBUG -g -fwrapv -O3 ...
-2
votes
3answers
45 views

Any way to see if a long running process bash command succeeded? [closed]

I have a long running process that was parsing text and my laptop died at some point because it was unplugged. I really don't want to unnecessarily run the process again because it takes over a day, ...
4
votes
2answers
188 views

How to personalize the command prompt?

I just recently (re)installed Ubuntu on my pc and I have a slight "problem". I can't figure out what commands (?) I should write in my bash_profile, to have the following result: < User>@< ...
1
vote
1answer
79 views

How to remove command-line history from a specific time period?

How can I remove command-line history over a specific time period? Is it possible do so with only one command?
1
vote
2answers
89 views

Ubuntu with Kodi — how do I suspend based on audio output?

Ok, I am running Ubuntu 15.04 with Kodi 15.2 as an HTPC. I have always had problems with suspend and hibernate due to the fact that it appears that the two systems' power management cause some ...
3
votes
1answer
52 views

Have bash script run against a live file - Is it possible?

I have a script I've written and (finally) have it working like I want it to, as long as I run it against a static file. Is there a way to tail a live file and have the script perform its actions ...
1
vote
2answers
56 views

How do I wipe my USB properly?

USB - 16GB - Had viruses Nwiped USB...didn't complete. Used DoD Short method. Didn't complete Now I can only read 16MiB of USB fdisk -l /dev/sdb Disk /dev/sdb: 16 MB, 16777216 bytes 255 heads, ...
1
vote
2answers
32 views

Pass param to ssh user@server bash --login -c FILE.rb PARAMS

I need run bash ruby script over ssh on remote server: # $1 - get params from local bash session ssh user@server bash --login -c FILE.rb $1 FILE.rb now recive no any params bash --login is need for ...
0
votes
2answers
48 views

how can I rewrite a bash script as a one liner?

I want to add a gesture command using compiz. There is command plugin in CCSM, it lets you assign one of the screen corners on mouse move to execute a command. I want to toggle onboard screen ...
6
votes
4answers
759 views

How to escape “.” with sed or grep?

I have file with denm.xyz denm.abc denm.def denm_xyz denm_abc denm_def I want to extract the ones with . in it. I tried grep "denm\.*" file grep 'denm\.*' file sed "/denm\.*/p" file sed ...
0
votes
1answer
46 views

Bash:cd:No such folder or directory , but it exists

I am new in ubuntu and I am doing a project where i should install the charm crypto library in my android device.In the manual file it says that i should create two folders: $BD and $SCRIPTS. I ...
1
vote
0answers
28 views

How to create a log of an rsync transfer on the remote server?

I have a lovely functional bash script, which uses rsync to create a backup on a remote server, utilising key-based authentication. It uses a standalone rsync command, rather than having to set up ...
1
vote
1answer
179 views

/bin/bash: line 1: simg2img: command not found

when I run a command simg2img I get the following error: /bin/bash: line 1: simg2img: command not found. MakeFile Snippet: if [ true = true ]; then \ simg2img ...
-2
votes
1answer
48 views

Can someone please help me adding a simple while loop. it's better if it's releated to the script

Here's my script tried adding one kept getting an error. All help is appreciated. #!/bin/sh #Name:gamer #Date Created: 12/6/2015 #last modified: 12/8/2015 #Desc/Purpose: Updating and installing apps. ...
0
votes
0answers
21 views

Cannot print pages in random order using lp/lpr

Env: xfce4 + ubuntu + bash Printer is configured by hplip. lp -o landscape -o fit-to-page -o media=A4 -o number-up=2 -o number-up-layout=lr -o page-ranges=320,289,321,300 ~/Documents/test.pdf lp: ...
3
votes
1answer
43 views

Bash script not working properly from crontab

I've some scripts that run perfect if you run them from a terminal, but once you add them to crontab it's like the bash doesn't execute properly and doesn't continue with the first IF statement and ...
0
votes
2answers
101 views

how to source csh script from bash environment?

I am using bash shell but some of the scripts that I need to source are in csh format. Can somebody tell how I can source csh scripts from bash shell? By sourcing I mean the sourced csh script should ...
0
votes
1answer
41 views

Array in shell script

I want to store the output of the diff command into an array and to find the length of the array using a Bash script. I tried this, but it didn't work: arr=( $(diff -w file1 file2 | grep '<' | awk ...
1
vote
0answers
87 views

fswatch | while read | xargs running command twice

Thanks in advance for any advice I'm working on an fswatch command to launch a script when files hit the Downloads folder. fswatch --event Created Downloads/ | (while read x; do echo $x | xargs -0 ...
1
vote
1answer
85 views

Run Android Studio on reboot using shell script

I'd like to start Android Studio while my computer starting. I used crontab and @reboot parameter: crontab -e and scheduled this task @reboot /home/ziko/reboot_cron.sh # JOB_ID_1 SHELL=/bin/sh ...
5
votes
4answers
310 views

Merge files using a common column

I have two files out of which I want to create a third which contains all the information. file 1: a 111 b 222 c 333 d 666 e 777 file 2: 111 x1 222 x2 333 x3 444 x4 555 x5 666 x6 777 x7 ...