Question

Linux commands questions help 1.Find all files under the current directory which ends in '.dat' (just...

Linux commands questions help

1.Find all files under the current directory which ends in '.dat' (just the .dat not the single quotes as well) and use -exec to create a listing of each file's inode number.

2. Find all files under the /tmp directory whose size is greater than 65 kilobytes and use -exec with an appropriate command to delete these files.

3. Search files in ~ and all subdirectories -- that contain the word 'hawk' (case sensitive) at the beginning OR end of a line only. Provide two lines of context before and after each word found. Extended Grep is your friend

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Answer 1
*********
find . -name "*.dat" -exec ls -il {} \;

Answer 2
*********
find /tmp -size +65k -exec ls -l {} \;
find /tmp -size +65k -exec rm {} \;

Answer 3
*********
sudo find / -type f -iname '*.*' -print0 | xargs -I {} -0 grep -H --color 'hawk' "{}"

if you have any doubt then please ask me without any hesitation in the comment section below , if you like my answer then please thumbs up for the answer , before giving thumbs down please discuss the question it may possible that we may understand the question different way and we can edit and change the answers if you argue, thanks :)

Add a comment
Know the answer?
Add Answer to:
Linux commands questions help 1.Find all files under the current directory which ends in '.dat' (just...
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. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • LINUX QUESTIONS (dont have to display output, I will be running these commands myself to check...

    LINUX QUESTIONS (dont have to display output, I will be running these commands myself to check the output) Display the command(s) used to do the following: create an empty file called history by using just a redirection operator. Verify and show. Show/verify all results (i.e., all commands and their corresponding outputs). Wait 1 minute or more and then display the command(s) used to do the following: change the timestamp on the history file you just created. Verify/display the change. Show/verify...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT