Wednesday 6 May 2015

Introduction to linux commands

Linux file system hierarchy and basic commands

/ is the root folder. It contain other folders such as root, home, usr, etc, dev, var, bin, boot, run, sbin, tmp.

/root  : Home directory for the super user. i.e., root
/home: Home directory for regular users where there personal data's are stored.
/usr    : Installed software, shared libraries, include files and static read only program data.
/etc    : All the configuration files are stored here.
/dev   : All the device files are listed here.(All hardware are treated as file in Linux)
/var    : Files that dynamically change (variables). All log files are found in this directory.
/tmp   : Contains temporary files. Files older than ten days are deleted automatically in all Linux systems.

Some basic commands and its uses

touch: Used to create an empty file of any type.

syntax: touch <filename.type>

eg: touch newfile.txt
  
This command will create an empty file newfile.txt in the present working directory.
eg: touch /home/newfile.txt
This command will create an empty file newfile.txt in the home directory.

cd: This command is used to change working directory.

syntax: cd <path>

eg: cd /etc/var
This command changes the present working directory to /etc/var

pwd: This command shows the present working directory.

syntax: pwd
eg: pwd

mkdir: This command is used to make a new directory

syntax: mkdir <directoryname>

eg: mkdir newdirectory
This command will create a new directory on present working directory.
eg: mkdir /home/newdirectory
This command will create a new directory in home directory.

ls: This command is used to list all the files and directories in pwd.

syntax: ls [option]

eg: ls -l
this command will list all the files and folders in the pwd.


          

Introduction to linux

Lets start with some Linux talks...

There may questions arise why Linux is used more than windows for system administration and networking purpose.Only noobs raise this question. Yes, off course I also raised the same question to my tutor an year ago. Answer was simple,Security, it was the reason for choosing Linux as a tool for system administration, network management and in servers. And Linux is also cost effective than windows. I also choose Linux because it's open source. More secure, reliable and faster than
Windows. This is not a Linux vs windows talk.. so I am stopping here. Now We can learn some basic commands in Linux.

About the blog

About the articles here

What I always share here may be collected genuine information's from across the web or textbooks written by others. There is nothing that I can share you by my own because I am still studying..;)