IT22111 – PROGRAMMING FOR PROBLEM SOLVING LABORATORY
[Link]
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> [Link]
Example: $cat > [Link]
Roll Number: 2127240501187 Page No.:
Output: Hello
^z
+stopped
6. COMMAND: cat
Description : To display the content of file.
Syntax: cat [Link]
Example: cat [Link]
Output : Hello
7. COMMAND: cat>>
Description : To append content to existing file.
Syntax: $cat>> [Link]
Example: $cat>> [Link]
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 [Link] [Link]
Example: $cp [Link] [Link]
Output : [Link] [Link]
9. COMMAND: mv
Description :To move file from one directory to another.
Syntax : mv source div / newfile [Link]
Example: $ mv CSE D / [Link]
$ cd CSE D
$ ls
Output : [Link]
10. COMMAND: rm
Description: To remove file from directory.
Syntax: rm filename
Example: $ rm [Link]
$ ls
Output :
[Link]
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: ./[Link]
Description: It is command line, that is used to display the output.
Syntax: ./[Link]
Usage : ./[Link]
15. COMMAND: password
Description: To change password
Syntax: $ password
Usage : $password
RESULT:
Roll Number: 2127240501187 Page No.: