Skip to content
Advertisement

Tag: unix

Shell append redirection replaces existing text?

For our school assignment, we have to implement input/output redirection. I managed to get the input and output redirection work, but I am facing an issue with append redirection. I am using testfile.txt: When the user types ls >> testfile.txt, I expect the output from ls to be added to the testfile. At this moment, the test lines get replaced

How do I get just the filename from lsof?

I want to use lsof to create a list of open files in a folder. I’m using macOS, but understand this is common to *nix. In man lsof, it seems the the -Fn option is closest to what I want, but I can’t get further than that. I’m piping to cut to get to just the filename. So this is

Using $() in docker commands doesn’t seem to work

I want to stop all running docker containers with the command sudo docker stop $(docker ps -a -q). But when I run it, docker outputs Just running docker ps -a -q outputs the Docker IDs, but when I combine it with a Docker command, it doesn’t work. Thank you. Answer I didn’t realize that the sudo is required in the

How To Use Gregorian Timestamp In Curl String

I’m trying to work with a curl request and the following string: I’ve been working with the documentation quite a bit, so I know that brackets are not needed. Unfortunately, the only information I have is to us “Gregorian Timestamp” which I haven’t found a lot of documentation on. I have tried a number of different combinations. Using timestamps for

compare two words, 1st word = file name appended with date and 2nd word = just date alone. compare should display the lines with different date [closed]

Closed. This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 4 years ago. Improve this question I am writing a script to compare the file name appended with date(YYY-MM-DD) with date of the file modified. Example:

ASCII Text Browser Vs. cURL

I hit this url : http://artii.herokuapp.com/make?text=abc+art&font=smisome1 I see this Then when I curl exact same URL curl http://artii.herokuapp.com/make?text=abc+art&font=smisome1 I got this 🤦🏻‍♂️ Does anyone know why this is happening ? Is there a specific flag in the curl I should pass to make it return the same result as broswer ? How do I get my Terminal to display the

Access List of Items from cURL Result

If u go to this url : http://artii.herokuapp.com/fonts_list, you will see a list of 417 items on the list. I’m trying to create a variable to store/access those list. I could not get it to work. I kept getting Any hints on how to do it ? Answer Starting with the assumption that the result is, in fact, one font

Advertisement