Questions tagged as 'linux'

1
answer

How do I Debug BASH Scripts?

How can I debug bash scripts? In DOS from Microsoft I can use the @echo ON and @echo OFF. I would like to use something similar on Linux.     
asked by 18.03.2014 / 16:08
3
answers

Check if variable is a positive integer

To check if a variable is a positive integer , I'm resorting to a regular expression: #!/bin/bash id="$1" regNumTest='^[0-9]+$' if ! [[ "$id" =~ $regNumTest ]]; then echo "Parâmetro #1 deverá ser um inteiro!" exit 0 fi Wil...
asked by 25.03.2015 / 16:08
1
answer

What is the difference between halt, poweroff and reboot?

I've heard several times that if I want to shut down / restart the computer through the terminal, just do one of the following: halt poweroff reboot poweroff and reboot are very intuitive "off" and "restart", I just did...
asked by 19.07.2017 / 15:30
2
answers

What is the difference between a symbolic link and a hard link?

In the Unix context, what is the difference between a symbolic link and a hard link and which commands are used to create them?     
asked by 11.06.2015 / 17:53
1
answer

How to find out if a directory is empty by the terminal?

I uploaded some files, via ftp, to put my application into production. For some error in the application, I noticed that some files were missing. When I gave a ls I realized that some folders were empty, but I can not enter one by one...
asked by 17.03.2016 / 13:07
1
answer

MySQL falling for lack of memory

I have a dedicated Linux Ubuntu 12.04 LTS server with MySQL / Apache / Wordpress , but since it only has 1Gb of RAM, sometimes it drops out of memory . In the syslog mark with the message    Out of memory: Kill process XXXXX (mysqld) score...
asked by 13.02.2014 / 20:00
3
answers

OpenSuse 13.2 - Sublime as default editor

I've downloaded sublimeText2 for text editing and would like to set it as the default editor instead of gedit but I'm not getting it. Attempts Arquivo -> abrir com -> outro aplicativo -> visualizar todas as apli...
asked by 05.06.2015 / 16:51
2
answers

perl: warning: Setting locale failed

There seems to be an error with the local settings of Perl and / or the system, but the details obtained do not clarify what is is passing: perl: warning: Setting locale failed. perl: warning: Please check that your locale settings: LANG...
asked by 15.05.2015 / 11:54
3
answers

Executing command with another user inside a shell script

I have a shell script that I need to execute some commands with a linux user, and some other commands with another user. Something like this: #!/bin/bash echo 'rodando com usuário A' comando1 comando2 comando3 echo 'Rodando co...
asked by 23.05.2014 / 21:54
1
answer

How to detect the cause of the error: 'The requested URL returned error: 503'?

I'm working on developing a web-site where I get back the following error that I can see through Firebug :    The requested URL returned error: 503 Is there any way to find out the source of this problem, perhaps through logs or somethin...
asked by 31.12.2013 / 17:16