0

I am working through a tutorial - The Linux Command Line for Beginners - and I want to delete my work so far and start over. I have a directory called tmp within the root directory which has a solid green box around it. If I ls this directory I get a config error. I don't know what this means and I can't delete it.

Can you help please?

peter@peter-HP-ProDesk-400-G5-MT:~$ cd /
peter@peter-HP-ProDesk-400-G5-MT:/$ ls
bin    dev   lib    libx32      mnt   root  srv       timeshift  var
boot   etc   lib32  lost+found  opt   run   swapfile  tmp
cdrom  home  lib64  media       proc  sbin  sys       usr
peter@peter-HP-ProDesk-400-G5-MT:/$ cd tmp
peter@peter-HP-ProDesk-400-G5-MT:/tmp$ ls
config-err-MUm7iD
mintUpdate
MozillaUpdateLock-4F96D1932A9F858E
systemd-private-bc10ea19133a48fd8e526c45b179e6cf-colord.service-CPuYYO
systemd-private-bc10ea19133a48fd8e526c45b179e6cf-ModemManager.service-dUDoww
systemd-private-bc10ea19133a48fd8e526c45b179e6cf-switcheroo-control.service-Z8zyOX
systemd-private-bc10ea19133a48fd8e526c45b179e6cf-systemd-logind.service-7z9IHP
systemd-private-bc10ea19133a48fd8e526c45b179e6cf-systemd-resolved.service-vLAsUl
systemd-private-bc10ea19133a48fd8e526c45b179e6cf-upower.service-fxuTWM
tutorial

I have copied the screen as above but note: the directory entitled 'tmp' has a green solid box over it but is not shown on this screen grab. Also the word 'mintUpdate' shown in the output of running ls int he tmp/ directory has a solid green box not shown.

5
  • 2
    Hello PeteSweet. 1. Why are you working in the root directory? 2. When you say the root directory do you mean / (the root of the filesystem tree) or /root (the home directory for the root user account)? 3. What is the config error? Commented Dec 16, 2024 at 11:20
  • Please provide information in your question, ideally just as if you'd provided it at the beginning. Don't reply here in the comments Commented Dec 16, 2024 at 11:21
  • Is "root directory" /root or /? Can you edit your question with the output of ls -la /root or ls -la /? "green box" could mean a few things, but the output of ls will tell us the permissions of the tmp directory. Since you're learning command-line, you'll find that it's much easier to copy-paste command line inputs/outputs than to describe how a window looks. That's one of the benefits Commented Dec 16, 2024 at 11:57
  • Is the "solid green box" a highlight over the directory name in a terminal window? This would generally indicate an issue with permissions, such as allowing normal users to change root-owned sub-directories. You cannot delete a directory which has directories or files within it. The diagnostics suggested above would be helpful. Commented Dec 16, 2024 at 12:08
  • 1
    Your transcription of your terminal shows that you have a file called “config-err-MUm7iD” in your /tmp directory.  We can’t tell what that is.  P.S. I suggest that, if you want useful information, you get into the habit of using ls -la. Commented Dec 16, 2024 at 15:53

1 Answer 1

2

That isn't an error. You are using the command ls which simply lists the contents of a directory. If you don't give it a directory, it lists the contents of the directory where you are.

In your case, you are moving into the /tmp directory (cd / followed by cd tmp, which is equivalent to cd /tmp), and then running ls there. You see various files and directories, including one, config-err-MUm7iD, whose name happens to contain the word error. But that is just a file name, it doesn't mean anything and it certainly doesn't suggest you are getting an error.

Now, if you want to delete a directory, you can do so with rm -r /path/to/directory. So, for example, to delete the tutorial directory (assuming that is a directory, you can confirm by running ls /tmp/tutorial/ and then checking if your files are in there) you could do rm -r /tmp/tutorial/.

However, since you are clearly only beginning to learn the command line, be very careful! Giving the wrong directory name could end up deleting something completely different. You might want to think of renaming it instead, then creating a new directory to run through your tutorial and only deleting the old one after doing the tutorial, at which point you should be more familiar with the command line. You can do this with:

## Move into the /tmp directory
$ cd /tmp
## Rename (move, mv) "tutorial" to "tutorial.old"
$ mv tutorial tutorial.old
## make a new tutorial directory
$ mkdir tutorial
## move into it
$ cd tutorial

Finally, anything you do inside /tmp will be deleted the next time you reboot your system. So if you want to keep this, I suggest moving to your user's home directory (cd with no arguments) and then mkdir tutorial there so you can continue after rebooting if you need to.

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.