I’m very new to linux and bash. I’m trying to find a domain name for an ip address. When I use nslookup I have a bunch of lines like this Output I only want to print www.computerhope.com in the second line. How do I do this? Also I tried to use host command as well. It looks cleaner. How do
PHP pthreads failing when run from cron
Ok, so lets start slow… I have a pthreads script running and working for me, tested and working 100% of the time when I run it manually from the command line via ssh. The script is as follows with the main thread process code adjusted to simulate random process’ run time. So while the above script…
java is not working in linux. Why?
Currently working on Linux Cinnamon. I have unistall/removed Open JDK from my local drive. Then I checked java -version via terminal and gives – After that following the installation guide to install oracle jdk 8 for linux. Then I just checked java -version command through [I just unpack jdk to /opt/jav…
compiling c++ projects with dlib library on linux
I want to use dlib library for my c++ projects in linux. I have installed it successfully and able to compile and run the .cpp samples files given under the dlib. I have compiled the sample files through the “g++ -std=c++11 -O3 -I.. ../dlib/all/source.cpp -lpthread -lX11 example_program_name.cpp” …
Invalid ELF header out of the gate running simple nodejs script
I’m trying to run a simple nodejs script on Ubuntu 14.04, the contents of which are as follows: I’ve installed NodeJs via the instructions found here. Here is the excerpt I followed from that link: Option 2: Install Node.js with Ubuntu Package Manager To install Node.js, type the following command…
Responsibility of stack alignment in 32-bit x86 assembly
I am trying to get a clear picture of who (caller or callee) is reponsible of stack alignment. The case for 64-bit assembly is rather clear, that it is by caller. Referring to System V AMD64 ABI, section 3.2.2 The Stack Frame: The end of the input argument area shall be aligned on a 16 (32, if __m256 is passe…
How do I find the number of all .txt files in a directory and all sub directories using specifically the find command and the wc command?
So far I have this: I’m not quite sure how to use wc to find out the exact number of files. When using the command above, all the .txt files show up, but I need the exact number of files with the .txt extension. Please don’t suggest using other commands as I’d like to specifically use find a…
Does Bash ignore # after command?
I know that Bash ignores the # character at the beginning of shell script lines. But in documentation I’d like to add them at the end of lines for documentation: Just in case somebody copies and pastes the literal information I’ve written, will Bash ignore everything after the # character? For eve…
Makefile as simlink: not found
Is it possible to have a Makefile referenced by a simlink, and try calling action using make? I am experiencing that calling make in a directory where Makefile is a simlink, Makefile is not found. I have a need to reduce replication of Makefiles, and I would prefer using simlinks. Suggestions? Answer It shoul…
Converting date format in bash
I have similar different file of the format backup_2016-26-10_16-30-00 is it possible to rename using bash script to backup_26-10-2016_16:30:00 for all files. Kindly suggest some method to fix this. Original file: backup_2016-30-10_12-00-00 Expected output: backup_30-10-2016_12:00:00 Answer To perform only th…