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

learn more… | top users | synonyms (1)

-1
votes
1answer
32 views

Script that scans my network and look of computers are up of down in my network

I have a question I want to run a script that scans my network and that I can see with devices are up in my network. I want to paste some arguments also in the script When I run the script: ...
11
votes
3answers
1k views

What is the meaning of the following code?

Can anyone explain what does this command mean? PATH="${GZIP_BINDIR-'/bin'}:$PATH"; export PATH
4
votes
1answer
131 views

Delete lines in several files in a folder once (avoid infinite loop)

I have several files in one folder, and I want to delete the first lines in all of them. If I do this: sed -i.bak '1,2000d' *.dat the first 2000 lines are deleted, but then the filename is still of ...
0
votes
1answer
35 views

I want to write weather data via a python script twice a day to a csv file [on hold]

Is this practical? How do I accomplish it? Some barriers I've come across already: I have separate scripts for weather and time. How do I format them into one comma-separated row? how do I print ...
1
vote
1answer
37 views

How to run streamus app from terminal

I use Streamus to stream music from you tube. I want to know whether streamus can be started from terminal itself. I have asked this question in main software site and the author recommended to use ...
0
votes
2answers
44 views

Difference between C programs and shell scripts receiving signals from fuser

I have written the shell script below for a lab in my college. It must look at a log file being upgraded frequently from another process and create a number of copies passed at invokation. Here is the ...
3
votes
3answers
66 views

Move files from specifically named folders / move files up one level

The goals is to move files out of the lowest level folder, back up one directory. This does a great job but moves files higher up the folder hierarchy as well. find . -name '*.jpg' -type f -execdir ...
0
votes
2answers
26 views

How can I use convert to resize images to a specific width keeping the ratio for the height? [duplicate]

I have a file with the full path to an image on each line, all are jpg. I want to resize every image/line in the file to 1024px in width, while keeping the aspect ratio for the height. I simply want ...
5
votes
1answer
31 views

Help with Alias [duplicate]

I frequently use: find /home -iname foo* 2> /dev/null The 2> /dev/null suppresses any permissions issues and leaves legit matches. I tried creating: alias lost=find /home -iname ${1} 2> ...
0
votes
1answer
33 views

running python packages from user local directory

I'm on a Shared hosting, with a limited SSH access. don't have sudo privileges. And there are some limitations on some folders, as the following: This is the output of the termial ls -al : ...
0
votes
0answers
35 views

shell script in /etc/profile.d not running at startup [duplicate]

I have a shell script at /etc/profile.d/pg_local.sh. It contains the following contents: export PATH="$PATH:/usr/local/pgsql/bin" Its supposed to load that path in the user accounts' $PATH when the ...
0
votes
0answers
17 views

Pass to the script keyboard key pressed after hotkey has invoked a Bash script

I assigned a custom hotkey Ctrl+Q to launch my bash script. #!/bin/bash read -s -n 1 key zenity --info --text "$key pressed" I'd like to have a script to detect which key followed the hotkey. Say ...
0
votes
0answers
8 views

Inotifywait is moving multiple ffmpeg segments instead of one at a time

I have come to a dead end looking for a solution on my own and will ask for your help please.... Thanks for all info you may have.... I capture 30 second segments of video and write to a folder in ...
44
votes
4answers
3k views

What does “apt-get install !!” do and how to make it work?

I have seen someone typing apt-get install !! He did that a few times and every time, a different program was installed. It seems like it automatically figured out what is needed next. However, ...
0
votes
2answers
8 views

Permission denied error during “hadoop namenode -format” command

I am trying to install single node hadoop cluster using this tutorial. I followed all the steps as mentioned the above link says but I am not able to format the namenode using command hadoop namenode ...
1
vote
2answers
43 views

Unzip a file to its current directory

I've figured out that extracting a .zip you need the path to the directory as well when you are recursively looking through subdirectories. So how do you store the path? This is nearly there but ...
3
votes
3answers
126 views

