3

HELP! I think I broke my DESKTOP :/

I was playing around with the Terminal and trying to practice moving, renaming, and copying files when I think I screwed something up.

I was attempting to move multiple .txt files using the *wildcard but it wasn't working, so I began to play around with it and I did something wrong.

I am no longer able to list the content of the home directory using ls command

Here is a list of a few of the commands.

212  mv Desktop/*.txt Desktop/texts/*.txt
213  ls Desktop
214  mv Desktop *.txt
215  Desktop/texts
216  mv Desktop *.txt Desktop/texts
217  mv Desktop *.txt Desktop/texts/
218  mv Desktop *.txt ~/Desktop/texts/
219  mv Desktop *.txt ~/Desktop/texts
220  mv Desktop *.txt ~/Desktop/

Here is Outputfrom Command find ~ -not -path '*/\.*' -type f -name '*'

/home/dlundy1/Desktop/examples.desktop
/home/dlundy1/*.txt/test5
/home/dlundy1/*.txt/texts/task
/home/dlundy1/*.txt/texts/tasks
/home/dlundy1/*.txt/texts/tasks~
/home/dlundy1/*.txt/test2
/home/dlundy1/*.txt/test6
/home/dlundy1/*.txt/test1
/home/dlundy1/*.txt/test4
/home/dlundy1/*.txt/test3
/home/dlundy1/*.txt/test
/home/dlundy1/Pictures/my pics/me
/home/dlundy1/Pictures/temp/Flyer.jpg
/home/dlundy1/Pictures/Screenshots/s.png
/home/dlundy1/Pictures/Screenshots/Selection_001.png
/home/dlundy1/Pictures/Selection_001.png
dlundy1@dlundy1-HP-Pavilion-g7-Notebook-PC:/$ ^C
dlundy1@dlundy1-HP-Pavilion-g7-Notebook-PC:/$

Here is Output from command ls -l ~

total 32
drwxr-xr-x 3 dlundy1 dlundy1 4096 Apr 16 14:59 Desktop
drwxr-xr-x 2 dlundy1 dlundy1 4096 Apr 15 22:06 Documents
drwxr-xr-x 3 dlundy1 dlundy1 4096 Apr 16 00:30 Downloads
drwxr-xr-x 2 dlundy1 dlundy1 4096 Apr 15 22:06 Music
drwxr-xr-x 5 dlundy1 dlundy1 4096 Apr 16 11:54 Pictures
drwxr-xr-x 2 dlundy1 dlundy1 4096 Apr 15 22:06 Public
drwxr-xr-x 2 dlundy1 dlundy1 4096 Apr 15 22:06 Templates
drwxr-xr-x 2 dlundy1 dlundy1 4096 Apr 15 22:06 Videos
  • Please post the output of find ~ -not -path '*/\.*' -type f -name '*'. Please copy and paste, don't type – Helio Apr 16 '15 at 18:41
  • It seems You've been trying to move Desktop and those files... – Jacajack Apr 16 '15 at 18:43
  • 2
    @dlundy1 "I am no longer able to list the content of the home directory using ls command" What happens when you try to do that? Is nothing displayed, or is there some error message, or something else altogether? Also, the output you've given isn't really readable in a comment, and some information might even be lost. Instead, please edit your question to provide it (and any other additional info you have). To make text from the Terminal appear correctly in your question, paste it in, select it, and press Ctrl+K (or click the {} tool in the editing toolbar). This formats it as code. – Eliah Kagan Apr 16 '15 at 18:45
  • ** Eliah** Yes, nothing is displayed. – dlundy1 Apr 16 '15 at 18:48
  • 1
    In case you haven't already figured it out mv Desktop/*.txt Desktop/texts/*.txt doesn't do the kind of cool pattern-matching think you were probably hoping it would. mv Desktop/*.txt Desktop/texts/ will move all the .txt's to the 'texts' subdir, but your command won't. Not exactly sure what; might move all of them to single file called \*.txt, possibly deleting most of them, or more likely fail unless there's exactly one .txt in the source dir. In any case, you're not doin it rite. – user3113723 Apr 16 '15 at 21:48
7

What happened?

You've renamed the Desktop directory to *.txt by using the mv command. Unfortunately, the asterisk on the file name will probably be interpreted as a glob pattern, keeping you from repairing the mistake.


Reverting the operation

From the graphical interface

  1. Open the File Manager.
  2. Go to you home folder.
  3. Locate a folder called *.txt.
  4. Rename it to Desktop

From the command line

Running mv "/home/dlundy1/*.txt" /home/dlundy1/Desktop will be enough, as any argument wrapped by simple or double quotes won't be interpreted as glob.

  • 2
    Wow, such a simple solution. Thanks, It worked! – dlundy1 Apr 16 '15 at 20:20
  • 1
    @dlundy1 if it worked, please click the tick next to it to mark it as accepted. – muru Apr 19 '15 at 14:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.