You are on page 1of 10

LS

ls lists directory contents of files and directories.

ls -i list file's inode index number


ls -l list with long format - show permissions
ls -la list long format including hidden files
ls -lh list long format with readable file size
ls -ls list with long format with file size

ls -r list in reverse order

who
The who command is used to get information about currently
logged in user on to system.
EG:
:~$ who
hduser tty7 2018-03-18 19:08 (:0)

TTY
The terminal is also represented as a file. There a command
exists called tty which displays information related to termi‐
nal.

SYNTAX

tty [OPTION]....

Eg::~$sudo tty
/dev/pts/0

ECHO

echo command is used to display line of text/string that are


passed as an argument .
This is a built in command that is mostly used in shell scripts
and batch files to output status text to the screen or a file.
e.g.:
echo “hello world”

COMBINE COMMANDS IN UNIX

FOR combine the commands we use pipe line ‘|’


where it combines multiple commands in single
line.

e.g.:
We want to combine:
find -name deleteme.tar
tar -xvf deleteme.tar
rm -r delete/*

After combining
find -name deleteme.tar | tar -xvf deleteme.at | rm -r
delete/*

DATE

date command is used to display the system date and time.


date command is also used to set date and time of the system.
e.g.:
Command:
$date
Output:
Tue Oct 10 22:55:01 PDT 2017

Command:
$date -u
Output :
Wed Oct 11 06:11:31 UTC 2017

BC

bc command is used for command line calculator. It is similar to


basic calculator by using which we can do basic mathematical
calculations.

EG:
Input : $ echo "12+5" | bc
Output : 17
Input : $ echo "10^2" | bc
Output : 100

SCRIPT
script command in Linux is used to make typescript or record
all the terminal activities.

Syntax:
script [options] [file]

CAL
cal command is a calendar command in Linux which is used to
see the calendar of a specific month or a whole year.
e.g:
Syntax:
cal [ [ month ] year]

• cal : Shows current month calendar on the terminal.

• cal 08 2000 : Shows calendar of selected month and year.


Banner

banner command in linux is used to print the ASCII character


string in large letter to standrad output.
Syntax:
banner text

Example 1: Printing “1234567890” in large letters.


CALENDER
CAL AND CALENDER ARE BOTH SAME
The cal command is a command line utility for displaying a
calendar in the terminal. It can be used to print a single month,
many months or an entire year

PASSWD

passwd command in Linux is used to change the user account


passwords. The root user reserves the privilege to change the
password for any user on the system
Syntax:
passwd [options] [username]

Example:
Command: passwd

CAT

Cat(concatenate) : It reads data from the file and gives their


content as output.
1)Command:
$cat filename
Output
It will show content of given filename
2) To view multiple files
Command:
$cat file1 file2
Output
This will show the content of file1 and file2.
3) To view contents of a file preceding with line numbers.
Command:
$cat -n filename
Output
It will show content with line number
example:-cat-n geeks.txt
1)This is geeks
2)A unique array

4) Create a file
Command:
$ cat >newfile
Output
Will create and a file named newfile
5) Copy the contents of one file to another file.
Command:
$cat [filename-whose-contents-is-to-be-copied] >
[destination-filename]
Output
The content will be copied in destination file
6) Cat command can suppress repeated empty lines in out‐
put
Command:
$cat -s geeks.txt
Output
Will suppress repeated empty lines in output
7) Cat command can append the contents of one file to the
end of another file.
Command:
$cat file1 >> file2
Output
Will append the contents of one file to the end of
another file

UNAME

The command ‘uname‘ displays the information about the sys‐


tem.
Syntax:
uname [OPTION]
1. -a option: It prints all the system information in the following
order: Kernel name, network node hostname, kernel release
date, kernel version, machine hardware name, hardware plat‐
form, operating system
.
Syntax:
$uname -a
Output:

2. -s option: It prints the kernel name.


Syntax:
$uname -s
Output:
3. -n option: It prints the hostname of the network node(current
computer).
Syntax:
$uname -n
Output:

4. -r option: It prints the kernel release date.


Syntax:
$uname -r
Output:

PRINTF
“printf” command in Linux is used to display the given string,
number or any other format specifier
Syntax:
$printf [-v var] format [arguments]

Input: printf "%s\n" "Hello, World! \n" "From


RAGHU\n”
Output: Hello, World! \n
From RAGHU\n

STTY

stty command in Linux is used to change and print terminal line


settings.
Syntax:
stty [-F DEVICE | --file=DEVICE] [SETTING]...
stty [-F DEVICE | --file=DEVICE] [-a|--all]
• stty –all: This option print all current settings in human-
readable form. stty --all

• stty -g: This option will print all current settings in a stty-
readable form. stty -g

You might also like