Skip to main content

Basic and Commonly used command in Unix #DOTC_Mdb

Basic and Commonly used command in Unix.

Hello Everyone ,

In Previous Blog I have discussed about the basic concept of Unix Operating System .Today I will provide a summary of some of the common basic and advanced Unix commands along with the commonly used syntax for those commands.In next blog i will come up with some Advance command in Unix. Before starting command please see my previous blog of Unix as below for your understanding:

https://dheeraj60.blogspot.com/2020/08/basic-concept-of-unix-operating-system.html

Logging into Unix System: Once you login to the system, it will show a login prompt for the user to enter their username and password. If the user enters a valid username and password, then the system will log in the user and start a login session. After this, the user can open a terminal that runs a shell program and able to write commands.

Logging out of Unix : When the user want to end their session, they can terminate their session by logging out of the terminal or the system by using exit command.

Commonly used command in Unix :

Note : I am using putty tool to access Unix server

ls - Lists all the names of files in a particular Unix directory. If you type the ls command with no parameters or qualifiers, the command displays the files listed in your current working directory.

ls –lrt  - This command will show you all the files in Unix with timestamp and also you can see the permission of file .

Below is the output in Putty for ls and ls –ltr  command , I used this command in root dirctory.


ls –alrt  - This command is use to show the hidden files as well in the current directories .

Below is the output in Putty.


cal command : cal command in unix shows the calendar for particular month and year.Suppose I want to see the calendar of September 2019 we use below command .

cal 9 2019

Below is the output in putty terminal


Date command : date command show you the current date also we can show it in different format . if I want to show date in dd/mm/yy format then command will be :

 date +%d/%m/%y

Below is the output in putty terminal.


banner: Prints a large banner on the standard output . Suppose I want to display Diksha oracle Training Centre through banner command then we use

$ banner  Diksha Oracle Training Centre

who command: Displays the list of users currently logged in server.

Below is the output of who command in putty as of now 4 user is active.


whoami: This command will displays the user id of the currently logged in user.

$ whoami

Below is the output in putty terminal it will show you the currently logged in user only .


$ mkdir DOTC

DOTC directory will be created after this command . See the output in putty terminal.


Now we will create one file by using cat command in DOTC directory

cat command : cat command is use to see the file content and also Concatenate files and print to stdout.

Below is the command :

$ cd DOTC

$ cat > dheeraj

Welcome to Diksha oracle training Centre

To see the file we use below command

$ cat dheeraj

Note : cd command we use to go in another directory and if we want to back in before directory we use cd .. command.

Below is the output of cat command in Unix Putty terminal .


cp:  cp command is mainly used to copy files in other directory . suppose I want to copy dheeraj file to /home/u255474504 from DOTC directory then we use below command .

$ cp dheeraj  /home/u255474504

Below is the output in putty terminal as dheeraj file will be available in home directory.


mv command in unix : mv command is mainly used to move the file from one directory to another directory. The basic difference between mv and cp command is cp command keep the file in both directory whereas mv command basically remove files from base location and put it in another directory.

Below is the command issued in DOTC directory.

$ mv dheeraj  /home/u255474504

After this command dheeraj file is moved to /home/u255474504 directory and in DOTC directory you will not able to see dheeraj file .

mv command in unix : mv command is mainly used to move the file from one directory to another directory. The basic difference between mv and cp command is cp command keep the file in both directory whereas mv command basically remove files from base location and put it in another directory.

Below is the command issued in DOTC directory.

$ mv dheeraj  /home/u255474504

After this command dheeraj file is moved to /home/u255474504 directory and in DOTC directory you will not able to see dheeraj file .

Below is the output in putty terminal. See it carefully to understand.

rm:  rm command use to remove files and directories

$ rm dheeraj

rmdir:  rmdir used to remove a directory

$ rmdir DOTC – here it’s not worked so I use below command

$ rm –rf DOTC – rf means recursively and forcefully

I am using both the command in terminal and see the output below carefully .


Here file and directory dheeraj and DOTC both removed from the system.

Pwd : pwd command is basically use to see in which directory you are . to use this simply type pwd in command prompt.

$pwd

Output of above command is as below :


In Unix so many commands is there . In next blog I will come up with several useful command like grep , sed , find , vi editor , cronjob, process (ps command) etc . Also will come up with basic shell script so that you can able to write some shell scripts .

Please go through this blog carefully and try to practice this command as much as you can , so that in next blog I will come up with some advance command and basic shell scripts so it’s easy for you to understand . For any questions let me know .

Thanks.


Comments

Post a Comment

Popular posts from this blog

SQL and Classification of SQL in Oracle Database #Diksha Oracle Training Centre

  SQL and Classification of SQL in Oracle Database.   SQL is Structured Query Language , which is used for storing, manipulating and retrieving data stored in a relational database .SQL is the standard language for RDBMS. All the Relational Database Management Systems (RDMS) like Oracle, MySQL, Sybase, Informix, IBM DB2 and Microsoft SQL Server use SQL as their standard database language. Oracle is one of the more secured database as compared to other databases. Importance of   SQL : SQL and PL/SQL is a backend process where all data is stored and retrieved in GUI which created either by any programming languages like Java, C++, PHP etc. so we need to have very secure database so that there will be no impact for users. SQL allows users to access data in the relational database management systems. SQL is used to communicate with a database.SQL and PL/SQL allows users to create and drop databases tables , views , stored procedures , functions , packages , trigger etc. SQL allows

Materialized View uses and Benefits in Database #DOTC_Mdb

Materialized View uses and Benefits in Database. Hello Everyone, Today we will discuss about Materialized view as it’s play important role in database. We already discussed about Simple Views and complex views in my previous blog. Before Materialized view go through my previous blog which related to simple view. https://dheeraj60.blogspot.com/2020/05/benefits-of-creating-and-using-view-in.html As we know View is not a database object and not like table which is stored in database, but view can be created from base table a view is an SQL statement that’s stored in the database. This statement, or view, has a name.A view looks and acts a lot like a table. It has columns and rows, and can be included in SELECT queries just like a table. In other word we can say View is a virtual/logical table which is basically used for security purpose. Let’s understand   about   Materialized view : A materialized view is a view that stores the results of the view’s query. Whenever you query the ma

Top 50 Interview Questions On SQL and PL/SQL #DOTC_Mdb

                    Top 50 Interview Questions On SQL and PL/SQL. Today we will Discuss Top 50 interview questions and answers of SQL and PL/SQL which is frequently asked in interview.     Question 1: What is SQL and Classification of SQL? Answer SQL is a Structure Query Language which is vastly used in RDBMS database like Oracle, Sybase, DB2 , Microsoft SQL server etc.   Classification of SQL is as below: DDL (Data Definition Language):  Commands are  create , alter , drop , truncate etc DML (Data Manipulation Language) : Commands are  insert,update and delete . TCL (Transaction Control Language ) : Commands are  Commit , Rollback and Save point. DCL (Data Control Language) : Commands are Grant , Revoke Question 2:    What is meant by Joins? What are the types of join? Answer Joins are basically used to extract/get data from multiple tables using some common columns or conditions and also by using alias to fulfill the condition.   There are various types of Joins as li