Store a filename in a variable minus the extension

File: test.zip Bash script while read filename; do zip_file=${filename} # do stuff done; Value stored in variable = "test"
0
votes
1answer
28 views

no echo in bash shell script loop

In this script, the second echo statement doesn't do anything. #!/bin/bash echo "Start folder create..." find . -name "*.zip" | while read filename; do foldername="${filename%.*}"; mkdir -p ...
2
votes
1answer
101 views

Shell script with select command to show a list of files

I've written the attached bstls.sh shell script which uses the command select to choose the subfolder or file in a folder passed as argument on which execute the ls command. #! /bin/bash #Personal ...
1
vote
1answer
42 views

Printing from command line

Please can anybody explain what exactly these commands and options do: find /home/mike/Duck/ -type f -iname '*.txt' -print 0 | while IFS= read -r -d '' f; do lpr "$f" && mv "$f" ...
0
votes
0answers
47 views

How to add and pass system password as a variable in a script

I have a script which asks for system/login password and pass that password to further processing. This is the gist of programm by which I am executing my script. read -s -p "Password: " password1 ...
1
vote
1answer
31 views

Installing software on another computer with bash

I'm relatively new to all things Linux, but I've missed out on two really good job opportunities because I lack Linux experience. To that end I've been playing around with Ubuntu and Centos on some ...
0
votes
2answers
114 views

How to download facebook videos by using 'youtube-dl' in linux?

I am unable to download facebook video using youtube-dl. The following error occurs during downloading $ youtube-dl ...
4
votes
1answer
72 views

How to execute a sudo script with double click

I have this script to shutdown my system after 30 seconds. I want to run this script by double clicking it (that option I changed in nautilus). This is the content of my script #!/bin/bash shutdown ...
4
votes
4answers
169 views

Blocking Start of Terminal

If you type this simple test command: gnome-terminal -x bash -c "ls;sleep 3" You will find that it returns immediately (the newly created terminal, of course, lingers for three seconds). This is ...
0
votes
1answer
37 views

error in running bash script as root

I have a simple shutdown script which i want to run as root shutdown -h +30; echo "succesfull"; I have followed these answer1,2 to make my script root. first I run this command sudo chown ...
0
votes
1answer
30 views

How to maintain a counter across multiple executions of a script?

I have a script with a conditional statement and I want to find out how many times the then clause is executed, across multiple runs of the same script. eg: if [condition] then Some code; ...
1
vote
1answer
18 views

Find ports locked to process running in the background

Is it possible to find the ports assigned to the process started on the background? I want to start a process and let it run in the background, like ./run.sh & and then see all the ports this ...
3
votes
2answers
126 views

Can alias command pass arguments?

I want to know if i can pass an argument with an alias command. for example: alias d="dmesg|grep -iw usb|tail -5" Now d will print the last 5 lines. if i want to use d to print a different number ...
1
vote
2answers
22 views

Calling Values from a .properties file?

Right now I have a simple script I want to now call a .properties file and then print the results of that file, this is what I have so far #Specific Set Variables SpecficStatus="Pass" #SetVariable ...
0
votes
2answers
32 views

I need to make a batch of users

I had written some code that would allow me to make a batch of users based on a file with usernames in it. But it eventually went from just a few lines to about 50, and I deleted it. There has got to ...
1
vote
1answer
22 views

Can't find an installed program - mathematica

I recently installed Wolfram Mathematica as a .sh file. I ran it using bash and it took me through installation. It said that the installation directory should be /usr/local/Wolfram/Mathematica/10.1 ...
3
votes
2answers
42 views

grep regex pattern causes unexpected command behavior

