Wednesday, June 15, 2011

--- UNDERSTANDING THE COMMAND LINE ---

Unlike windows, the GUI is completely optional in Linux. You can, if you like, run your Linux systen with no graphical environment at all. As Linux evolved different GUIs have been built on top of it. The command line will be your best friend and weapon, it allows you to perform actions that are not easy to administrate from the desktop (or GUI Graphic User Interface).

We will use Terminal to gain access to the command line. Now lets look at a real-life example that uses the command line to meet specific need. Once you understand the components of the command line and the complexity of the GUI, you will start to love the practical utility of the command line.

[ray@mycomputer ~]$ find /var/backup/* -ctime +5 -exec rm {} \;


This command removes my system backups that are more than 5 days old. The command uses the find command to search for files in the /var/backup directory. For each file that the the find tools locates, it runs the rm command, wich stand for and executes remove. 


This looks complicated, however would you do the same in the GUI you would have to complete up to 9 steps to have the same result.

In real life you would not actually run this command three times a week, no the beauty of the command line is that you can automate it with scripts

No comments:

Post a Comment