Skip to content

Tag: linux

Where is the official documentation for chmod?

I would have expected it to be here in the gnu documentation but it is not. So I Googled it and their were many links but I don’t know which one is the most “official”. For example the first hit is for an Ubuntu distribution, and the second is for a Mac OS X distribution. Answer On a typical…

Grep regexp for matching ip addresses in a file

I’m trying to search a file “Sessions” that contains IP addresses (among other useless junk). My Grep is failing to match, even though REGEXR is matching perfectly all the IPs perfectly … so I know the REGEX is correct … but when I GREP for this same pattern, not is returned. I&#…

Redirect all output of the java program to log file

I have scheduled my jar file by saving this line at the end of the crontab: Cron has started the job, also created the log file, but there is nothing in that file. Any idea why is that? I am doing System.out.println() in my program. I have added write permissions to everyone for that file. Could it happen tha…

Java Linux Terminal in JPanel

I am making a Scripting Editor and would like to be able to run the Bash/Shell/Python/etc. scripts in the program… So far, I have a way of running them, but there is no way for the scripts to have user input; here’s the code: Any help/ideas are greatly appreciated!!! Answer This is a modification …

Could not install mysql-server inside docker container

I want to configure a container with MySQL, thereafter I will add a java application to the container. But, I could not install MySQL-server inside the container. here is my dockerfile: I got the following error: Errors were encountered while processing: /var/cache/apt/archives/mysql-server-5.5_5.5.44-0ubuntu…

Bash – Delete lines ending with a number

I need to remove only lines (in text file) ending with a number. Before: After: Answer Since you’re referencing my favorite movie, I’ll answer: Which translates to: Delete any line where there is either a space or a tab, followed by at least one digit, then any amount of spaces or tabs at the end …

PowerMTA Server Not starting

I have recently installed PowerMTA server on CentOS 6, every prerequisite was installed according to Document and License was entered in correctly configuration file was also correctly setup in /etc/pmta/config but unable to start pmta service and getting this error in logs, Answer You have an invalid license…

Shell : choosing string between two strings using sed

I have a log file in format like this : I want to return all the strings which are between pseudo and pseudoConcat, my desired output is : How can I do this using sed or awk? I’m trying for a few days in vain. Thanks. Answer With GNU grep: Output without trailing spaces: thierry33 i love you With bash: