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

learn more… | top users | synonyms (1)

0
votes
0answers
3 views

architecture scanning

I am working on a toolkit for the company i work for, the problem is, one of the tools in this 'kit' needs to have the ability to recognize architectures, i already got 32 and 64 bits working but i ...
1
vote
0answers
13 views

How can I use conditional constructs in a bash case statement?

I need to check the return codes of two sub-scripts launched from within a wrapper script, using the Bash shell. If either subscript fails they will produce a negative integer as a return code. If a ...
1
vote
1answer
12 views

Matlab related Sh file command not found

I'm trying to launch a program (ExploreDTI) which uses Matlab Runtime R2014a (8.3). I have a MainExploreDTI file (Executable (application/x-executable)) and a run_MainExploreDTI.sh sh-file. In ...
4
votes
2answers
753 views

I permanently changed my PATH variable by mistake, and I am unable to login now. How to change my PATH variable to default?

I used sudo -H gedit /etc/environment command on terminal to permanently change my PATH variable. To correct it, I pressed Ctrl+Alt+F1, and used export PATH command but the access was denied. Many of ...
2
votes
2answers
34 views

Run .sh with Desktop entry without closing terminal [duplicate]

Here is my desktop entry to run "PRGM.sh" [Desktop Entry] Encoding=UTF-8 Name=PRGM Comment=Launch PRGM Exec=gksu /home/markku/PRGM.sh Icon=utilities-terminal Type=Application Terminal=true The ...
0
votes
1answer
18 views

Makefile problem

I was trying to make make command for a code in the remote computer.I found there is a problem and refuse to complete compiling. I need to get the logic of thinking on how to know the problem and ...
1
vote
1answer
15 views

How to change Windows line-ending to Unix version [duplicate]

We have 10 PC with some version of Ubuntu and only remote access. While doing some upgrades to custom software I did not notice that the line endings in some scripts were Windows version (CR+LF) and ...
8
votes
1answer
192 views

How to display modified time of a file?

I'd like a method to find and print the modified time of a file, for use within a bash script. I have come up with: ls -l $filename | cut -d ' ' -f '6-8' Which outputs: Jul 26 15:05 Though I'd ...
1
vote
3answers
193 views

How to use AND and NOT both in single grep command

I'm creating one of shell script, In which, I need to filter process except own grep process. If I use : echo "step1" psout=`ps -aux | grep 'deluged'| grep '58846'` echo "step2" echo $psout ......
7
votes
4answers
513 views

Detect if a tool is already in execution but ONLY for current user

Until now I used pidof -o %PPID -x "my-tool" To detect the pid of an eventually running instance of my-tool. This is the short version of my-tool file, an executable bash script #!/bin/bash if ...
0
votes
0answers
17 views

Problem with startproc command

I have a problem with startproc command Even though the package sysvinit-utils is installed I get an error : Starting DLS Daemon ./dls: line 131: startproc: command not found failed Here is the ...
0
votes
1answer
14 views

Unable to create alias having pipe

I want to make an alias tree with find ./ -type d -print | sed -e 's;[^/]*/;|____;g;s;____|; |;g' as its value. so to avoid mistakes due to ' inside whole line I converted them to \' by which I can ...
0
votes
2answers
16 views

customized shell script can not be run

I have wrote a shell script, show the script myscript.sh #!/bin/bash ssh -t proxy@PROXY -p 22022 "ssh me@REMOATE_MACHINE -p 22022" And I put the script to /opt/scripts/myscript.sh, and chmod u+x ...
0
votes
2answers
29 views

Scripting Problems - Unexpected End of File using IF/THEN

Finally made the move into Linux and decided the best way of learning the ropes was to try my hand at scripting. Trying to make a basic (started really basic and keeps growing) script that ...
0
votes
0answers
5 views

Unable to configure Ubuntu kiosk mode 12.04

Setting Up Ubuntu as a Kiosk Web Appliance How-to Ubuntu Kiosk How to set up an Ubuntu Kiosk Ubuntu Web Kiosk in 10 Easy Steps I saw the websites above but I am unable configure kiosk mode. I ...
0
votes
0answers
33 views

Change bash shell to look like the one on heroku demo

I am in love with the bash shell look and feel show in the intro video of heroku. Anyone has got an idea how I can implement this kind of bash look :
0
votes
2answers
44 views

spawn command not found on ubuntu 14.04

