On Sun, 31 Jan 2021 10:15:59 +0000, ci...@cewland.uk said:

> Is there a command to show files in root and there sizes?  I tried 'ls' 
> but that lists only my home folder.

'ls' will list the directory you're in unless you pass an argument. So, if
you're in your home directory:

$ ls       [list your home directory]
$ ls /var  [list contents of /var]

You may not have permission to read the contents of other directories (for
that you may need 'sudo ls' or you can be root).

> Tried sudo cd/ no command, not found!

You need a space between the command ('cd') and the argument ('/'), so 

        cd /

You don't need sudo for that command. You're allowed to cd to /, and
you'll even be able to see the directories there. You may need sudo to see
inside some directories.

> 'usr' seems to be large at 5.1GB last date modified 13 Dec2019 well 
> before this problem started so unlikely to be the problem?

5GB for /usr sounds about right.

Try this:

$ cd /
$ sudo du -sh * | sort -h

That will show the size of each directory in root in size order. Let's say,
for the sake of example, that /var is the biggest. Then you do:

$ cd /var
$ sudo du -sh * | sort -h

Now you can see which directories in /var are the biggest. You can repeat
the above to find the directories taking the most space.
-- 
Linux Tips:     https://www.tiger-computing.co.uk/category/techtips/

-- 
  Next meeting: Online, Jitsi, Tuesday, 2021-02-02 20:00
  Check to whom you are replying
  Meetings, mailing list, IRC, ...  http://dorset.lug.org.uk
  New thread, don't hijack:  mailto:dorset@mailman.lug.org.uk

Reply via email to