What I’d like to share with you today, are some useful tips I’ve learned while exploring my Linux OS. First you have to know that, using a ‘nix’ system will lead you to use the terminal sooner or later, to install something or just use it because you want to be a smart ‘nix’ user!!! These systems have a lot of commands that you can use for almost everything, from folder creation to file editing but what is a “shell”?
A shell is
- A program that interprets commands
- Something capable to execute scripts and user typed programs.
- An interface to the operating system
Most Linux systems replaced the standard shell /bin/sh with the Bourne Again Shell BASH, which has all the original features plus some extensions that make it easier to program with and use from the command line.
Here you can find an A-Z list of Linux commands
One of the commands I find really useful is locate filename which searches for the filename you give it in its files database, using the options you selected. To find out which options are allowed for locate you can open the terminal (Ctrl+Alt+t) and run:
this will show out the help manual page regarding the locate command.
One of the basic command is cd Change Directory, which let you surf through your filesystem. If you start typing and the directory exists, you can press your Tab button to complete the command so try it out:
this last command will bring you to the parent folder, which is /usr/local.
If you don’t remember a recently used instruction, a nice way to look for what has been done is using the arrow up/down keys; this will let you go through all the commands you typed.
Last but not least, how you can have a look to all the files in a folder? Well this is simple, just type:
What if the lis of files is too large to be seen on the window? Let’s use a powerful feature called “piping”; this let’s you combine a series of commands to have the desired result. To limit the length of files’ list what you can do is:
ls | more
using these two command together will limit the list and let you easily examine it. To continue reading, simply use the space bar.
So, I hope you will enjoy these small tips and remember, always use man if not sure about the command’s options you’re using.