I'm using Ubuntu 14.04 and I want to block SSH login country wise using GeoIP ( From https://www.axllent.org/docs/view/ssh-geoip/), Please find output of command: $ spawn spawn: command not found ...
2
votes
1answer
74 views

Bash History: Default size should be 500 but getting 1000

As this question suggest that bash keeps last 500 entries in history. But following command suggest otherwise, $ echo $HISTSIZE 1000 I have never changed bash history settings or config files other ...
1
vote
1answer
22 views

C Shell variants and Bourne Shell variants [duplicate]

What is the difference between: C Shell variants and Bourne Shell variants? I must install a scientific software, during the installation I must write ./configure >& config.out & ## C ...
0
votes
0answers
11 views

How to check if another ubuntu machine already has remote connection happening?

What is a good way to check (preferably through bash script) from an ubuntu machine A, if ubuntu machine B is already remotely connected from ubuntu machine C? This is assuming that these machines ...
0
votes
1answer
29 views

.bash_profile not working

I'm trying to set AVARIABLE in my bash_profile: echo export "AVARIABLE=example" >> ~/.bash_profile then source ~/.bash_profile After that, AVARIABLE should be working, but... bash: ...
0
votes
1answer
21 views

how to remove pdf studio from ubuntu 14.04

Recently I installed PDF Studio 11, Trial(Evaluation) Version. As far as I remember, I downloaded it from their website, and the file "PDFStudio_v11_0_2_linux.sh" is at /home/.../Downloads. In ...
0
votes
1answer
21 views

Adding a different PATH [duplicate]

I'm in trouble adding a different PATH. When I add it like that : export PATH=$PATH:/opt/file/base/bin/linux-x86_64 It works fine for the current terminal. But when I close it and open again, it ...
3
votes
1answer
18 views

How to use the update function in 'rhash'

I'm having trouble using 'rhash' to update an existing file containing md5 checksums on Ubuntu server 14.04. Here is my script: #!/bin/bash sudo rhash -r -u --md5 /checksum/these/files --output=/...
4
votes
4answers
200 views

Capturing only a section of a command output

If I were to type a certain command, it would give me a long output in the terminal. I only need a few characters of this output. How do I, in a bash script, save only certain characters from a ...
0
votes
1answer
16 views

trouble installing RVM

I am trying to Install RVM but facing error. I am using following code to install RVM sudo apt-get install libgdbm-dev libncurses5-dev automake libtool bison libffi-dev gpg --keyserver hkp://keys....
5
votes
3answers
300 views

change text-color of my output on command prompt?

Suppose i've a php file and i want to change text-colour of my output for a console based application... <?php $prompt = "What Is Your Name: "; echo $prompt; $answer = "You Entered: " . rtrim( ...
0
votes
0answers
13 views

how to add GLIBC_2.14 and GFORTRAN_1.4 to a remote computer

since I am still beginner in Linux so, I need more explanation for the following; I tried to run -bash-4.1$ ./gtest by the remote computer but it give me the following message. and I need a help to ...
0
votes
1answer
34 views

sort a lot of file in directory

I have a problem in bash . I have a lot of file(.mp4) nearly 140 that i want to create directory with similar name with that files but the bash show me this file is exist ! how can do it ?
2
votes
2answers
104 views

Why I could not create a folder named '/' using terminal?

I tried creating a folder with name '/' using the mkdir command. But it returned a message saying: mkdir: cannot create directory ‘/’: File exists I tried quoting the the name '/', and adding ...
1
vote
3answers
45 views

Finding installed packages and the version [duplicate]

I'm very new to ubuntu and I'm trying to find a command that tells what packages and the versions are installed on my "sandbox" I'm looking to bundle this as a output file
0
votes
0answers
11 views

ISAKMP invalid with VPN connection

I need to create a VPN connection to office.sth.com In the end the var/log/sys/log reads: Jul 20 19:48:02 linux NetworkManager[3364]: <info> [1469036882.5641] audit: op="connection-...
2
votes
1answer
29 views

Cancel and restart a certain Routine (python-script)

