Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Introduction to Linux - A Hands on Guide
This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.
Click Here to receive this Complete Guide absolutely free.
*Before I get yelled at, yes this is a homework question, but I have searched and searched, my book is NO help, I don't understand what I find online, and I can't ask my teacher right now. I don't want the whole answer, just point me in the right direction please. I really suck at writing scripts and don't understand what I need to do:
2. Read the following scenario and then complete questions 2a -2c following:
As part of your work in the lab scenario for Lab 9.1, you receive several different types of files from your customer. A manager at your customer’s office recently realized that some files were sent to you a while ago that should not have been.
Your boss has asked you to find the files, create a list of them, and then delete them. The files are stored in /custdata/2007/april and are dated September 20, 2008 (this date being a Saturday, you should have received no files that day).
2. a. Write a script to list the files and send the listing to a file named delete.list, then delete the files.
b. Provide the text of your script in your homework document.
c. Test your script, using this touch command to create files with that date:
touch –t 200809200100 <insert file names here, separated by spaces>
I have created the files, but I don't know how to write the script to do what it wants. I know I have to use vim, and #!/bin/bash and made a file called delete.list to list the files to be deleted. But that's as far as I can understand. Please help, this stuff makes my head hurt!
Use ls -l to list the files in that directory. Pipe the output through grep in order to isolate the files with that date. Pipe the output again through cut in order to isolate the filenames. Write the filenames to the list of files to delete.
cat the file and pipe it through xargs to run rm on the filename listed on each line.