Skip to content

Tag: linux

What exactly do these arguments mean in linux?

I have a program written in C and the command I am supposed to run it with on linux looks like this: What exactly does that mean? I think X Y will be the arguments so argc[2] will be X and argc[3] will be Y? But what about –something? Thanks a lot! Answer The C runtime does not discriminate any

Shebang option ‘ #!/bin/csh -f ‘

What does the Shebang option -f do? How do I find, or man, detailed explanations on all Shebang options? Answer There aren’t any “shebang options”. Any options there are options to the binary in the shebang. So that’s a csh option. Specifically (from the man page): -f The shell will st…

Linux shell change directory,file not found

I have written my convert.sh shell This is my working directory All executables and libraries are here, including tsmp. But when I run my script It seems that I do not understand alias. Following chepner’s comments,I have tried this But Why? Answer tsmp is not in your PATH environment variable, so you h…

can’t extract tar.gz file

I used backup.sh : in /home/sebastien/save i have: i’m trying to extract this file with : but Nothing is happening /home/sebastien/tmp is empty! Answer Try removing that other command which blocks the process.

Allow MongoDB remote access for specific IP

I have an application server with some PHP code on it which needs to access a distant MongoDB server. In order to do this I want to allow remote access on my MongoDB server, but only for the application server IP. I understand that I need to change the bind_ip value located in /etc/mongodb.conf in order to do…

linux cmp utility output: what is a “line”?

Could someone tell me what the “line” number represents in the output of a cmp command? I ask this because, first, I can’t find it explained anywhere. Second, I am getting results comparing a set of files where the “char” outputs are identical (as expected) but the “line&#8…

Regular expression to search column in text file

I am having trouble getting a regular expression that will search for an input term in the specified column. If the term is found in that column, then it needs to output that whole line. These are my variables: the text file is in this format with a space being the field seperator, with many contact entries: …

Copy bulk files to another destination using a given prefix in bash

I want to copy all the files newer than another one from their original location /lib/ into another destination /dest/lib/ To identify these files I simply use: Unfortunately I cannot simply use this command because cp does not know how to create folders on the fly. So I used this command: This looks very com…