I have a question regarding a programm I run. Every once in a while, I need to restart a certain program. For that case, I usually run: screen ./run.sh arg1 arg2 "arg3" (screen, since I don't know ...
12
votes
3answers
2k views

What does [co] mean in the “rm -rf filename[co]” command?

Let's say I have two files in /tmp: root@ubuntu:~# touch /tmp/hello.{pyc,py} root@ubuntu:~# ls /tmp/ hello.py hello.pyc Now, lets run rm -rf command with [co] option root@ubuntu:~# rm -rf /tmp/...
7
votes
3answers
273 views

copy/move multiple files using cp/mv without using regular expressions

Suppose I have a folder containing some files and some folders(files can be of any type). And I want to move/copy some of those files and folders using mv/cp command. Is there any way, such that I ...
4
votes
1answer
36 views

Comment, Uncomment, change setting based on string, add line from terminal

I have to edit some files to uncomment a line, change a value on that line or uncomment a line. I am trying to do this through a bash script. I am trying to edit /etc/ssh/sshd_config and change ...
2
votes
0answers
26 views

scroll lock modifier for arrow keys

Most laptops these days have the pgup/pgdn/home/end keys as fn overlays of the arrow keys. It has always been a minor annoyance that the fn key is on the other side of the keyboard, making one-handed ...
0
votes
1answer
27 views

How to start a gnome-terminal without loading profile (like bash --noprofile --norc)

Can I start a gnome-terminal without loading profile? (just like bash --noprofile --norc) Sometime I made mistake in writing .bashrc and find no way (except ssh from another machine) to access that ....
0
votes
2answers
27 views

Run Executable After login [duplicate]

So I have an executable (output of gcc compiling a C program), that I would like to run after login so it is the first thing a user sees upon login. It is a graphical menu that displays system ...
2
votes
2answers
44 views

How to compare any string from output through shell script of unix command

I get a log file as soon as I run one command(process is still running in background). Now I want to fetch the status (clean or un-clean) from that log file. If status is clean then I will leave the ...
1
vote
1answer
21 views

Use previously run command as a properly-escaped argument

A common use-case for me is to run a command in terminal, this command may be long, contain pipes grep | awk | sort, quotes of all sorts ' ", escaped quotes within quotes "\"somethings\"" etc. But ...
3
votes
1answer
46 views

Ubuntu 16.04 Imagemagick convert jpg webp

I was wondering about the following; I use the following command to find .jpg files in (sub)directorys and convert (mogrify) them to .webp files. find . -name '*.jpg' -execdir mogrify -format webp {...
10
votes
3answers
840 views

Can I use '!!' in aliases or scripts?

In the Terminal I can use !! which will reference my previous command. Is it possible to use this in an alias? I have tried it, but what happens is that the double exclamation marks are interpreted ...
1
vote
0answers
25 views

How to prevent command execution edited with fc

I have FCEDIT set to vim. If I call fc command it will open vim with temporary file and contents of that file will be the last executed command from history. The problem is that even if I exit ...
1
vote
1answer
37 views

How can I remove the first whitespace of every line of a file?

I have a file that looks like SPT-CL J0000-5748 J000106.23-574536.8 0.275980 -57.760231 0.7554 0.0003 template 1 SPT-CL J0000-5748 J000049.27-574637.3 0.205320 -57.777050 0.7018 0.0002 template 1 ...
2
votes
1answer
35 views

Differences how to run scripts at startup

I've read various questions about how to run script at startup but I'm not quite sure what the differences are and what's the actually the right way to do it without GUI. /etc/rc.local cron job ...
0
votes
0answers
55 views

My bash script for Grive2 works well in Ubuntu Mate but for some reason it doesn't in Lubuntu

I'm new and I'm learning English so please don't be too rude if i make things wrong, but tell me if I'm not doing them good, of course. Hello community!, by the way. Anyway, getting to the point of ...
1
vote
1answer
24 views

Best way to backup million of assets? weekly changing (adding only) using Bash Script?

I am currently setting up a website including a CMS which has millions of assets. Smaller and bigger pictures mainly. I would like to backup these files on a regular basis. For example weekly. I have ...
0
votes
1answer
50 views

Bash script automation issue

I'm taking this out of context but this bit of my script doesn't execute properly: latest=$(ls ~/Videos/ -t | head -n 1 | sed 's/ /\\ /g') mpv ~/Videos/$latest I'm trying to automatically play the ...
1
vote
1answer
116 views

How to install .tar.gz files which don't have .config file?

I understand that a .tar.gz file can contain anything, but many software packages are available for download as .tar.gz. In my example, I am trying to install the flash player. I downloaded the file ...