Tagged Questions

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

learn more… | top users | synonyms (1)

0
votes
1answer
65 views

How to fix invalid identifier error after setting environment variables?

I'm trying to setup cocos2dx in Ubuntu 14.04 LTS but after setting the environmental variables (in .bashrc) I start getting this error: bash: export: dev/cocos2d-x-3.2/tools/cocos2d-console/bin': not ...
1
vote
2answers
61 views

How do you clear, delete, or hide a portion of your history in the Terminal?

clear will not work, because that clears your screen. What I am looking to do is just hide, delete, or obfuscate a portion of history on my display in my session, namely a command that I inputted that ...
2
votes
3answers
89 views

Search for a files that matches another file name in another folder

I have some files in a folder, which are named ***_code_c**** (where * represents any letter or number). I have another folder that have many files, folders and subfolders inside it. What I want to do ...
0
votes
2answers
74 views

Rename files in subfolders with parent folder names

I have a main directory that has four folders f1, f2, f3 and f4 each of these folders has 10 folders, and each of these 10 folders ff1...ff10 has some .jpeg images with some names lets say image1.... ...
26
votes
2answers
11k views

Explanation of the command to check shellshock

Here is the command I have used to check my bash shell for the Shellshock bug: env x='() { :;}; echo vulnerable' bash -c "echo this is a test" Can anyone please explain the command in details?
8
votes
4answers
500 views

Can I use cd../.. as an alias name?

I am using Windows and Ubuntu in parallel and do console stuff on both of them. On Windows I can do a C:\Users\Thomas>cd..\.. C:\> However, on Linux this does not work, neither with ...
0
votes
2answers
761 views

Ubuntu Trusty can't update bash

I'm trying to upgrade bash to the latest version to fix the bash vulnerability, but my machine can't seem to find the new package to install. Don't know what I'm doing wrong. user@machine:~$ env ...
6
votes
2answers
187 views

How can I delete numbered files in a given range?

I have folderA that has some files with a number sequence starting with a_000000. What I want to do is to delete files starting from a specific number: let's say a_000750 till the end of files in this ...
1
vote
1answer
723 views

No longer see Bash warning messages for Shellshock after update

I just updated Ubuntu from an Update pop-up. I am aware of Shellshock, so I quickly went ahead with the install. Now, when I try running env x='() { :;}; echo vulnerable' bash -c 'echo hello' I ...
0
votes
1answer
184 views

bash version does not change

bash has been updated at least twice in the last two days, but the output of bash --version did not change. Its first line keeps saying: GNU bash, version 4.3.11(1)-release (x86_64-pc-linux-gnu) ...
0
votes
0answers
22 views

Creating an alias with tab completion

I know how to create a permanent alias, just edit .bashrc . I created alias forsudo apt-get install <appname> . As you may not know the exact name of app or want to check the dependency u can ...
0
votes
1answer
237 views

Bash Shellshock Fix Applied But Seems that Additional Fix is Required

First time using this Ubuntu Forum, Not sure if this is right place to raise this issue. Anyway, I am having a Ubuntu 14-04 VPS running. I have applied: sudo apt-get update && sudo apt-get ...
0
votes
1answer
27 views

save number of lines of a text file in a variable shell file

I'm working on terminal and running a .sh file and I want to count the lines in another file and save it as a variable to be used in this .sh file. I'm using this command sed -n '$=' /lines.txt when I ...
5
votes
2answers
257 views

How to do: underline, bold, italic, strikethrough, color, background, and size in Gnome Terminal?

