Skip to main content

All Questions

Tagged with
0 votes
0 answers
56 views

Can we use SFTP GET command to retrieve the latest file from the directory? [duplicate]

I looked for a solution to retrieve the latest file from the directory and found in google in this very website. latest_remote_file = $(ssh username@server_name 'ls -tr /path | tail -n 1') scp -r ...
Brindha Sharadha's user avatar
0 votes
2 answers
225 views

timestamp variable in unix

I am getting below data in in bash script variable exp_dt: exho $exp_dt Jun 5 08:25:42 2023 GMT need help to convert it into format like "05-Jun-2023" and days remaining from current date ...
joy 's user avatar
  • 216
0 votes
0 answers
53 views

How to fetch the date of the file from the folder in UNIX Shell Script?

I am beginner to Shell Script. Just want to know how to fetch date of the file from the properties in the UNIX Shell Script? When I put 'ls -lrt' , could fetch the date where as for last six months we ...
karthickraja's user avatar
0 votes
1 answer
224 views

Time taken by loop/commands in usecs in shell script

I need to measure the time taken by command(s) in usecs inside my shell script start_time ; Command1; command2; end_time; time_taken = end_time -start_Time; I was looking at the Time commands, but ...
user3555115's user avatar
-1 votes
1 answer
54 views

How to write a shell script to compare values numerically?

I want the file fig.txt read in a shell script like here the number is 8 so if the number/value is less and equal to the value 5000 it will alert via mail that lock file overflow and if not it will ...
Raj's user avatar
  • 1
0 votes
0 answers
66 views

Retrieving the last modified file in a directory over FTP using a shell script with curl

I am getting pulling the data from server and placing that in my local. curl --verbose --ftp-ssl--user 'username:password' ftp://abc.com:001//this/is/stackoverflow/ > /home/dir1/dir2/dir3 In ideal ...
Kumar A's user avatar
  • 11
0 votes
1 answer
1k views

How do I find files older than 14 days?

I have made a small script where I am trying to find files older than 14 days but it is printing whole path with file name I just need filename .my script is below . #! /bin/bash . /cdunix/...
Harshleen Kaur's user avatar
-1 votes
1 answer
36 views

I am having 2 same .txt files where in naming, 1 part is same and other part is different. I want to print the files based on the condition below

file name 1 : alert_human_*.txt file name 2 : alert_human_abc_*.txt * denotes the timestamp I am trying to write these filenames to availablefiles.txt file which is placed in human/temp directory by ...
Jayashree's user avatar
0 votes
3 answers
536 views

Identify the files year wise and delete from a dir in unix

I need to list out the files which are created in a specific year and then to delete the files. year should be the input. i tried with date it is working for me. but not able to covert that date to ...
Dileep's user avatar
  • 664
0 votes
0 answers
644 views

Bash script to rename files with current timestamp

master_sheet_2022_03_25_1141.csv master_sheet_2021_03_30_1034.csv master_sheet_2021_03_31_1857.csv master_sheet_2021_03_31_1930.csv master_sheet_2021_03_31_2037.csv master_sheet_2021_03_31_2109.csv ...
kebogile Porogo's user avatar
0 votes
0 answers
76 views

how do i get the query which executed more time from a log file

I need the unix command to fetch out the query that got executed more than 1 sec from a log file using sed/awk. $11 is time stamp. Pl suggest awk script to print all the query that executed more than ...
user15958051's user avatar
0 votes
0 answers
103 views

Month Format in Unix

I am trying to create a shell script for auditing purpose. In my source data the value of month contains like yyyym(20217) format. I need to extract the records based on this month type. is there any ...
AVJ's user avatar
  • 35
0 votes
1 answer
251 views

Convert Unix timestamp in human readable

I have below script size=$1 big_files_list=$(find . -name \*.bytes -type f -printf "%b %h/%f\n" | awk -v size="$size" ' function ...
Samurai's user avatar
  • 139
0 votes
1 answer
171 views

Unix file Sort rows on the basis of timestamp column [closed]

Unix file Sort rows on the basis of timestamp column A 00:00:01 K 01:02:00 C 01:02:03 N 01:03:02 Excepted output should be sort basis on last column HH:MM:SS N 01:03:02 C 01:02:03 K 01:02:00 A 00:00:...
PANDURANG BHADANGE's user avatar
0 votes
1 answer
140 views

Listing filenames having timestamp

Hi I want to list filenames in a directory having timestamp in its file name. For example: gn_752_pos_id_n_00_000_9_20200331.dat.gz gn_40006_dep_ip_c_qa_500_2_20200331_20200622T082432.dat.gz So I want ...
chinmoy's user avatar
  • 11

15 30 50 per page
1
2 3 4 5