I want to displays the owner privileges of the files in the current directory For example the output like this : I’m trying to write this command , but the output is not correct : Answer You just do this command :
Tag: bash
FTP upload in bash script
I tried to write a bash script which upload a file to an ip address with ftp connection, but i have an issue or something like that. I have a .txt file with a lot of line. Every line have an ip address, nothing else just the ip address. So i want to read the ip address from the text
Is there a program that functions like printf with an entire file as input?
My use case is as follows. file.txt First arg: %s Second %s arg, Third %s Run prog file.txt “one” “$(ls dir1/dir2)” “three” Resulting in First arg: one Second file1 file2 file3 arg, Third three I first thought to use sed but that inevitably runs into problems when bash substitutions get read as format characters like this sed s/%1/$VAR/g -> sed
splitting the file based on repeatation
experts i have a file as below where first column is repeated 0.0,5.0,10.Now i want to split the third column at repeatation of the first column row and want to arrange the data side by side as below: so that my final file will be so that my final file will be Answer Using GNU awk: Process each line and
How can I loop for end of month date between to dates in sh?
I want to loop and print end of month date between two dates. I have below code but it prints day on day. but I want these result for: 20210131 20210228 20210331 thanks in advance Answer Something like this or with -m flag
How can I iterate over some file names returned from ls command?
Hello I am trying to write a simple bash script, the problem I am having is that I want to iterate through the 4th,5th,6th and the 7th files returned from the ls command and then to check if these files have write or read permissions and if they do so, to do a simple copy of these files to another
Bash script return to menu if status code inside of a while loop [closed]
Closed. This question needs details or clarity. It is not currently accepting answers. Want to improve this question? Add details and clarify the problem by editing this post. Closed 2 years ago. Improve this question I’m doing a bash script to check cryptocurrency prices, and it updates in a while loop like this: Crypto prices real time updating While loop
How can I build a Trap function with any key
This function exits my script when I press cntr+C, how can i modify it to make it works when I press enter? Answer This might help:
Name check match pattern
I need help as to why code B is producing a different result The code below (CODE A) produces the correct output (match) However, the below (CODE B) produces a wrong output (no match) Answer To check a regex in an if-statement you’ll need to use =~ instead off ==; Both will match as expected. Try it online!
How to resume interrupted download of specific part of file automatically in curl?
I’m working with curl in Linux. I’m downloading a part of a file from Media-fire using bad internet connection , the download always stops after few minutes and when i use the parameter -C – instead of continue downloading only the part of a file i mentioned from where the download stopped , it starts downloading the hole file .