How to do: underline, bold, italic, strikethrough, and color in Gnome Terminal? Bold Italic u̲n̲d̲e̲r̲l̲i̲n̲e̲ s̶t̶r̶i̶k̶e̶ ̶i̶t̶ ̶l̶i̶k̶̶e̶ ̶i̶t̶s̶ ̶h̶o̶t Color background font < (its mono ...
0
votes
0answers
36 views

Bash Script for adding Keyboard Layout to available Layouts

I am writing a bash script to add a layout (Urdu as input language) to the available keyboard layouts. The current status is: script automatically detects the current layout, as a string. adds te ...
0
votes
0answers
70 views

How to make apt update everything with cron-apt?

For my 14.04 server, I've set up cron-apt to update every day at 4'o clock. Today I've reviewed /var/log/cron-apt/log to make sure it has updated bash to fix shellshock. And indeed, it has updated ...
1
vote
3answers
59 views

How to get list of all non-removable disk device names (SSD/HDD and SATA/IDE only)?

I need a list of all disk device names (not USB or CD ROM) in the following form DRIVES='sda sdb' so that I can loop through them in a bash script. Ideal solution would not have to install a special ...
5
votes
4answers
263 views

Redirect pipe output to the same file

Is there any short way to save the pipe output to the same file that it's processed. For example, this is what I am actually doing $ cat filename | sort | uniq > result $ rm -f filename $ mv ...
0
votes
1answer
215 views

shellshock vulnerability and super user

can shellshock vulnerability execute somehow commands with superuser permissions? And if yes, from where/how? It is possible to be executed commands from cgi yes, but is it possible to get executed ...
1
vote
1answer
1k views

How do I know if my system is vulnerable to the ShockShell vulnerability? [duplicate]

The recently discovered ShockShell vulnerability affects many Linux and Mac systems, because they are using the vulnerable BASH shell. How do I know if I am vulnerable to this attack and how do I ...
2
votes
2answers
236 views

CVE-2014-6271 over ssh example attack?

I've been reading about the CVE-2014-6271 bug on lots of pages, but I'm still not able to understand how exactly is it possible to exploit it over ssh. From all I've read, I couldn't find an example ...
1
vote
1answer
52 views

How To: Keep running script only when the network (internet connection) is idle?

I have a script (actually, a Rails application with a Sidekiq job queue system), which uploads pictures and albums to Flickr. This data is huge for my purposes (around 100GB), and the upload is slow ...
0
votes
0answers
219 views

How do I upgrade from 12.10 on a DigitalOcean droplet?

The recent ShellShock exploit has prompted me to upgrade my Ubuntu 12.10 server, as I cannot upgrade bash on it (I receive 404 errors on apt-get-update (somebody else with a similar issue)). I opened ...
1
vote
0answers
352 views

How to Patch for Shellshock [duplicate]

So, in light of this closed thread, and this article, how can we patch for the shellshock bug/exploit/vulnerability for currently supported Ubuntu versions? 13.10 and 14.04?
0
votes
0answers
99 views

How to resolve the bash bug in ubuntu? [duplicate]

There is a bash bug reported ,worse than Heartbleed.How to resolve this?Is there a package to install in ubuntu? Thanks ...
126
votes
5answers
88k views

What is the CVE-2014-6271 bash vulnerability (Shellshock) and how do I fix it?

Recently, there have been news going around regarding "CVE-2014-6271" (See USN-2362-1), which is a vulnerability in Bash. How do I know if I am affected by this, how can I fix it, and why should I ...
4
votes
2answers
3k views

CVE-2014-6271 bash patch trouble

I have a Ubuntu [EDIT] 12.04.4 LTS server that is vulnerable to the recent bash remote executable exploit. Ubuntu says they have released a patch here. I have run a sudo apt-get update && ...
0
votes
0answers
12 views

Get status of background process

Let's say I have started a process in the background: e.g. tar [...] | pv [...] & pv has the PID 1234 and normally reports it's progress to stdout. The job was started as a cronjob so there is ...
0
votes
1answer
29 views

echo “${txtred}Text${txtrst}” color not always working

I have a .sh file through terminal and I'm using echo "${txtred}Text${txtrst}" as a display of what's happening when running the script. But sometimes the color is not red, although I used {txtred}. I ...
0
votes
1answer
40 views

Script Not Running Properly On Server

I am having an issue with my webserver. I am testing it out on a new kernel build and it seems as if I can't get one certain part running on it. All of my scripts work except this one. Every file ...
0
votes
1answer
82 views

How do I use a shell command as a launcher shortcut? [duplicate]

The following command from terminal works perfectly: sh /home/flux/Downloads/TeamSpeak3-Client-linux_amd64/ts3client_runscript.sh How would I go about adding this as a shortcut, so I can open ...
3
votes
1answer
64 views

mkdir crashes bash

I'm trying to create a directory in my home directory but the shell itself keeps crashing. I have permission to write to the directory. I am able to create files in the directory via touch. I can ...
1
vote
1answer
66 views

script.sh run differently when manually opening terminal and when using .desktop launcher

I have a script file script1.sh as shown below: #!/usr/bin/env bash cd /home/userA/scripts . r1.sh when I manually open a terminal and run it using . script.sh it works fine. But when I created ...
1
vote
1answer
52 views

shell file opens terminal and run a sequence of commands in specific order

What I used to do is: Manually open a terminal instance to run the following commands and shell files Run PACKAGE_PATH=/home/userA/package1:/home/userA/package2:$PACKAGE_PAT‌​H run: cd ...
0
votes
1answer
45 views

feedingbottle/n”export: No such file or directory

I'm noob in linux, so i install feedingbottle, but then I open terminal showing this: bash: ...
1
vote
1answer
87 views

how to run command in an already opened terminal through a shell script

I'm running a shell script.sh which is supposed to open terminal and then run some commands in this opened terminal. What happens is that the terminal starts but the following commands are not ...
0
votes
1answer
35 views

Desktop Launcher executing a sequence of commands after opening a terminal

I've created a .desktop launcher as shown below which successfully opens terminal. What I want to do next is to run the following commands such as cd home/userA/scripts then ...
0
votes
0answers
13 views

How to truncate directory name in terminal? [duplicate]

Something like ../parent folder/current folder instead of 8 different directories as mine currently is when I'm accessing deep files.
-1
votes
1answer
65 views

At what time does bash scripts execute? [closed]

I would like to run a bash script at system startup. I read recently that some bash scripts are executed before logging in to a user account, others, after. Can I get some information on when bash ...
0
votes
0answers
45 views

Shell script loop stops by itself

I have two script files like this. execute.sh #!/bin/bash #259200seconds = 5 days end=$((SECONDS+432000)) x=0 cp /dev/null ~/kill_start.txt while [ $SECONDS -lt $end ] do [[ $(cat ...
1
vote
1answer
42 views

Copying files and folders with cp with shopt extglob - error is not a directory

I'm trying to copy files from a directory while excluding a folder and a file. My problem is that a get an error with shopt extglob activated. Here is my code: ...
0
votes
1answer
43 views

Run some shell files from another shell file in different location

I have 5 shell files in a specific locations on my ubuntu system. I have two users on this system userA which is the main user and userB. Currently I have to manually open a terminal using user userA ...
4
votes
4answers
1k views

Why is the output of _$ _ when executed on a terminal?

I have executed the following command sequence: $ now=$(date) $ echo _$now_ _ $ echo _ $now _ _ Mon Sep 22 09:53:44 IST 2014 _ Why is the output of _$now_ only _?
2
votes
1answer
138 views

Stopping a running script though another script file

I am new to shell scripts. Say, I start a script like this. This runs for 3 days. So, I will start the script remotely through ssh and then close my local terminal. start.sh end=$((SECONDS+259200)) ...
-1
votes
1answer
20 views

Redirected Output

I just used a command ls -l > ~/ls_output in my /usr/bin directory and I'm not sure what happened. The terminal accepted my command but I don't know what happened to the output or where it went. ...
-1
votes
1answer
158 views

Ubuntu 14.04 - Desktop icon is not running my BASH script

I have a simple script runme.sh which works when i run from terminal. #!/bin/bash chromium-browser "https://askubuntu.com/" But i need to make it now runnable for normal Users. So i place a desktop ...
2
votes
1answer
42 views

post-receive: No such file or directory

I'm getting an error when trying to push to a remote Amazon EC2 (Ubuntu Linux) instance. I've given all related directories and files full permissions. I'm trying to use a post-receive hook to move ...
1
vote
2answers
58 views

Unable to delete file

I am unable to delete file: sudo rm /usr/local/bin/Katy Perry - Dark Horse (Official) ft. Juicy J-0KSOMA3QBU0.mp4.part It is showing an error: bash: syntax error near unexpected token `(' How to ...
1
vote
2answers
79 views

Only display a range of entries from the bash history

Is it possible to set a fixed number for the "history" command to only show a certain amount of history items like 100, instead of everything from the beginning of time?
1
vote
0answers
46 views

Display running clock in terminal [duplicate]

I want to display running clock inside terminal. I have already gone through this answer but this method only works in zsh terminal. But I want to display in bash. Is there any other way to display ...