gudii9
asked on
unix xyz user size and cleanup
hi
on the unix box various users like xyz, abc etc.
Looks like disk space is running out of server and i need to cleanup.
How to know how much user xyz occupying size and how much abc user is occupying size. please advise
on the unix box various users like xyz, abc etc.
Looks like disk space is running out of server and i need to cleanup.
How to know how much user xyz occupying size and how much abc user is occupying size. please advise
ASKER
how to delete some hidden files
i see some files
.nfx00000aaaeeevvv etc of 2 GB
wht is that file why it occupyes so much space?
i see some files
.nfx00000aaaeeevvv etc of 2 GB
wht is that file why it occupyes so much space?
First find out what service is writing to that file:
lsof | grep -i nfx00000aaaeeevvv
lsof | grep -i nfx00000aaaeeevvv
ASKER
su to root:
either "su -" or "sudo su -"
cd /
du -sh *
and drill down one level to the directories consuming disk space.
If all of these accounts are in /home, then cd /home and start from there
any command which gives all statistics in one stroke? i hate to drill down to 1000 different directories
ASKER
does
ls -al
gives the size of the user folder?
ls -al
gives the size of the user folder?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ls -ld /home/userfolder
ASKER
says permission denied even i logged as super user?
ASKER
when i say
ls -al
i see
drwxrwxrwx 4 lms lms 45 Jan 4 2017 GGG3RR
WHAT IS 4 HERE AND
WHAT IS 45 HERE?
PLEASE advise
ls -al
i see
drwxrwxrwx 4 lms lms 45 Jan 4 2017 GGG3RR
WHAT IS 4 HERE AND
WHAT IS 45 HERE?
PLEASE advise
ASKER
Does below command deletes hidden as well as regular files and directories under current directory?
file_permissions number_of_links owner_name owner_group file_size time_of_last_modification filename/or/directoryname
4 = where number of links are directories inside of this directory
45 = file_size
4 = where number of links are directories inside of this directory
45 = file_size
I don't see a command which deletes anything.
ASKER
i mean
rm -rfi .*
rm -rfi .*
ASKER
is it file or directory/folder size?
Look at the permissions. If the first character is a "d" then it's a directory. If the first character is a "-" it's a file.
So, in your example above, that's a directory.
So, in your example above, that's a directory.
ASKER
drwxrwxrwx 4 lms lms 45 Jan 4 2017 GGG3RR
then it is directory
then it is directory
Yes.
find . -type f -size +500M -exec ls -lh {} \; | awk '{ print $9 ": " $5 }'
to search from your location. or you can do a "find /path/to/GGG3RR" or "find GGG3RR" from the directory directly above it.
to search from your location. or you can do a "find /path/to/GGG3RR" or "find GGG3RR" from the directory directly above it.
ASKER
-rw-r--r-- 1 lms lms 532 Oct 10 2014 Register.sh
what is above?
it starts with - neither d nor a??
what is above?
it starts with - neither d nor a??
It starts with a "-", so it's a file. The filename suggests that it's a script but the permissions are not set to execute and, therefore, cannot be run until the permissions change.
ASKER
for one directory shows like below when i do
ls -al
drwxr-xr-x 2 abc lms 0 Aug 1 10:24 diag_images
here what is abc
and
what is lms
please advise
ls -al
drwxr-xr-x 2 abc lms 0 Aug 1 10:24 diag_images
here what is abc
and
what is lms
please advise
ASKER
Please read my answer above.
https://www.experts-exchange.com/questions/29050619/unix-xyz-user-size-and-cleanup.html?anchorAnswerId=42255665#a42255665
to remove a hidden file (like rm -rfi .*) why i have to login as owner group i.e lms
where s to stop and start server i have to login as owner name i.e abc?
file_permissions number_of_links owner_name owner_group file_size time_of_last_modification filename/or/directoryname
why first owner_name coming then owner_group. I thought owner_group come first followed by owner_name?
please advise
it's owner name then owner group.
never do an rm -rfi on .*
use find appropriately to find dot files and delete those files are needed with minimal globbing.
never do an rm -rfi on .*
use find appropriately to find dot files and delete those files are needed with minimal globbing.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
That's not true, serialband -- at least not on all platforms. Permissions are different. That's why I stick with sudo su - when I'm changing to the privileged account.
unless you're using some ancient posix unix.Some old Unix will not have a current version of sudo and therefore not have sudo -s or sudo -i options. Not sure what permissions you mean. You can limit sudo with /etc/sudoers configurations.
On Ubuntu, root doesn't inherit the environment with "sudo -s" that "sudo su -" provides. This is not an old distribution. It's about making sure that the account is privileged enough or has inherited the environmental variables properly.
I haven't thoroughly tested the two because I work mostly with CentOS. And then, I don't use sudo except when called from scripts.
I haven't thoroughly tested the two because I work mostly with CentOS. And then, I don't use sudo except when called from scripts.
Author, would you please close this question? It, along with several others, have been answered.
ASKER
5 ~]$ $ find / -type f -size +500M -exec ls -lh {} \; | awk '{ print $9 ": " $5 }'when i gave above command says command not found how to fix this?
-bash: $: command not found
please advise
It looks like you copied an extra character. Don't include the dollor ($) sign at the front of the command string when you copy the command.
find / -type f -size +500M -exec ls -lh {} \; | awk '{ print $9 ": " $5 }'
P.S.
If you want the full root environment, then you need the -i option for sudo.
sudo -i
find / -type f -size +500M -exec ls -lh {} \; | awk '{ print $9 ": " $5 }'
P.S.
If you want the full root environment, then you need the -i option for sudo.
sudo -i
ASKER
find / -type f -size +500M -exec ls -lh {} \; | awk '{ print $9 ": " $5 }'
find: `/boot/lost+found': Permission denied
what it means?
find: `/boot/lost+found': Permission denied
what it means?
It means that it's running the find through all directories and found /boot/lost+found' to be inaccessible to the find command.
Do you still need help?
ASKER
why it say inaccessable same sudo root issue?
Yes. Only the root user has full access to everything. Everyone else is a regular user and some directories are set off limits by default. You may still get access denied if read and execute permissions are still set off for the root owner.
sudo find / -type f -size +500M -exec ls -lh {} \; | awk '{ print $9 ": " $5 }'
sudo find / -type f -size +500M -exec ls -lh {} \; | awk '{ print $9 ": " $5 }'
@gudi9
Is your system running nfs? It's been a while since I've worked on nfs and I seem to recall that they create these temporary files that you can't remove because they're being held open over the network share.
.nfx00000aaaeeevvv suggests that it's an nfs file.
Is your system running nfs? It's been a while since I've worked on nfs and I seem to recall that they create these temporary files that you can't remove because they're being held open over the network share.
.nfx00000aaaeeevvv suggests that it's an nfs file.
either "su -" or "sudo su -"
cd /
du -sh *
and drill down one level to the directories consuming disk space.
If all of these accounts are in /home, then cd /home and start from there.