-3

How can i fix "ls > less" in Cent-Os. I made this mistake in the process of learning Linux. Being new to the platform and Os and learning from a manual i read the command in a context and thought to see what it does, now after some research i'm still unable to fix it, can someone please help me?

1
  • 2
    What exactly is your problem? Nov 15, 2013 at 10:18

1 Answer 1

2

If you did a ls > less in some local directory, you've just created a file called less, which contains a listing of the current directory. No big deal… just delete it:

rm ./less

Unless, of course, you were in /usr/bin and had root privileges. Because then you overwrote your system's less command. Then, you should restore it from a backup. If you don't have a backup, you should do a system reinstallation, but of course backing up your home directory and important configuration before you wipe your drive. In any case you should take a note never to run under root privileges when you're not 100% sure what you're doing.

If you're not up for a reinstallation and don't have a backup, you can use another pager instead of less, e.g. the not as nice more, by running cp /usr/bin/{more,less}. But that's really not recommended.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .