Skip to content

How to create hard link in Linux from a C program

We know we can create hard link in Linux using ln file1 file2 which will make file2 a hard link of file1. However when I try to do this by using a C program, I face issues. Below is the C code. After compiling this program with gcc I run it as below. Here file1 exists and file2 is the

Awk asking combine two files

I have combined two different files with Same Key by AWK command. And In case there is no key match compare to File1 and File2 then just put “ttt” instead. I have below AWK command. Example Combine File1 File2 Then Expected result My AWK Command Show I already tried to do few way like below But lo…

How do I create a file in FUSE in C?

For an assignment we have to build a FUSE file system using C. I am trying to create an empty file in the mountpoint directory that I have mounted when I start fuse but it’s not working. I tried placing the following inside my own implementation of the fuse init function: After I had done that, what hap…

How to port forward in Docker container?

I’d like to forward 8080 port to 80 with iptables in a Docker container. In the build I have an error message as you can see below. Here is the Dockerfile: Here is the output: Thank you in advance for any help you can provide. Answer First, running an iptables command during the docker build process wou…