LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This 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!

Notices


Reply
  Search this Thread
Old 08-10-2008, 04:02 AM   #1
mangus123
LQ Newbie
 
Registered: Aug 2008
Posts: 1

Rep: Reputation: 0
Unhappy Save me!!!!!!!!!!!


can someone pls help me out!!!!!!!!

I am new to Linux and using Fedora5, all is good but have got a interview coming up. the questions I've got are

1. how do you list the largest file sizes from the root.( just so that I can compress them using a Gzip )

2. Do we have to write the file logrotate.conf from the start or is it just good enough if i can just manipulate whats in the script?
 
Old 08-10-2008, 04:53 AM   #2
arizonagroovejet
Senior Member
 
Registered: Jun 2005
Location: England
Distribution: openSUSE, Fedora, CentOS
Posts: 1,094

Rep: Reputation: 198Reputation: 198
Do you know that Fedora 5 is way past the end of it's supported life cycle? No updates are being issue for Fedora 5 and haven't been for a few years. Fedora 9 is the current version. It would be a good idea to upgrade. (I am always curious as to why it is some people who are new to Linux start off with very outdated versions. Anyway...)


1) I'm not entirely sure what you mean. 'du -hs' will give you a list of all the files/directories in the current working directory and their sizes. However run in / that could take a while to complete. There is no recursive option - it would take ages if there was and you ran it in / It's possible to sort the files/directories by size but I discovered it was surprisingly difficult when I wanted to do it a while back. I came up with this, adapted from something I found via Google.

Code:
foo=`du -s ./* ./.[a-zA-Z0-9]* 2>/dev/null| sort -rn | cut -f 2- | while read a; do if  test -d "$a";then echo "\E[1;34m" ;fi; du -sh "$a";echo  "\E[0m\n"; done`
echo -e " "$foo | less -r
If you want to find all files over a certain size then look at the find command.

2) I don't see why you'd need to write logrotate.conf from scratch. If you ever managed to delete it then the most sensible thing to do would be to restore it by copying it over from another machine running the same version of Linux. In the years I've been managing Linux machines I've never altered logrotate.conf.


Oh, and using sensible titles for you posts is a good idea.

Last edited by arizonagroovejet; 08-10-2008 at 06:08 AM. Reason: missed out a line of code
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Using vi to save DanielTan Linux - General 10 02-23-2009 05:30 AM
Please save me! Serious! lawrence_lee_lee Ubuntu 5 12-03-2007 11:49 PM
save my h/d alaios Linux - Hardware 3 12-13-2003 11:04 AM
where to save in VI DTre08 Linux - Software 3 07-15-2003 01:17 AM
Save her..... A-dummy General 5 08-15-2002 12:00 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 10:20 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration