please write down a pseudo code that implements shell command “find . -name myfile -print”. as
Solution:
Givendata:
find . -name myfile -print
This command tells the find command to look
inside the .directory and every subdirectory to
look for a file or directory with the name myfile
and to display each match it finds
find . -name “foo*” -amin -10 -print
This command tells the find command to look
inside the current directory and every subdirectory
to look for a file with name begin with foo that
have been accessed in the last 10 minutes and to
display each match it finds
Pseudo code:
$ # Let's make some test files $ mkdir ASCII-finder $ cd ASCII-finder $ dd if=/dev/urandom of=binary.file bs=1M count=1 1+0 records in 1+0 records out 1048576 bytes (1.0 MB, 1.0 MiB) copied, 0.009023 s, 116 MB/s $ file binary.file binary.file: data $ echo 123 > text.txt $ # Let the magic begin $ find -myfile-print0 | \ xargs -0 -I @@ bash -c 'file "$@" | grep ASCII &>/dev/null && echo "file is ASCII: $@"' -- @@
Get Answers For Free
Most questions answered within 1 hours.