LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   "ls -s" by an accident (https://www.linuxquestions.org/questions/linux-newbie-8/ls-s-by-an-accident-830192/)

Mr. Alex 09-03-2010 01:05 PM

"ls -s" by an accident
 
Hi everybody!

Performed
Code:

# ls -s /usr/share/ ~/.icons/default
by an accident. How do I undo it?

ruthinman 09-03-2010 01:06 PM

harmless
 
"ls" is just a command to list filenames to the screen... it's nothing to be "undone".
the -s option lets you list them by size.

ncsuapex 09-03-2010 01:08 PM

Did you actually do an:

Quote:

ln -s /usr/share/ ~/.icons/default

by chance?

Mr. Alex 09-03-2010 01:32 PM

No, I did "ls". So it's not "ln", it's good. :)
What if I did "ln", how to undo that?

PTrenholme 09-03-2010 02:57 PM

I note that you posted a command that was, apparently, run in a "root" terminal. (Judging from the "#" at the start of the command.)

If that's the case, may I suggest that you "cease-and-desist" running with "root" privileges until you're more familiar with Linux commands? You can do almost everything except make catastrophic mistakes using a regular account, especially if you've added yourself to the sudoers file.

Note that this is advice only. It's your system, and your problem if you mess up.

And, to answer your question, just unlink (with rm)the file that the link command will have created.

MTK358 09-03-2010 03:37 PM

Quote:

Originally Posted by Mr. Alex (Post 4087280)
No, I did "ls". So it's not "ln", it's good. :)
What if I did "ln", how to undo that?

What made you think that "ls" would damage files?

frankbell 09-03-2010 08:51 PM

If you did "ln -s [path]," it would do nothing more than create a symbolic link ("symlink") to a folder or file. The resulting link often appears in midnight commander prefaced by a tilde ("~").

You could undo it by deleting the link, either through a graphical file manager or a terminal command.

With an "ls" command, there is nothing to undo.

There is a good section on symlinks in the Slackbook.

ruthinman 09-03-2010 11:18 PM

Study basic commands first
 
I have to agree with PTrenholme, you really need to do a little reading before trying out commands logged in as "root". Even a Linux for Dummies book (no insult intended) would be a good place to start. Or a Linux tutorial online. Start with the basic commands... and go from there. I used to teach Unix, and the "ls" command was one of the first ones we teach.


All times are GMT -5. The time now is 11:22 AM.