Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted!
The problem statement, all variables and given/known data:
Write a script, which will run using the Bourne shell, and store it in file
morethan100k which will inform the user if they have used more than 100k of
disk space? this is the complete question
Relevant commands, code, scripts, algorithms:
none as yet
The attempts at a solution (include all code and scripts):
have not attempted this, as i need pointed in the right direction
Complete Name of School (University), City (State), Country, Name of Professor, and Course Number (Link to Course):
University of Ulster, prof Kenny Adamson, Jordanstown, Northern Ireland, Com 332 <--- module code
Note: Without school/professor/course information, you will be banned if you post here! You must complete the entire template (not just parts of it).
see for this i think that answer was a bit too complicated to be an answer that i could have done, is there simpler way.. using df or free command or something
ok in the terminal i can now get the total disk usage which is great... now tho need to create a script to execute from the terminal,
if [du -s -gt 100 ];
then echo "You have used more than 100k of disk space"
else echo "You have not used more than 100k of disk space"
fi
i tried doing this, but it doesnt seem to like the du command..
it is the script name
i now have this i am however having trouble comparing this output to a number
SIZE=`du -s`
echo $SIZE
test $SIZE -gt 100 && echo You have used more than 100k of disk space ||
echo You have not used more than 100k of disk space