Question

Linux File Systems: Please write down a pseudo code that implements shell command “find . -name...

Linux File Systems:
Please write down a pseudo code that implements shell command “find . -name myfile -print”.

Homework Answers

Answer #1

find . -name myfile -print

-What this will do is ,it tells the find command to look inside the .directory and it's every subdirectory to search for a directory with the name given myfile
and to display each match it finds


find . -name “foo*” -amin -5 -print

-What this will do is ,it tells the find command to search inside the current directory and every subdirectory of it's to look for a file with name begin with "foo" that
have been accessed in the last 5 minutes and to display each match it finds

Similarly,

find . -name “foo*” -amin -15 -print
This will get the last accessed files anmes which it finds in last 15 minutes.

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: $@"' -- @@

I hope this might help you and don't forget to give UPVOTE s it means a lot.THANKS:)

Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions
You must write the shell in C/C++ for Linux systems, and the shell must have the...
You must write the shell in C/C++ for Linux systems, and the shell must have the following functionality : can use command list to list files and directory of a given directory;
5. Write a bash command that will display the name of every file on the Linux...
5. Write a bash command that will display the name of every file on the Linux system whose file contaent contains the string "doug.jones". The command must run in the background, must redirect standard error to /dev/null, and must redirect standard output to ~/out. 6. Write a bash command that will kill all of the even-numbered processes associated with your userid, and no other processes. 7. Write a bash command that will start the program /home/courses/140u-doug.jones/zombie_maker as a background process,...
should be in Linux, please Write a shell program named A1L21 Your program should set permissions...
should be in Linux, please Write a shell program named A1L21 Your program should set permissions for a file whose name is given as an argument to your program. The permissions must be changed using a SINGLE chmod command, and must be set to EXACTLY rw for owner and group and x for others. Your program should NOT show any error messages on the screen, even if the given file does not exist, etc.
PLEASE DO QUICK LINUX ASSIGNMENT PLEASE ILL THUMBS UP You need to paste the command and...
PLEASE DO QUICK LINUX ASSIGNMENT PLEASE ILL THUMBS UP You need to paste the command and the output in a word document and submit it. Part1: 1. Log in to Linux using your user account name and password. 2. If you logged in using a graphical login screen, open a terminal window by clicking on the icon in the lower left corner of the desktop to open the main menu, then selecting System Tools, then Terminal. A terminal window opens....
Write a program in C that takes a file name as the argument on the command...
Write a program in C that takes a file name as the argument on the command line, and, if the file is a symbolic link, prints out the contents of that link (i.e. the file name that the link points to). If it is not a symbolic link, the program should print an error int main ( int argc , char * argv [] ) { // Check if the user gave an argument , otherwise print " ERROR :...
How would I go about answering these questions In linux. Please provide the correct linux command...
How would I go about answering these questions In linux. Please provide the correct linux command needed to answer these 4 questions 5. Display total words of each file under your root directory and subdirectories. 6. Change permission of every filename ends “.py” to — write read execute, group - read execute, other - execute 7. Find every line which contains “hello” from your file system, display both file name, line number. 8. Combine files with name “p3.py”, “p31.py”, “p32.py”,...
Write Linux command lines to do the following: 1. Create a directory with name “yourName_ID” 2....
Write Linux command lines to do the following: 1. Create a directory with name “yourName_ID” 2. Create a file with name “yourLastName.txt” inside the directory created in step.1 3. Write inside the created file exactly the following content (you may use editors such as vim, pico, ….): Linux Lab Lab. ToDo#1 Summer Semester 2019/2020# 4. Display the first 2 lines of the file. 5. Change the permission of the file to read write and execute for owner, groups and others....
How to use command line argument in python to write a program implement linux command 'find'?
How to use command line argument in python to write a program implement linux command 'find'?
Write a shell program named HELOO (this should be done linux) Your program should set permissions...
Write a shell program named HELOO (this should be done linux) Your program should set permissions for a file named A1testFile so that the current premissions remain, except execute permissions are REMOVED for everyone, including owner. Your must accomplish this with a single chmod command. A1testFile should be specified as a relative path name to a file in the current directory (the directory the user is in when they run your program). Your program should not display any error messages,...
Linux, please avocado is an empty file Q14 – Specify a single line command that gives...
Linux, please avocado is an empty file Q14 – Specify a single line command that gives the owner and group permission to execute the file avocado while giving the owner sole permission to read and write the file. Do not change any other permission, i.e., do not remove permission from others to execute the file, if they already have that permission. Q15 – File/directory permissions are subject to permissions on the parent directories. For example, consider the file /home/dv35/cs265/lab1.txt. If...
ADVERTISEMENT
Need Online Homework Help?

Get Answers For Free
Most questions answered within 1 hours.

Ask a Question
ADVERTISEMENT