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

learn more… | top users | synonyms (1)

0
votes
1answer
239 views

What does the 'sudo -s' command do, and how is it used in this example?

I have the following doubt. In a tutorial related to a software installation that I am following say that I have to execute the following commands (I am doing it into an ssh shell, so this list of ...
0
votes
3answers
295 views

alias/function with command line arguments

I'm tired of typing manage.py startserver 10.211.55.4:4000, so decided to make an alias for that. Only thing is: the port sometime changes. So I did this in bash profile: function runserver() { ...
0
votes
2answers
93 views

Something is wrong with my bash prompt?

So when I type with my new bash prompt it goes on for a while, but if the command gets to long it loops around itself and writes over bash prompt. Here is my PS1 : PS1='\e[0;34m\A\e[m | ...
0
votes
1answer
229 views

Help writing server script to ban IP's from a list

I have a VPS that I use as an openvpn and web server. For some reason, my apache log files are filled with thousands of these hack attempts: "POST /xmlrpc.php HTTP/1.0" 404 395 These attack attempts ...
0
votes
4answers
8k views

Creating A Simple Bash Script With Multiple Commands [duplicate]

Trying to create a bash script that opens gnome-terminal, and then runs ls to display the contents of a directory, but it just opens gnome-terminal. I will be creating some other scripts that also use ...
0
votes
2answers
204 views

Redirecting output to std output or /dev/null depending on optional parameter

I have a script where you can run it just like this ./myscript and the output of some commands called inside the script are hidden, just like this: if mvn tomcat:deploy &> /dev/null; then ...
1
vote
1answer
50 views

Changing current directory to directory that have identifier as the substring

My terminal is currently in the home directory, and the home directory contains a directory which have "round" as the substring. Is there any way to directly change to that directory without typing ...
2
votes
1answer
75 views

What do the '?', '.' and '+' symbols mean when I run 'who -aH'?

What does the plus sign (+), question mark (?) and period (.) mean in the idle column when I run who -aH? I tried Google, but the results are all about regular expression and wildcards. EDIT: I ...
6
votes
2answers
3k views

Hiding output of a command

I have a script where it checks whether a package is installed or not and whether the port 8080 is being used by a particular process or not. I am not experienced at all with bash, so I did something ...
1
vote
2answers
666 views

Running shellscript with cronjob is making problems, executing manually not. Ideas?

I made a shell script called /home/root/cron_grads.sh (chmodded 755) on my server. In this directory are more grads-scripts like 500hPa_p0.gs (644). My main script creates a temporary file ...
1
vote
2answers
152 views

how can i find all files that contain embedded crc32's

how can I find all files that contain embedded crc32's e.g. Mydocument190_[F285E17D].pdf using the find command to clarify the crc32's are always within brackets [F285E17D] and the file names may ...
1
vote
1answer
86 views

Install bashmark on ubuntu 12.04

I followed the instructions at this page: http://www.huyng.com/projects/bashmarks/ to install bashmark on ubuntu. I have not understood what the guide mean with "add source ~/.local/bin/bashmarks.sh ...
9
votes
4answers
33k views

How to check the process is already running or not

I want to check the particular process in already running or not. I refereed this Q&A. But I didn't get any specific solution. Following is the example that I tried: I have created abc.sh file ...
1
vote
2answers
443 views

How to create a script which opens the browser and logins to a particular Gmail account?

I have created a bash script login.sh. I want it to open the browser and login to my Gmail account. I tried using the following command to open the browser with www.gmail.com. xdg-open ...
21
votes
3answers
3k views

Why does “A=10 echo $A” not print 10?

This command: A=10 echo $A prints an empty line. Why not 10? Why doesn't the in-place temporary environment setting work? I want to know the reason and explanation rather than solution. I used ...
1
vote
2answers
2k views

bash: config.sh: No such file or directory

Whenever I open my terminal, it displays bash: config.sh: No such file or directory followed by the command prompt in the next line. My .bashrc file contains: source config.sh I mainly use Ubuntu ...
0
votes
1answer
248 views

Bash script not adding variables to session [duplicate]

I have a bash script that I have added as a startup application. It does a bunch of exports and alias assignment. #! /bin/bash alias devhm='cd ${DEV_HOME}; ll'; alias wlhm='cd ${WL_HOME}; ll'; alias ...
16
votes
4answers
4k views

Why does terminal auto complete sometimes not suggest anything for the `services` command?

Sometimes, when I type a command on the terminal, the terminal's autocomplete does not work, even if my command is not wrong. For example, take look to this: sudo service vsftpd status sudo and ...
3
votes
1answer
76 views

Destroy a juju service and also its associated machine

I'm looking for a way to automatically destroy the associated machine after destroying a service with: juju destroy-service [service_name] I know I can do: juju destroy-machine --force ...
0
votes
1answer
63 views

How to set bashrc shell environment

I would like to add _ENV to my bash so once I ssh to the server it shows something like this: [live][root@server ~]# or [dev][root@server ~]# How can I do this? I have been looking everywhere ...
0
votes
1answer
155 views

Permission error trying this backup script

I am trying this Backup Shell Script from the server guide. Granted it's for my desktop running Xubuntu 14.04. The NFS is mounted and accessible. The script has been created and edited with the ...
2
votes
3answers
617 views

How can I compare two directories recursively and check if one of the directories contains the other?

I have two directories, they contain common files. I want to know if one directory contains the same file as the other. I found a script on the net but I want to need improve it to do recursively. ...
1
vote
2answers
965 views

installing rvm in 12.04 ubuntu which is on virtualbox

I have tried a lot of methods but cant get this done. I am trying to install rvm on 12.04 ubuntu. There has been many problems in past like this and I have referred as much as I can and still nothing ...
1
vote
2answers
124 views

What are the standard Environment variables ($) in Ubuntu?

I know some useful environment-variables like $HOME, $UID, $BASH, $LOGNAME etc. which is useful to get information in terminal/command-line with using echo(ex: echo $LOGNAME) I want to know what are ...
5
votes
1answer
3k views

What does echo with “>>” symbol do?

I've seen some command like echo '* - nofile 65535' >> /etc/security/limits.conf I know echo print something on the screen. and limits.conf was a file in that /etc/security path. But want ...
1
vote
1answer
829 views

How do I write a script to output an html file?

What am I doing wrong in this script? #!/bin/bash cat > /tmp/flash-viewer.htm <<- _EOF_ <HTML><HEAD><TITLE>Flash Viewer</TITLE></HEAD><BODY> <object ...
40
votes
5answers
15k views

Shortcut to clear command line terminal [duplicate]

Is there a shortcut to clear the command line when typing in it instead of keeping backspace pressed for a few long seconds? I ask because I regularly use the Tab key to automatically fill in file ...
0
votes
2answers
772 views

How to fix symbolic links after switching from Bash to ZSH

I had bash as my default shell even though I was only using zsh. I always started it myself by opening the terminal and typing zsh. Today I decided to use it as my default shell. So I found this ...
1
vote
3answers
485 views

Python command in bash does not find -c flag

I have two python lines in my bash script, both should run with -c flag, but once I run the Bash script it tells me that it could not find -c flag that is needed for python to run the command in Bash. ...
25
votes
4answers
3k views

What is the meaning of $$1 in bash?

I am actually playing with arguments and its happened. I just thought like to see what will happen if I type $$1 and I did it and got something below. raja@raja-BONEFISH:~$ $$1 19301: command not ...
7
votes
3answers
19k views

Tomcat does not recognize JAVA_HOME

I've installed Ubuntu 14.04 Server, extracted JDK1.8u5 and Tomcat7, and added the following to .profile (I also tried adding it to .bashrc with similar [non-] results): export ...
1
vote
2answers
423 views

After being root, the custom .bashrc file no longer runs?

I modified my .bashrc file to customize my terminal. I modified the else PS1 statement to the one I needed and it works fine but when I login as root it switched back to the one it originally had. How ...
2
votes
1answer
558 views

Can you use gnome keyring in bash script, if yes then how?

I am developing a automated mounting script for Windows shares. I have finished the script and it works just fine, but is it possible to add Gnome Keyring to the bash so once user writes hes/hers ...
0
votes
2answers
68 views

argument-aware alias command?

I want to create an alias for curl which automatically writes the file it curls into a file with the same name in the current directory. For example: % curl https://bootstrap.pypa.io/get-pip.py ...
2
votes
2answers
777 views

Bash login script with zenity for CIFS mount

I am writing a mount script for Windows share to run after login. I have done it with bash and zenity and it works, but now I need to make it better so if username field and password field are empty ...
1
vote
2answers
2k views

how do I enable ccache

I am completely noob at this, i don't know what the make file is, and I don't know what bashrc is. but i do know where to download source code and use source somebash.sh then make file (as was told ...
0
votes
1answer
40 views

How to get autocompletion with “>|”?

When trying to empty a text file with >| filename why doesn't bash's autocomplete work for the file name? Is there anyway to allow autocompletion like any other terminal command?
1
vote
2answers
621 views

How to use time command in bash, to sum sys + user time, and output it as milliseconds?

The time command returns a table like this? real 0m1.607s user 0m0.154s sys 0m0.032s I am running this inside a shell script. What's the simplest way to process time output so ...
1
vote
0answers
58 views

On Trusty, what is CL program to create desktop configuration file?

On Precise, I used to create a desktop configuration file with my own GUI wrapper which called the gnome-desktop-item-edit command line program (part of the gnome-panel package) which had the ...
1
vote
3answers
537 views

How to install RevKit

I’m trying to install a software called RevKit on Ubuntu 12.10 and the following instructions1 need to be followed: RevKit can be downloaded from the www.revkit.org website. Opening a Bash ...
2
votes
1answer
4k views

Get total diskspace usign du for multiple directories

I know about du -sh which gives me total disk space used for given directory. My problem is the directories I am interested are scattered in lot of subdirectories. I have right "find" command that ...
1
vote
1answer
88 views

Mapping Directories/path to another

Ok, so I have two programs which use the same MASSIVE data files, located in /public_mm/DB/ /public_semrep/DATA/DB/ Is it possible to map one of these paths to the other folder so I don't have to ...
0
votes
1answer
116 views

Script to open vlc with local ip and port

I am trying to create a script to open vlc with my local ip and port 8888. My current script: #!/bin/bash vlc http://10.0.0.1:8888/ This works fine, but when I go to another network the local ip ...
1
vote
0answers
388 views

Why is netcat remote shell not returning any output on ubuntu 12.04?

I'm connecting to a server I have on my laptop, both are on the same vmnet and both systems are Ubuntu 12.04 LTS. In order to connect I use reverse shell from the web sever. First I start listening ...
13
votes
4answers
672 views

Run last command with all the letters transformed to lowercase

Many times I have run a command with all the letters in uppercase (maybe because CapsLock was on), and I pressed Enter before realising this. How can I run the last command with all the letters ...
1
vote
1answer
1k views

How do I temporarily remove proxy settings?

I set my proxy settings using the following command export http_proxy=http://proxyusername:proxypassword@proxyaddress:proxyport When I do echo $http_proxy I get ...
0
votes
1answer
75 views

Locked out of my account

Ok, so I've been messing around with my linux installation, and I've really kind of messed up. I changed the ~/.gnomerc to open an application, but there was a problem: after it opened that ...
1
vote
1answer
806 views

How to set /usr/bin/i586-mingw32msvc-g++ to gww?

I use cross compiling for C++ using MinGW... I use /usr/bin/i586-mingw32msvc-g++ filename.cpp to compile, but I want to be able to type gww filename.cpp I think I need to set a PATH ...
2
votes
1answer
740 views

Detecting 404 Somehow

I keep my PC running at home. Sometimes, when I'm at work, my PC can't load the pages that I want to load. I have to ssh to it, and reboot/restart browser. It's really annoying and I'm trying to find ...
12
votes
1answer
2k views

Sequence of scripts sourced upon login

I would like to concentrate all my login config in my ~/.bash_profile. There was a ~/.bashrc there by default but I replaced it with a ~/.bash_profile. However, when I log in, something before my ...