Question

Display only first filed of each line from /etc/passwd file.
Find last 50-100 days modified files.
0 0
Add a comment Improve this question Transcribed image text
Answer #1

1.Dispaly only first field of each line from /etc/ passwd file

The first field of each line from /etc/passwd file can be displayed by using different methods such as cut, awk etc.

  •  Using cut
    •  cut -d':' -f1 /etc/passwd
    • The first field that is username is displayed, here -f1 denotes that first fields needs to be printed.
  • Using awk
    •  awk -F : '{print $1}' /etc/passwd 
    • The first field that is username is displayed, here $1 denotes that first fields needs to be printed.

2. Last 50-100 days modified files

  • find is used in linux for searching/finding the files with desired attributes
  •  find / -mtime +50 –mtime -100
Add a comment
Know the answer?
Add Answer to:
Display only first filed of each line from /etc/passwd file. Find last 50-100 days modified files.
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
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
ADVERTISEMENT