Linux Help
guides forums blogs
Home Desktops Distributions ISO Images Logos Newbies Reviews Software Support & Resources Linuxhelp Wiki

Welcome Guest ( Log In | Register )

Advanced DNS Management
New ZoneEdit. New Managment.


Sign Up Now
> Two question of the newbie
post Jul 25 2011, 05:25 AM
Post #1

Whats this Lie-nix Thing?

Group: Members
Posts: 1
Joined: 25-July 11
Member No.: 15,473

Headache for a couple of days about this questions.
First: I have many many >> 1000 files like abc_de_XXXXXX, where XXXXXX random numbers. I need to calculate the number of this files, determine their total size, and delete them except the last 10.
My solution:
find -name 'abc_de*' | xargs ls -1S > /tmp/trash.txt - find them all and save list to the file.
wc -l /tmp/trash.txt - total number of this files.
Then, after some googling, i`ve find a way, how determine their total size:
find -name 'abc_de*' -exec stat -c%s {} \; | awk '{total += $1} END {print total}' - but this pretty hard for my sad.gif
And last task (delete them, except the last 10) - I don`t know how do this.

The second questions is: use only command ps, awk, gawk, grep to determine total amount of memory used by Oracle processes. Could your help me?
Go to the top of the page
+Quote Post

Posts in this topic
- ruvoodoo   Two question of the newbie   Jul 25 2011, 05:25 AM

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:


RSS Lo-Fi Version Time is now: 15th July 2018 - 11:58 PM