I'm searching for lines with $ and consecutively ' or " through this grep in my terminal: grep "\\$('|\")" -rin folder_path After pressing enter the terminal doesn't think the line is complete so ...
1
vote
1answer
19 views

bash expressions

In a bash script I have the following section. if [ "${1:0:1}" = '-' ]; then set -- mongod "$@" fi What does the expressions ${1:0:1} and set -- mongod "$@" ?
1
vote
0answers
17 views

Screen in crontab

I'm trying to run 9 screens windows by crontab, and then, run some codes (basically the same for all of them), but they don't work. The code runs all of 9 screens, but run code only on the first. Aah, ...
9
votes
2answers
561 views

Piping to “type” command

I want to find out the type of several commands. Is it possible to pipe or xargs a search result from find into the type command in Linux? For example: find . -name anacron | type or find . -name ...
0
votes
0answers
14 views

Enable Vino Script Help

I have been trying to add and enable Vino to our districts Ubuntu laptops but have come up with some issues that I can seems to find a solution to and i was wondering if you might be able to assist. ...
0
votes
0answers
42 views

minimal bash-like line editing is supported. Problem after a fresh installation of ubuntu 14.04.2

So I had ubuntu on my NUC. It was great I have to power on and ubuntu start. But I had a problem and I had to reinstall everything. I erase everything and install to have a fresh ubuntu. Everything ...
4
votes
4answers
80 views

Terminal: Avoid repeating directory multiples times to reach files within

I have two files file1.txt , flie2.txt in a directory X. I want to copy those files to my current working directory which is far away from the directory X. so I end up with a command like: cp ...
3
votes
2answers
91 views

Recursively rename files [duplicate]

there is a whole bunch of files all of them who have the pattern joob_1_1 joob_1_2 joob_2_1 joob_2_5 so it is joob then underscore numeric underscore numeric - these are also the only files in the ...
0
votes
1answer
24 views

how to pass single file not list of files

I am running this command while IFS= read -r file;do split -l 20000 -d "$file" "$file";done < file.list.txt now my problem is that this accepts as input a list of files (file.list) which looks ...
-1
votes
1answer
51 views

help with my script “path of shell” [closed]

I usually php but also use bash to automate tasks on my server. I am trying to test this bash script but I'm not sure what "path of your shell" means. If anyone could help me with what i am meant to ...
0
votes
1answer
23 views

Execute scripts and Java programs from apache/PHP

I'm trying to allow apache and PHP to execute a script I have written that is located in /usr/local/lib the script in question is called "pathy" has been added to the path in my .profile, and I can ...
1
vote
1answer
16 views

Problem while trying to create an alias

Goodmorning I was trying to create an alias so as to launch matlab easier. I read this post :How to create a permanent "alias"? and I used the commands in this line echo "alias ...
0
votes
1answer
31 views

How can I move a file to a directory?

I just want to read from the keyboard the file's name and move it to another directory. I have this in my mind : ls read a // the name of the file pwd read b //the name of the directory where I ...
1
vote
2answers
54 views

Determinate if a file is already opened

I want to create a bash script to determine if my file is already opened by another user. I have already tried with lsof but it didn't work as i wanted. The files can have different types of ...
5
votes
1answer
134 views

Working with text files encoded as Windows-1250 and UTF-8

I am switching between Ubuntu and Windows frequently therefore I have some encoding problems with text files. If I save text file in Ubuntu, everything works fine in both systems. But Ubuntu doesn't ...
0
votes
0answers
25 views

How to turn ON/OFF screen monitor using shell script and 'xrandr' linux command?

I am trying to turn on and off screen monitor in Ubuntu14.04 using key bindings. I tried following shell script #!/bin/sh output=$(xrandr | grep ' connected ' | awk '{print $1}' | head -1) ...
4
votes
2answers
331 views

How to create a rotation animation using shell script?

I looking for a script that creates a rotating animation using character /,-, | and \. If you continuously switch between these characters it would look like its rotating. How to make this?
2
votes
1answer
65 views

How to make a batch file add users to groups?

I need help with a GCSE project, I'm stuck on the last question. It asks for a bash script to create users, and then assign them to groups. I've already made the script add new users, but I'm unsure ...