3. Command lines for Linux

Posted: September 14, 2011 in Linux

Today I’ve been working on some basic command lines to use with Linux. Most computer users rarely take advantage of the easy CLI, as in command line interface, while it obviously needs some practicing first, but it surely has a lot of benefits comparing to graphical user interfaces, GUI’s. Tasks that are performed within 20 clicks in GUI can be done with one command line. Here are some basic command lines that I’ve learned on course ICT1TN002-24.

1. $ ls

Command line used for showing your files or folders/directories in your current location. (ls -t shows files in the order of modification.)

2. $ pwd

Command line showing your full path name to current location (like a map) from root to top.

3. $ cd DIRECTORY NAME

This line changes your location to some other directory that you wish to go to. If you wish to move back to an upper directory, type cd .. (two dots.)

4. $ mkdir FOLDER NAME

With mkdir you can create new folders with any name. It will be created to that location.

5. $ man COMMAND NAME

This one opens a manual or instruction pages for a certain command line. If you are uncertain of a command, check it from here and be sure of what you’re doing.

Here are some commands for administrative purpose:

6. $ sudo apt-get update

Updates/synchronizes your list of available packages with the servers in source repositories. Be sure to do this before you install anything.

7. $ apt-cache search NAME

Searches for packages/softwares that could match your search.

8. $ apt-cache show NAME

If you’re not sure what to look, this command line shows details of the package and short description.

9. $ sudo apt-get install NAME

So now that you know what you’re out to get, this command installs the package on your computer. ‘Sudo’ command gives you administrator rights, but you probably need to give a password as well. (Though writing doesn’t show, it does not mean that it’s not there.)

10. $ sudo apt-get upgrade

This one downloads & installs any newer versions of your installed programs.

Leave a comment