Article 1: Linux commands : to make day to day life walkover
In windows most of us use to perform task with the help of mouse and keyboard (although we can perform these task using cmd ), where in Linux all these task can be performed by typing some simple and short commands on terminal.
Before discussing commands we should know about directory in Linux which is similar to folder in windows and a basic idea about terminal.
The Structure of Directory
All the files are grouped together in the directory structure. The file-system is arranged in a hierarchical structure, like an inverted tree. The top of the hierarchy is traditionally called root (written as a slash / )
In the diagram above, we see that the home directory of the undergraduate student “ee51vn” contains two sub-directories (docs and pics) and a file called report.doc. The full path to the file report.doc is “/home/its/ug1/ee51vn/report.doc”
Launching a Terminal
A Terminal is a command interpreter. A Terminal is an entity that takes text based input from the user and deals with the computer to generate output.
How to launch a terminal:
Instead of this you can use a short cut to open a terminal in Linux : Ctrl + Alt + t
A Linux terminal window will appear as follows:
Listing Files and Directories
ls ( list): when you start your Linux OS, your current working directory will be your home directory. Your home directory has the same name as your user-name.
To check what is in your home directory or in another directory just type ls in terminal.
To check hidden files in your directory, just type ls -a in terminal . It will show all files including those whose name start with dot (.)
mkdir: we can make a new directory by typing a simple command in terminal.
We will now make a subdirectory in your home directory to hold the files you will be creating and using in the course of this tutorial. To make a subdirectory called unixstuff in your current working directory type
To see the directory you have just created, type
Changing to a different directory
cd: The command cd directory means change the current working directory to a different directory.
To come out from a directory:
To change directory
To come in your home directory type
pwd (print working directory): Pathnames enable you to work out where you are in relation to the whole file-system. For example, to find out the absolute pathname of your directory.
above commands in a tabular form:
|ls||list files and directories|
|ls -a||list all files and directories|
|mkdir||make a directory|
|cd directory||change to named directory|
|cd||change to home-directory|
|cd ~||change to home-directory|
|cd ..||change to parent directory|
|pwd||display the path of the current directory|
Click here, to know about copy,move, remove, head and tail commands.