At this point, you are 'root'. All your commands will be executed, even if they're unsafe, or even if you ask to delete the entire machine. Best to exit out of the root account:
If it says `-rw-r--r-- 1 root root 8 Dec 11 17:26 hostname` then the file is owned by 'root'.
Take your file and change the owner to root:
> sudo chown root my_file
Change the same file so it's owned by the group 'audio':
> sudo chown :audio my_file
Check you did that correctly:
> ls -l my_file
`-rw-r--r-- 1 root audio 0 Jan 3 19:20 my_file`
Read the start of that line. Root can 'read' and 'write' to or delete the file. Try to remove (delete) it:
> rm my_file
You'll see you're not allowed, because you don't own it.
Look at which groups you're in:
> groups
Change the file so that members of the audio group can write to the file:
> sudo chmod g+w my_file
Check you got it right with `ls -l`:
> -rw-rw-r-- 1 root audio 0 Jan 3 19:20 my_file
Try to delete the file again:
> rm my_file
If you can't, you're not in the audio group. Add yourself. You'll need to *modify* your *user account*, by **a**ppending 'audio' to your list of groups.
Use `-a` to **a**ppend, and `-G`, to say you're modifying groups:
> sudo usermod -a -G audio [ your username here ]
Now you should be able to remove (delete) the file. Remember, that using 'rm file' will not send it to a recycling bin. The file is gone.
# Directories
Make a directory called 'new test':
> mkdir 'new test'
Make two directories, called 'A', and 'Z':
> mkdir A Z
# Text Searches
Measure the disk usage of everything ('\*' means 'everything'), and put it in a file called 'disk usage.txt':
> du -sch * > A/'disk usage'.txt
Look at your file:
> cat A/'disk usage.txt'
If you think you have too much information, use `grep` to just get the one line of text you want:
> grep total A/disk\ usage.txt
The `grep` program also has a manual ('man page'). You should find out what that `-c` flag does, but the manual is too long to read.
Start the manual:
> man du
Then search for `-c` by pressing `/`. Your final keys should be `man du`, then `/-c`
Find out if the `ls` program also has a 'human readable' format by using `grep` to search for the word 'human':
> man ls | grep human
Now use that flag that you've found in combinatin with the `-l` flag to look at a file.
The 'A' directory will not budge because it's not empty. Remove it recursively, so the computer will remove the things inside the directory as well as the directory itself: