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

learn more… | top users | synonyms (1)

1
vote
2answers
378 views

gibberish command not found on bash terminal startup

I have run across an issue that I just cannot seem to figure out. When I start my terminal in ubuntu (14.04) I get the message sdfsdfsdi: command not found As you can see it just looks like ...
7
votes
4answers
784 views

What do the paranthesis and $ sign mean in echo $(ls)

The output of # ls and # echo $(ls) are the same. What exactly does the $ sign and the parenthesis mean? Also, what is going on a technical level that causes the output of these two commands ...
1
vote
2answers
421 views

How to run commands from a bash file the way they run from terminal?

Sorry for my probably very naive question. What I mean is: how to create an executable script/bash file that would run more complex commands, commands which must normally be put in a terminal? ...
0
votes
1answer
144 views

Where does the output of a script that was run at startup go? [duplicate]

I have a script which is run at startup from rc.local, I don't redirect the output anywhere. When I first wrote it, I ran it in a shell, it worked as I expected and continually poured characters out ...
3
votes
1answer
2k views

Terminal flashing between current and previous screen

I just upgraded from Ubuntu 12.04 to 14.04. After upgrading the terminal will sometimes, but not always, flash between the current screen and the previous screen. Here are some examples: The output ...
0
votes
2answers
322 views

updating my path not working

I want to add a script directory in my home directory (for something different then just adding to bin). I keep getting "No such file or directory" after updating. Now I noticed that in the GUI file ...
3
votes
1answer
208 views

jumping cursor when using python interpreter in terminal

When I am typing in a long command while using the python interpreter in terminal, the cursor will suddenly jump all the way back to the beginning of the line that was just typed and start ...
2
votes
1answer
474 views

Move Files To Directories Based on File Name

