Need to pipe find command output to ls command limiting ls command to a certain date. Sort of a filter by date modified but I want with the format of the ls -lth –full-time. The find command gives me last modified files within 365 days. But ls shows me everything. find gives me: And ls -lth –full-time gives me: Answer
Tag: bash
How to get information from file with condition in Shell script without using “awk” [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 2 years ago. Improve this question i have file conditions : if the 2nd column is – then 2nd condition check last column value beginning in
how to split a long text file at a particular symbols and pasting the splitted files side by side
Hii experts i want to split a large column of text file at a particular symbol(here >) and want to paste the splitted file side by side as given in a example below: I tried with split -l 4 inputfile > otputfile but it doesnot help.I hope some expert will definitely help me. For example i have data as given
In bash how to move row field to column in a text file
I have a .txt file with this record: I would like to convert them like that: I have tried something like: or like but i can’t get it to work I would like the values to be transposed and that each tuple of values associated with a specific field is aligned with the others Any suggestions? Thank you in advance
exporting list of variables in docker run
We have a set of variables in env file as given below examples.env Now, docker run cannot substitute $B for /path/path1, due to its limitations So, I want to export the variable in launcher script and then call those variable using -e flag, as given below mydocker.sh Now how to create docker command to get all the variables? Following docker
Tail a log throughout duration of script (including reboots)
I’m trying to tail a log through the duration of a bash script that involves multiple reboots. The point is to be able to watch the main log to verify what the script is logging. The script runs some code before rebooting. This is repeated an n amount of times that is specified by the user. The problem with this
Some programs not started by bash script when script ran as a crontab job but all programs can be started by manually run the bash script
Problem I have some similar bash scripts to start about hundred processes, these bash scripts runs once very day at 09:12, they run well when the processes was not so many before, but as processes to start by scripts increased recent days, I found that some of processes not be started. I ran the script manually to check what happened,
How to log every single command executed from shell script
I am trying to find a way to record every single command that is executed by any user on the system. Things that I have came across earlier. It is possible to view shell commands executed from the terminal using ~/.bashrc_history file. There is a catch here, It logs only those commands which were executed interactively from bash shell/terminal. This
Show colored output in terminal when using the sh command
color.sh When typing $ ./color.sh the terminal outputs in the respective colors. However, when I type $ sh color.sh it does not output in the correct colors. Instead it gives me the output below. Is there any way to make $ sh color.sh print in the respective colors? Thanks. Answer Use this codes But better use printf Also take a
Bash: Date-epoch with systemd
I execute the following line in a bash console. The content of my.log is as expected. Now I change the timestamp to epoch (format-code +%s). File is As expected again. But if I put this command line into systemd it would fail. produces Must be a problem with the format-code of date. If I remove the +%s then it is