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

learn more… | top users | synonyms (1)

0
votes
1answer
25 views

Create an alias for a directory while working in virtual environment

I've checked this. But right now I'm working in a virtual env. cam@cam:~$ cd Desktop/django-user3 cam@cam:~/Desktop/django-user3$ source newenv/bin/activate (newenv)cam@cam:~/Desktop/django-user3$ ...
13
votes
1answer
615 views

opposite of eject command?

I have a ton of CDs to image, and I just got curious. I can eject with the eject command. What command inserts the disk tray back into the CD drive? yes it is the type that can pull the tray back in. ...
4
votes
3answers
264 views

improve bash script

I have a quad core desktop, and i wanted to know the average temprature according to sensors. so i wrote this bash 1 liner. echo `sensors -A | awk {'print $3'} | sed 's/+\|(crit\|0:\|°C//g'` | awk ...
-2
votes
4answers
54 views

Why am I getting a syntax error in this script?

When running the script below, I get an error: The script is: clear echo "Enter a num" read num if [ "$num" -ge 0]; then f=1 i=1 while [ $i -le "$num" ]; do f=`expr $f \* $i` ...
-2
votes
0answers
20 views

Conditional statements go wrong when set Shortcut

( C=1 if [ $C == 1 ] then echo "True" else echo "False" fi ) > ./log.txt When i run it in terminal, it output True (expected), but when I set a shortcut keyboard to run ...
7
votes
3answers
319 views

How do I search shell command history with a text editor?

I know that Ctrl+R let's you search command history, but it's a little primitive. Is there a way to export all my command history (not just the current terminal session, but the full history) to a ...
2
votes
1answer
106 views

I see one backslash, but there are actually two backslashes!

Does anyone can help me to understand that weird issue? I was trying to rename a very long list of folders. I went to the parent directory and listed all the folders to rename in a text file: find ...
1
vote
1answer
35 views

Why is this odd file extension appearing when I scp a file?

I'm creating a large number of gifs and copying them to a separate computer with a webserver folder mounted via sshfs. For some reason the files will randomly copy with *.gif.001 file extensions. My ...
3
votes
1answer
43 views

Is there a bash/terminal command that will clear content prior to the last command?

Use case: I'm working in bash/terminal and have been typing several commands and I've just run something and it's spewed some output. I'm trying to find where that output started and have to visually ...
0
votes
1answer
26 views

how to stop using export command

every time I run gdb I have to type export SHELL=/bin/bash or gdb would return exit with code 127 my question how to make this command run every time automatically without need to re type it because ...
3
votes
1answer
46 views

Create zip files in /var/www/html using crontabs

As the title explains, I'd need to take a file and put it into a zip archive once a day; also, the zip file has to be moved in /var/www/html, where a .php scripts allow users to download it. Assuming ...
2
votes
2answers
118 views

Bash Script does not work?

I made a script to check if sdb or sdc drives are present. but even when I have both or one of them present the script is terminating. what is wrong with my script? HDD1="sdb" HDD2="sdc" echo ...
1
vote
0answers
39 views

Bash script: command not found

I have an executable script install_packages.sh in /home/etienne/admin folder. The directory's path is added to $PATH variable from /etc/bash.bashrc. When I type #echo $PATH I see that the variable ...
0
votes
2answers
26 views

Copy pictures recursively from one folder to the root of another?

So, I have a Windows virtual machine running this certain program. The details are as follows: The program has no recursive search functionality. I have lots of free disk space. I have excess junk ...
0
votes
2answers
22 views

Run command when CPU becomes free? [duplicate]