I have files that download to one directory (/media/Downloads/Complete/Movies) but need a bash script that moves them to the destination directory based on file name (/media/Movies_A & ...
0
votes
1answer
171 views

unable to execute .sh scripts - only on one pc

This is an unusual problem for me - what would cause one pc to suddenly be unable to execute an install.sh script, yet two other pcs with the same OS have no problem doing so? I get various errors ...
0
votes
1answer
881 views

Run commands on system shutdown/reboot/logout [duplicate]

I would like to run certain aliases and simple commands when system shuts down or reboots or when I simply log out of system. This would help a lot as I usually forget about shutting down vagrant ( ...
-1
votes
2answers
543 views
7
votes
1answer
1k views

Why is $0 set to -bash?

First login process name seems to be set to -bash, but if I subshell then it becomes bash. for example: root@nowere:~# echo $0 -bash root@nowere:~# bash root@nowere:~# echo $0 bash -bash is ...
0
votes
2answers
4k views

sudo bash can't execute script

I try to run a shell script file but failed so far on Ubuntu. In my terminal: ~/Desktop/FTL/data$ ls amd64 exe_icon.bmp FTL licenses resources x86 ~/Desktop/FTL/data$ sudo bash ./FTL.sh [sudo] ...
7
votes
2answers
3k views

uniq command not working properly?

So I'm checking the md5 hash of my files with this as my output: 657cf4512a77bf47c39a0482be8e41e0 ./dupes2.txt 657cf4512a77bf47c39a0482be8e41e0 ./dupes.txt 8d60a927ce0f411ec94ac26a4785f749 ...
1
vote
2answers
683 views

“mv” versus “cp” in a bash script [closed]

I am attempting to make a script that will be able to load up some settings and files to a board. Basically I will plus a flash drive into the board click on the script. The script will then ...
0
votes
1answer
285 views

provide more than one processor with taskset

I am using taskset to assign CPU cores 4-7 to a java process that normally uses ~200-400% CPU. The cores 4-7 were isolated on boot so only the java process should run on them. Eventually taskset ...
0
votes
1answer
276 views

autogen.sh can't find “ fontconfig” package

ran autogen.sh and get the error "package 'fontconfig' not found". I also get the suggestion to adjust the 'PKG_CONFIG_PATH' enviroment variable and/or variables "FONTCONFIG_CFLAGS" and ...
1
vote
1answer
163 views

enable and disable VPN from bash

I have a number of VPN hosts which I need to access periodically. They are configured and connections work fine off the network manager. I'd like to be able to enable and disable them as needed from ...
0
votes
2answers
74 views

Problem with bash script [duplicate]

I have a little problem with a script of mine. I execute a command in background using sudo and I try to retrieve the PID of the command in a variable. the code is the following: #!/bin/bash sudo ...
2
votes
1answer
3k views

Terminal Command to Zoom

I've been looking for this for a while, and I can't find it anywhere. I need to be able to zoom (equivalent of ctrl + shift + '+') via the terminal. I've tried xdotool, but do not know how to get it ...
2
votes
2answers
565 views

lowercase to all files in a directory expecting to undo it at some point

Okay, so I want to batch rename files (and files within subdirectories) in a directory to lowercase, but I also want to undo that at some point. Should I store their real names somewhere so I can go ...
14
votes
5answers
18k views

Search for duplicate file names within folder hierarchy?

I have a folder called img, this folder has many levels of sub-folders, all of which containing images. I am going to import them into an image server. Normally images (or any files) can have the ...
0
votes
1answer
370 views

Ubuntu bash if lessthan else condition returning error [: -lt: argument expected

I am doing the following script to know if profit or loss from entered selling price and cost price as; echo enter selling price read sprice echo enter costprice read cprice if [ $sprice -lt $cp ] ...
2
votes
1answer
8k views

Shellshock: How can I update only Bash without restarting?

I want to fix the Shellshock issue, and the usual solution is to update Ubuntu. How can I update only Bash and without having to reboot?
1
vote
2answers
371 views

Select Top N files based on modification date and rsync them

I'm fairly new to linux and I'm trying to transfer some N files based on Modification Date. I've found this commandls -tr | head -100, which to my understanding, will list the Top 100 Files (head ...
1
vote
1answer
268 views

What environment does xargs pass to grep?

I am trying to search for two strings in a file. This is the command that I am using grep -l -r ads2gas | xargs grep vp8 For some reasdon the second grep is not working correctly. I am getting "no ...
0
votes
1answer
416 views

git push script, only if difference

I've found some nice questions illustrating how one would write a script automating git push/pull with cron here and here, but I want to elaborate on that slightly. I only want to push/pull if there ...
2
votes
1answer
68 views

Trouble with simple script :(

Could someone please tell me why this script doesn't run correctly. Seems to be a problem with the if statement as i keep getting the error: /home/sinttx/Development/backup/ddbackup.sh: line 18: ...
1
vote
1answer
202 views

How to create your own commands that can be used anywhere [duplicate]

I am new to linux, and I am learning bash scripting at the moment. I was wondering how I would save my script as a command and then be able to call that command anywhere in the terminal. So i could ...
1
vote
1answer
3k views

/var/log/secure not present in 14.04 ,is there any alternative?

While reading about Linux ,especially about sudo I got:: A message such as the following would appear in a system log file (usually /var/log/secure) when trying to execute sudo bash without ...
0
votes
1answer
48 views

Backup function

I am attempting to make a function that you provide it a file name, it then make a back up of the file and slaps on a time stamp to mark the file. Once it time stamps the file it prints out all files ...
1
vote
1answer
140 views

why my bash script only outputs one line on echoing awk variable

Anyone can probably tell I'm new at scripting and have tried doing as much homewaork before posting here. I have what I think is a simple script parsing out DNS zone file for IP and unique domain ...
1
vote
1answer
47 views

restore patched bash to apt maintained

Last month I manually patched bash on a server running ubuntu 11.10 for the shellshock bug, as suggested in the comments here: What is the CVE-2014-6271 bash vulnerability (Shellshock) and how do I ...
11
votes
5answers
16k views

What does >> or double Angle brackets mean? [duplicate]

It seems like such a simple questions but I cant find any resource regarding it In C/C++ , it means to store the read in a value from command prompt and store it inside a variable , How about in ...
1
vote
1answer
28 views

One time “firmware” upgrade script

I was wondering how you could make a script so that on first boot it changes files to a specific parameters? So it would be like if I just installed a fresh kernel. I want to run a script once and ...
5
votes
2answers
452 views

How to easily make an alias command permanent? [duplicate]

I search everywhere and almost everyone was suggesting to open the ~/.bashrc or ~/.bash_aliases, then put the alias command there, I created a function name palias as permanent alias function and put ...
8
votes
3answers
18k views

Where is the bash history for the root user saved?

I'm not talking about .bash_history from my home directory. I usually prefer to use sudo -i or sudo su and then run commands as root user. Since, after these commands the history is not saved in the ...
0
votes
1answer
379 views

Does Ubuntu 14.10 have the security fix for Shellshock bash exploit? [duplicate]

On the internet, I noticed there were Patches for the Shellshock vulnerability which is scaring me a lot. Does Ubuntu 14.10 have this automatically in it?
-1
votes
1answer
327 views

How can i fix this bash problem?

I am trying to set xinput to run at startup to switch some mouse button functions. The problem though is it is not working obviously. I want to go from this: xinput set-button-map 8 1 2 3 4 5 6 7 8 ...
9
votes
2answers
2k views

What does the first '.' mean in '. ~/.bashrc'? [duplicate]

I saw a post about fix your alias in .bashrc. And he says after you put your alias in .bashrc , you need to use: . ~/.bashrc I do not quite understand what the first dot(' . ') does here. What's ...
0
votes
1answer
64 views

Changing SH Directory

I want to have a main launcher that executes a python program The directory is /Downloads/Test/ #!/bin/bash/ python Test.py I want to be able to run the file in the terminal, without the following ...
0
votes
1answer
536 views

Echo to file apparently needs double escaping backslash (\\\n) to write \n. Why?

As per the graylog2 docs, I need to add this line to my rsyslog.conf: $template GRAYLOGRFC5424,"<%pri%>%protocol-version% %timestamp:::date-rfc3339% %HOSTNAME% %app-name% %procid% %msg% \n" ...
31
votes
2answers
19k 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?
6
votes
2answers
8k views

How do I remove all metadata from a quicktime movie file?

My camera takes .mov files as movies. How can I remove all metadata from them so I can feel confident sharing them on youtube without accidentally sharing when/where they were filmed, what type of ...
0
votes
2answers
165 views

Install only bash from trusty on old distributions (to be save from Shellshock vulnerability)

Is there a way to just install only bash from the latest distribution on an old mashine? I once did pinning to a certain version of a package, but that was bevcause I didn't want to update that ...
0
votes
1answer
91 views

Need Help Improving Script

I have a group of folders (L1N-L5N), in which I want to copy from my /home/michael/documents/XXX to my Dropbox folder. At present, I have used the following script: #!/bin/sh cp -ra ...
17
votes
1answer
2k views

What does su > echo “<username>” mean?

When I was entering the command su > echo "sachin" it was asking for a password. When I gave my password, some strange things happened as you can see: One more thing: there is another user, ...
0
votes
3answers
56 views

What's the easiest way to list files of a given extension, save that list to a text file, but omitting the actual extensions when in the text file?

This is for a counterstrike server, where mapcycle.txt contains all the maps found in the maps/ folder, but the list of maps must not contain the .bsp extension. Example of maps/ folder: map1.bsp ...
2
votes
2answers
706 views

How to write bash actions to a file?

I know that there is a way to write bash shell outputs to a file. However, I want to know what commands have been executed by an application as some of these executions are not outputted as a shell ...
1
vote
0answers
180 views

Unable to reproduce the ShellShock bug locally

I have been trying to reproduce the Shellshock bug on my local 14.04 Ubuntu VM without any luck. I know my local bash version is still vulnerable because the following command prints out the commented ...