Skip to content

How to read file in linux command line?

I’m doing this challenge thing and this is one of the levels: An agent on Level 05 has told us about another big hack he’s working on. Apparently someone broke into a popular shopping site, stole all the usernames and passwords and was going to post them online. Luckily, we got to them first and r…

Use bash -s with other arguments

I have install.sh script which is located in server. I want to write one line code to download and run the script. Everything works fine until I am trying to set arguments It can’t recognize ‘-p’ as an argument but ‘abc’ can. How to set arguments in this situation starting with &…

How u-boot start instruction is found by ROM Code

I am trying to understand ARM Linux Boot Process. These are the things I understood: When reset button is pressed in any processor, it jumps to the reset vector or address, in case of ARM it is either 0x00 or 0xFFFF0000. This location contains the start up code or ROM Code or Boot ROM Code My query is how thi…

dup2 paramater order confusion

I have written this simple program: What i want is, redirect the output of ls – l to a file called “theFile.txt”. The code works as i expect. What confuses me here is the order of dup2 parameters. I believe that correct order should be dup2(1, fd) – considering fd as the newFD and 1 as…

Why does flock removes existing text from a file?

So, I am trying to get an exclusive lock on a text file using Flock and a line of text to that file however while doing so it removes whatever text was there earlier. So if the file had let’s say and after running the script I am expecting something like instead, all I get is why would it behave