So I’m new to Linux and just got Ubuntu 16.04.2 running on a VM. I’ve installed gcc/g++ on here in the terminal, but when I run my program in GDB, as soon as I get to a strcmp function, this pops up for many lines. And when I go further down: So I’m guessing it just doesn’t recognize m…
How do I classify files in Linux server by their names?
How can use the ls command and options to list the repetitious filenames that are in different directories? Answer You can’t use a single, basic ls command to do this. You’d have to use a combination of other POSIX/Unix/GNU utilities. For example, to find the duplicate filenames first: This means …
Linux – read emails and run script from gmail relay
I’m using Ubuntu and set postfix up to use gmail as a relay to send mail following this guide. I can send emails fine but I would like to receive emails and run a script like this. Is it possible to receive emails from my relay and then run a bash script? Answer We figured it out using fetchmail to
Pass Telnet Command to SSH in Bash Script
I’m trying to write a bash to first ssh into a server and then telnet from that server to a ElastiCache Redis endpoint. My Code is the following: telnet.sh I would like to call my bash script and have the user interactively be connected to the Redis Cluster so that the user can enter redis cli commands …
Send and receive Hex String from linux Server C#
I’m developing an developing a little software in c# that connect to a Linux server. the software send a HEX String and receive a HEX String Back. here is my code an example of a string is 0x30 0x30 0x30 0x30 0x30 0x30 0x30 0x34 0x03 0x30 0x30 0x30 and the response is this 30 30 30 30 30 30
Bash: if statement always succeeding
I have the following if statement to check if a service, newrelic-daemon in this case, is running… The problem is it’s always returning as true, i.e. “New Relic is already running”. Even though when I run the if condition separately… … it returns 0. I expect it to do nothin…
How to specify two variables on bash command line?
For example, I can do this: But how can I do this? I cannot use this: I have to do it in one line Answer As far as I know, every Bourne shell allows any number of name=value pairs preceding the command to establish the environment. Bash certainly does.
Finding emails from one file in another
I want to find emails from one file listed as such: in another file listed as so: and output the lines from the second file that match with the first file also keeping in mind it needs to match the entire email from start to finish so it won’t match robertjohn@blogs.com accidently. Desired output: Thank…
Would it be wrong to store custom .py scripts in a personal Linux directory?
My end goal is simple: Store a set of .py scripts on my Linux system such that I can: Run them from the command line without using /Python [name] Edit them easily I can fix the first issue by storing the scripts in /usr/local/bin/ This causes the second issue, because now when I attempt to open the script for…
How to install Android SDK on Linux after deleting earlier version? (2017 Martch)
In the past I could download and install Android SDK separately. I cannot find it any more on Google’s Developer site, only Android Studio, which supposedly contains the SDK too (?). When starting the Android Studio it looks for the SDK. I installed the Ubuntu (I’m using 16.10 Yakkety Yak) repo…