Write a command sequence to find all the files modified in less than 2 days and print the record count of each.
Answer / Tara Singh Meena
To find all the files modified within the last 2 days and print the record count of each, you can use a combination of `find`, `ls`, and `wc` commands. Here is a command sequence that achieves this:n```nfind /path/to/directory -type f -mtime 01 -exec ls -l {} ; | awk '{print $5, $NF}' | sort | uniq -cn`` This command first finds all files modified in the last two days (-mtime 01) within the specified directory (/path/to/directory). It then pipes this output to `ls -l` to get detailed file information. The `{}` is replaced by the current file being processed by the find command. The pipe (|) is used to pass the output of one command as input to another command. The output is then piped to `awk` to extract the number of links and the filename, sorted, and unique records are counted using `sort` and `uniq -c`, respectively.n
| Is This Answer Correct ? | 0 Yes | 0 No |
What is awk in shell scripting?
What is a shell in operating system?
is this growing field and what is average package in this?
madhar chod unix ke 10 commands dhang se likh nahi sakta hai
Hi, all Scripting professional. Q. I have written script1.sh and calling script2.sh in script1.sh file using bash shell as interpreter and my log in shell also bash shell.My code like Script1 #!/bin/bash echo "My script2 call" . script2.sh Here script2.sh file run successfully but when I have changed my interpreter bash to ksh like #!/bin/ksh Error are comming script2.sh command not found. Guid me how to call other script in our main script.
What is awk in shell script?
Is shell scripting easy to learn?
write a shell script to check whether all the directories in the path exist has read and write permission
Why is used in shell scripting?
Which shell is the best?
What does egrep mean?
The information of the two files should be redirect to Third file in such a way that, the third file contain the information like this. 1st line in third file should be from 1st file 2nd line in Third file should be from 2nd file 3rd line in Third file should be from 1st file 4th line in Third file should be from 2nd file - - so on