0% found this document useful (0 votes)
11 views3 pages

Sankar 1st

Uploaded by

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

Sankar 1st

Uploaded by

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

IT22111 – PROGRAMMING FOR PROBLEM SOLVING LABORATORY

EX.NO:1
DATE:
USAGE OF BASIC LINUX COMMANDS

AIM:

COMMANDS AND THEIR DESCRIPTION:

1. COMMAND: mkdir

Description: creating a new directory.


Syntax: mkdir dirname
Example: mkdir CSE
D Output:$ mkdir CSE
D
$ ls
$ CSE D

2. COMMAND: ls

Description: To list all files and directory.


Syntax: ls
Example: $ ls
Output: CSE

3. COMMAND: cd

Description: To change
directory. Syntax: cd dirname
Example: $ cd CSE
Output: $ CSE

4. COMMAND: cd ..

Description: To come out of that directory.


Syntax: $cd ..
Example: $cd..
Output: ~$:

5. COMMAND: cat>

Description: To create a new file.


Syntax: $ cat> filename.txt
Example: $cat > sample.txt

Roll Number: 2127240501187 Page No.:


Output: Hello
^z
+stopped

6. COMMAND: cat

Description : To display the content of file.


Syntax: cat filename.txt
Example: cat sample.txt
Output : Hello

7. COMMAND: cat>>

Description : To append content to existing file.


Syntax: $cat>> filename.txt
Example: $cat>> sample.txt
Output : we are from CSE D
^z
+stopped

8. COMMAND: cp

Description: To copy content from one file to another within the same directory.
Syntax: $cp oldfile.txt newfile.txt
Example: $cp sample.txt file1.txt
Output : sample.txt file1.txt

9. COMMAND: mv

Description :To move file from one directory to another.


Syntax : mv source div / newfile name.txt
Example: $ mv CSE D / into.txt
$ cd CSE D
$ ls
Output : into.txt

10. COMMAND: rm

Description: To remove file from directory.


Syntax: rm filename
Example: $ rm file1.txt
$ ls
Output :
sample.txt

11. COMMAND: rmdir

Description: To remove a directory.


Syntax: rmdir directoryname

Roll Number: 2127240501187 Page No.:


Example: rmdir CSE D
ls
Output : CSE D

12. COMMAND: vi

Description: It is a command line, an interactive editor that can be used to create and edit file.
Syntax: vi filename.c
Example: vi file1.c
Output:

13. COMMAND: cc
Description: It is a command line, that is used to compile and run a program.
Syntax: $ cc sample.c
Usage : cc pgm.c

14. COMMAND: ./a.out

Description: It is command line, that is used to display the output.


Syntax: ./a.out
Usage : ./a.out

15. COMMAND: password

Description: To change password


Syntax: $ password
Usage : $password

RESULT:

Roll Number: 2127240501187 Page No.:

You might also like