Linux Commands

Command Line Interface

The Command Line Interface (CLI), is a non-graphical, text-based interface to the computer system, where the user types in a command and the computer then successfully executes it. The Terminal is the platform or the IDE that provides the command line interface (CLI) environment to the user. The CLI terminal accepts the commands that the user types and passes to a shell. The shell then receives and interprets what the user has typed into the instructions that can be executed by the OS (Operating System). If the output is produced by the specific command, then this text is displayed in the terminal. If any of the problems with the commands are found, then some error message is displayed.

We can open the terminal by typing Ctrl + Alt + T short-key or by right-clicking the mouse and selecting the Open New Terminal option. The terminal window looks like given below

 

Basic syntax of Linux Commands

A command is an instruction given by a user telling a computer to do something, such a run a single program or a group of linked programs. Commands are generally issued by typing them in at the command line (i.e., the all-text display mode) and then pressing the ENTER key, which passes them to the shell.

A shell is a program that reads commands that are typed on a keyboard and then executes (i.e., runs) them. Shells are the most basic method for a user to interact with the system.

 

Options and Arguments

This brings us to a very important point about how most commands work. Commands are often followed by one or more options that modify their behavior, and further, by one or more arguments, the items upon which the command acts. So most commands look kind of like this:

Most commands use options consisting of a single character preceded by a dash, for example, “-l”, but many commands, including those from the GNU Project, also support long options, consisting of a word preceded by two dashes. Also, many commands allow multiple short options to be strung together.

 

Command History

Most Linux distributions remember the last 500 commands by default. Press the down-arrow key and the previous command disappears.

Some Basic Linux Commands

 

Date Command:

This command is used to display the current data and time.

Syntax:

$date

$date +%ch

Options:

a = Abbreviated weekday.

A = Full weekday.

b = Abbreviated month.

B = Full month.

c = Current day and time.

C = Display the century as a decimal number.

d = Day of the month.

D = Day in “mm/dd/yy” format

h = Abbreviated month day.

H = Display the hour.

L = Day of the year.

m = Month of the year.

M = Minute.

P = Display AM or PM

S = Seconds

T = HH:MM:SS format

u = Week of the year.

y = Display the year in 2 digit.

Y = Display the full year.

Z = Time zone

To change the format:

Syntax:

$date “+%H-%M-%S”

 

 

Calendar Command: This command is used to display the calendar of the year or the particular month of calendar

Syntax :

$cal

 

To see the current amount of free space on your disk drives, enter df:

 

Likewise, to display the amount of free memory, enter the free

 

We can end a terminal session by either closing the terminal emulator window, or by entering the exit command at the shell prompt

 

’who’ Command: It is used to display who are the users connected to our computer

Syntax:

$who – options

Options : –

H–Display the output with headers

b–Display the last booting date or time or when the system was lastly rebooted

’who am i’ Command: Display the details of the current working

Syntax:

$who am i

 

CLEAR’ Command: It is used to clear the screen.

Syntax:

$clear

 

MAN Command: It help us to know about the particular command and its options & It

is like “help” command in windows .

Syntax:

$man <command name>

Activities:

  1. In GUI open the Libre Office writer tool create a document that contains information about your favorite place. Try the following short- keys while formatting the document

 

Related Links  to Operating System topics

Operating system Course content

Lab Practice Task

 

#Operating System complete course #Operating System past paper #Operating System-project #Computer Science all courses  #operating system Problem with source code#University Past Paper #Programming language #Question paper #old paper #Operating System-Functions and History #Generations of Operating System #Functions of an Operating System #Components of Operating System #Types of Operating System #Services of Operating System #Properties of Operating System #Processes in Operating System #Process Scheduling in Operating System #Introduction to Linux Ubunto #Installation with virtual Box #Writing Linux Commands #Navigation in File System and Directory Management in Ubunto using CLI #File Handling and I/O Redirection In Ubunto #File Access Permission in Linux #Text Processing Tools and Basic System Configuration Tools in Linux #Package Management in Linux #How to manage processes in Linux #Compiling and Executing C++ programs in Linux #System Calls #Introduction To Shell Programming

Search within CuiTutorial

Scroll to Top