0% found this document useful (0 votes)
28 views4 pages

Exp 1

Uploaded by

HODCSE RKCE
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
28 views4 pages

Exp 1

Uploaded by

HODCSE RKCE
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 4

EXPERIMENT-1

Practicing of basic UNIX commands.


1) The man command:
man - an interface to the on-line reference manuals man is the system's
manual pager. Each page argument given to man is normally the name of
a program, utility or function.
Example:
$man pwd

2) The who command:


who - show who is logged on Print information about users who are
currently logged in.
Example:
$who
root console july 2 10:30
aaa tty01 july 2 10:40
bbb tty02 july 2 10:55

3) The cat command:


cat - concatenate files and print on the standard output Concatenate
FILE(s), or standard input, to standard output.
Example:
$cat > newfile
Hi
Hell
Welcome
$
The input operation is terminated by using <ctrl+d> command
4) The mkdir command:
mkdir - make directories
It creates the directories if they do not already exist.
Example:
$mkdir user1
$
5) The cd command:
cd - change directories
It is a command-line OS shell command used to change the current
working directory
Example:
$cd user1
user1]$
6) The cp command:
cp - copy files and directories
This command is used to create a duplicate of a file, a set of files or a
directory The cp command copies both text and binary files
Syntax:
$cp source-file/directory destination-file/directory
Examples:
i) $cp file1 file2
ii) $cp dir1/file1 dir1/file2
7) The ls command:
ls - list directory contents
This command lists the contents in a directory.
Syntax:
$ls
Example:
$ls
8) The mv command:
mv - move (rename) files
This command is used to move either an individual file, a list of files or a
directory
Syntax:
$mv source-file/directory destination-file/directory
Example:
$mv dir1/file1 dir2
The mv command is also used to rename a file or directory
Syntax:
$mv old-file-name new-file-name
Example:
$mv file1 file7
9) The rm command:
rm - remove files or directories
This command is used remove a file or a directory
Syntax:
$rm filename
Example:
$rm file1
10) The rmdir command:
rmdir - remove empty directories
This command is used to delete a directory
Syntax:
$rmdir directory-name
Example:
$rmdir user1
11) The echo command:
echo - display a line of text
This command is used to display messages. It takes zero, one or more
arguments.
Example:
$echo “Hello World”
Hello World
12) The date command:
date - print or set the system date and time
Using this command, the user can display the current date along with the
time nearest to the second
Example:
$date
Sat Jan 10 11:58:00 IST 2004
$
13) The time command:
time - time a simple command or give resource usage
This command is used to know the resource usage It runs a program or
command with given arguments, generates a timing statistics about the
program run and directs this statistics report to the standard output.
Example:
$time
real 0m0.000s
user 0m0.000s
sys 0m0.000s
$
14) The kill command:
kill - terminate a process
To kill a background process a kill command is used.
This command is given with the PID of the process to be killed as its
argument
Example:
$kill 555
Here, 555 is the PID of the process

15) The history command:


history – Used to display the history of previous executed commands
With no options, display the command history list with line numbers
Example:
$history
1 pwd
2 date
3 cal
4 history

16) The chmod command:


chmod - change file mode bits
The chmod command is used to change permissions of a file after its
creation
Only the Owner or Super User can change file permissions
Syntax:
$chmod assignment-expression filename
Example:
$chmod u+x sample
$ls -l sample
- r w x r - - r - - sample

17) The chown command:


chown - change file owner and group
Only the owner can change the major attributes of a file
Sometimes it is necessary to change the ownership of a file.
Example:
$ls -l sample
-rwxr--r-x 1 dhoni July 19 11:55 sample
$chown virat sample
$ls -l sample
-rwxr--r-x 1 virat July 19 11:55 sample
18) The pwd command: pwd – print name of current/working directory.

This command is used to determine the location of the current directory in


the directory structure
Syntax:
$pwd
Example:
$pwd

19) The cal command:


cal - displays a calendar
This command is used to print the calendar of a specific month or a
specific year
Example:
$cal 03 2018

20) The logout command:


logout - Exit a login shell.
Example:
$logout

You might also like