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 et...

Basic SQL Commands in Oracle Database #Diksha Oracle Training Centre

  Basic SQL Commands in Oracle Database.   Hello Everyone, In my previous blog I discussed about SQL and Classification of SQL . Today I will discuss about SQL basic commands which widely used in RDBMS. The Topics of SQL command which I am going to cover in this blog are mainly divided into four Categories: ·         DDL:   DDL consists of commands which are used to define and design the database. ·         DML:   DML consists of commands which are mainly used to manipulate the data in the database. ·        DCL: DCL Consists of commands which deal with the user permissions/access and controls in the database. ·       TCL:   TCL Consist of commands which deal with the transaction in the database. If you want to explore theory part please follow my below blog as in today blog I will discuss about how to use the commands. h...

Pseudo Column in Oracle #Diksha Oracle Training Centre

  Pseudo Column in Oracle. Hello Everyone, Today I will discuss about Pseudo column in Oracle. This topic is very important so before going to read this blog, I suggest you to please see my previous blogs which is in archive folder for your reference so that it’s easy for you to understand this topic. Let’s discuss about Pseudo Column in Oracle. Pseudo column: A pseudo-column is dynamic in Oracle as it behaves like a table column but is not stored in the table. Pseudo column behaves like a table column, but is not actually stored in the table. You can select from pseudo columns, but you cannot insert, update, or delete their values. A pseudo column is also similar to a function without arguments. In   Simple word we can say Pseudo column is a column that yields a value when selected, but which is not an actual column of the table. An example is RowID or SysDate. It can be use in combination with the DUAL table. Below are the Pseudo Column commonly used in Oracle Dat...