0% found this document useful (0 votes)
9 views7 pages

Basic Commands

The document outlines basic commands for file and directory management in a command-line interface. It includes commands for listing files, creating and removing directories, editing files, compiling programs, and viewing file content. Additionally, it explains absolute and relative paths for navigating the file system.

Uploaded by

urmilatv2407
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)
9 views7 pages

Basic Commands

The document outlines basic commands for file and directory management in a command-line interface. It includes commands for listing files, creating and removing directories, editing files, compiling programs, and viewing file content. Additionally, it explains absolute and relative paths for navigating the file system.

Uploaded by

urmilatv2407
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

BASIC COMMANDS


Commands:

1) ls: display list of files


2) Ctrl+l: to clear screen
3) mkdir: to create directory
4) pwd(present working directory): to show in which
directory command prompt is working
5) cd: change directory

2

Paths:
1) Absolute path: starts with (/)
2) Referance/Relative path: starts with (. or ..)
Here (.) represents present workig directory
(..) represents parent directory

3

Commands:

6) rmdir: to remove directory(if directory is empty)


7) rm -r: to remove directory(if directory is full)

4

Commands:
8) vi filename.c: to create file
9) Esc+Shift :wq to save the file content and come
out from the file
10) Esc+Shift+zz to save the file content and come out
from the file
11) Esc+Shift: q! to come out from the file without
saving the content

5

Commands:
12) cc filename.c: to compile program
13) ./[Link]: to run program
14) cc filename.c -o executable file name: to create
separate executable file
15) ./executable file name: to run separate executable file
16) rm filename.c: to remove file
17) Esc+yy: to copy lines in file
18) Esc+dd: to delete lines in file
6
Commands:
cat: to create new file and add(appand) data into old file,
modification not possible
19) cat > filename: to craete new file
20) cat >> filename: to appand data into old file
21) Ctrl+d: to come out from the file
22) cat filename: to view file content
23) cc -nostartfiles filename.c: to compile program without using
main function

You might also like