I have a PC with 4 CPUs that is running four jobs. I would like to run another job on it, but only when one of the CPUs becomes available. Is there simple command to do this (I know this is what ...
-1
votes
0answers
20 views

Warning bash on Openproject Installation

when i install open ERP on ubuntu 14.04 x64 root@ivanserver:~# su openproject -c "bash -l" bash: cannot set terminal process group (-1): Inappropriate ioctl for device bash: no job control in this ...
30
votes
4answers
2k views

When to use () vs. {} in bash?

I'm studying shell scripting with bash and I need to know the difference between (...) and {...}. How does one select between the two when writing a script?
0
votes
1answer
45 views

Creating new user, how to run commands after SSH login? (Ubuntu Server Trusty)

I have configured Ubuntu Server for my needs, and basically everything is working as I want. I'm new to Linux, but learned a lot using and interpreting different guides, however, this particular ...
0
votes
2answers
39 views

when ssh is run with a server + command argument, what startup profile runs if any?

I know /etc/profile and ~/.profile are among the start-up scripts used when ssh is used to login to a server – i. e. using ssh with server argument. However, the scenario where I am just using ssh ...
1
vote
1answer
207 views

Bashscript making a variable equal a command. error command not found

Hi i keep getting the error ./imagehash.sh: line 2: =: command not found When i know that i set the $CMD variable correctly (i tried the command outside the bash script and it worked just fine) ...
1
vote
1answer
10 views

Start gnome-terminal with predefined history

I would like to start a Gnome terminal window with a predefined history file. I tried: gnome-terminal -e 'bash -c "history -c; history -r ~/test.hist; exec bash"' but it still uses the standard ...
1
vote
2answers
27 views

wget: automatically overwrite dowloaded file create time to current?

When I download file using wget it copies create time from original file on server by default: > wget https://pbs.twimg.com/media/ByEt7bVIQAAzDVq.jpg > ls -l ByEt7bVIQAAzDVq.jpg -rw------- 1 ...
2
votes
2answers
128 views

cp problems with copying root

I have a little bash script going to check if the system has been backed up today and and if it hasn't then it copies the entire filesystem into the backups folder: date=$(date +"%m%d%y") sudo mkdir ...
1
vote
4answers
232 views

What is a practical way to list every character used in a file (Bash) (Regex)

How can I turn this: Johnny's penguin, (Tuxie), likes the following foods: French fries, and beef. To this: abcdefghiklnoprstuwFJT',():. (These are the total characters used in the input) ...
1
vote
1answer
27 views

New shell terminal points to different bash_profile [closed]

When I launch new terminal it points to some different bash profile. Here in my $PATH are set to default, $JAVA_HOME is blank When I source my .bashrc and and .bash_profile located at home then I am ...
1
vote
0answers
31 views

Connecting Ubuntu to Windows Domain

I made a bash script to automatically connect Ubuntu computers to a domain using PBIS Open. The script works and connects computers to the domain just fine almost every time. After awhile though, a ...
0
votes
2answers
40 views

Can i make a commad execute in background without producing any output?

Is there a way or an option to make a command run in the background without the need to wait for it to end to get the prompt back? (just like mplayer command to play a music file in the background and ...
2
votes
3answers
88 views

Can i edit a bash shell command?

I just wants to modify a bash shell command like exit so when i write exit in the terminal it clears the screen, and echo some text, wait 2 seconds, then execute the exit function. So is there any way ...
0
votes
2answers
31 views

Create a dir on scratch with same name as in pwd directory

HI I try to simplify my problem, I'm trying to write a bash script, which can take the actual directory name (just like you get by statement "basename" ) and create a same directory on scratch. ...
0
votes
1answer
53 views

How can I split a line in 2 by words/characters? (Bash) (Regex)

I would like to convert: Hello Hello Hi Hello Hello Hi Hi Hi Hi Hello To: Hello Hello Hi Hello Hello Hi Hi Hi Hi Hello I want to split a single line in 2, by having them have the closest amount ...
0
votes
3answers
52 views

How to add executable bash script on ubuntu startup

I have created a executable bash script (using chmod +x) for monitoring my system and it works perfectly with out any error. Now i want to add this script on my start up in order to executing the ...
0
votes
0answers
28 views

sed error Bash script

So here's the deal I'm trying to do some auto editing of a file with sed in a bash script. Here's my code: systemdate=$(date) sudo mkdir "/tmp/autoupdate" sudo echo "$systemdate" > ...
0
votes
1answer
27 views

How to execute a script from trusted shell

I am new to Linux. I have copied the bash program from bin to a thumb drive. I have renamed it to "ebash". Now I connect this thumb drive to other Linux machine. I have mounted this drive and ...
0
votes
3answers
63 views

Help with a Bash script or some program to sort files and move to different folders

is there anyone out there who can help me sort some files with a bash script or terminal commands (or even a little Java program) that can be used to sort and and move files to new folders? I have ...
2
votes
1answer
32 views

Join two files keeping the element order of one of them

I have two files File1 03873 03872 03871 03870 ...... File2 00001 0.867 00002 0.855 00003 0.864 00004 0.855 ... 03870 0.825 03871 0.852 03872 0.326 03873 0.852 I want to ...
3
votes
4answers
63 views

Replace string with multiline file content

I need to replace string SALT in a file with content of another file. Problem is that the input file has multilines. I tried something like this in my bash script: SALT=`cat salt.txt`; sed ...
1
vote
0answers
17 views

Unresolved dependenices after trying to reinstall ROS

I tried to re-install ROS because of issues with not finding system paths correctly and now all I can see is a black screen when I turn on the computer. In tty1, when I try sudo apt-get install ...
0
votes
2answers
60 views

Navigate the web with the terminal

I'm trying to learn how to use the terminal, and I want to try sending and receiving data from a common website like Amazon or Google. I want the terminal to enter a string into a website's search ...
0
votes
0answers
40 views

How to I clear bash history completely in Ubuntu 14.04?

How do I completely clear bash history from Ubuntu 14.04? I tried the command "cat /dev/null > ~/.bash_history" and other commands I found, such as "cat /dev/null > ~/.bash_history", but none of ...
5
votes
0answers
145 views

How to clear system tray notification via command line

I have an application which produces system notification every 5 seconds. Overtime the notification tray I have (Gnome env) gets crowded. How can I clear it like every minute but I need to do this ...
0
votes
1answer
25 views

Sublime Text does not launch under gksudo

Sublime Text does not launch under gksudo. If I start it directly sudo subl it works, but gksudo subl fails. Also, how can I get a list of programs that can run from terminal straight away ...
0
votes
0answers
19 views

How do I remove W: Duplicate sources.list entry [duplicate]

W: Duplicate sources.list entry http://download.opensuse.org/repositories/home:/osmc/xUbuntu_14.04/ Packages ...
0
votes
1answer
38 views

Packaging bash script with dh-make

I have installed dh-make by installing other packages as recommended by this page which depend on it (I am listing all packages which could have installed it as well because I am not certain which one ...
0
votes
1answer
49 views

shell script for wifi connection via terminal

How to write shell script that will automate interactive steps to connect to wifi via terminal? Steps outlined in How do I connect to a WPA wifi network using the command line? with further details: ...
3
votes
3answers
194 views

How to label occurences of text?

I would like to convert blue blue red green to: color.1=blue color.2=blue color.3=red color.4=green Any leads on how to tackle this? sed, awk, etc.?
0
votes
2answers
29 views

Bash “move files” error message

I am trying to move some files based on a search pattern using bash but I get an error message. Here is the borrowed script format I used and the error message. Thanks! #!/bin/bash firstdir=dir1 ...
1
vote
1answer
35 views

bash - using lftp to mirror specific files from remote folder

I want to mirror files from a remote directory via ftp. The following code works: lftp -c 'open ipaddress; user myusername mypassword; mirror -e /files/ /home/user/files/retrieve/; quit' However, ...
2
votes
1answer
47 views

cannot exec 'anything' : no such file or directory screen

I’m running some call of duty game servers with screen. I have a start.sh: #!/bin/bash user=cabe game=cod verision=cod1.5 server=xxx.xx.xxx:28970 mod= ip=xxx.xx.xxx port=28970 punkbuster=1 ...
1
vote
0answers
27 views

How do I run as bash script from a WebApp?

I currently am developing a custom Ubuntu dist. that runs a dedicated Kiosk app upon boot. I would like an easy method to shutdown from inside the Kiosk app, but I am currently at a standstill at what ...
1
vote
1answer
73 views

Run script in Terminal via context menu (Open with Terminal)?

this question is simple about "Open/Run in Terminal".... Looks Ubunutu doesn't support bash/shell-scripts the way we know from KDE and any other OS: I tried the obvious: Right click in file ...