Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
34 views

General Purpose Commands: Syntax: $date

The document describes various general purpose commands in Linux/Unix including date, who, man, cal, echo, and commands for working with files like cat, cp, rm, mv, wc, and ls. The date command displays the current date and time and can be used with format specifiers. The who command shows who is logged into the system and identifies the user. Commands like man, cal, echo and clear are also summarized along with descriptions of common file manipulation commands.

Uploaded by

sanjay kumar
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
34 views

General Purpose Commands: Syntax: $date

The document describes various general purpose commands in Linux/Unix including date, who, man, cal, echo, and commands for working with files like cat, cp, rm, mv, wc, and ls. The date command displays the current date and time and can be used with format specifiers. The who command shows who is logged into the system and identifies the user. Commands like man, cal, echo and clear are also summarized along with descriptions of common file manipulation commands.

Uploaded by

sanjay kumar
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

GENERAL PURPOSE COMMANDS

1. date command

The date command tells us the current date and time

Syntax : $date

The date command can also be used with the following format specification
Format Purpose
$date +%m To display only month
$date +%h To display month name
$date +%y To display last two digits of the year
$date +%H To display Hours
$date +%M To display Minutes
$date +%S To display Seconds

2. (i)who command

This command gives us the details of who all have logged into the
UNIX system currently.

Syntax: $who

(ii) $who i am

It is used to identify the user and list out the username, terminal
number and login time
Syntax: $ who am i

(iii) tty

It is used to indicate the user name

Syntax: $tty
(iv) nl
It is used to add line number to file and display the file. It does not
provide any access to the file.

Syntax : $nl filename

3. man command

This command prints the manual page

Syntax: $man <command name>

4.$cal

It is used to display the calendar of the month or year

Syntax: $cal
5.$clear

It is used to clear the Screen

Syntax : $clear

6.$echo

It is used to display the message on the screen

Syntax : $echo Welcome To CSE Department


WORKING WITH FILES

1. cat
It is used to create a file

Syntax : cat > File name

2. cat filename:
It is used to display the content of the file

3.ctrl+d : It is used to save the file

4.cp
It copies the content of one file to another with in the own or access
directory.

Syntax : $cp Source filename destination filename

Example: $cp john chrish


cat chrish
Rose
Jasmine
Lotus

5. rm

It s used for deleting a file

Syntax : rm file name

6. mv
It is used to rename a file

Syntax : mv old name new name


Example : mv chrish ram

Cat ram
Rose
Jasmine
Lotus

7. wc

It is used to count and display the number of words or sentences or


characters

Syntax : $wc ram

8.wc –l filename:
It displays number of line alone

9. wc –w file name:

It displays number of words

10.wc –c file name

It displays the characters

11.ls –a

It displays all directory including hidden files

12.ls –i

It displays all files with i as node number

13.ls –l

It list files in long form

14.ls –r
It displays the regressive list of all files in all sub directory

15.ls –c

It list all file column use

16.ls ?

It display all files with the name having single letter.

17.ls ??

It display all files with the name having Two letter.

18.ls *
It displays all files including sub directories

You might also like