0% found this document useful (0 votes)
43 views

1 Practical-1

Hi

Uploaded by

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

1 Practical-1

Hi

Uploaded by

pushboardfit
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 4

Roll No: 01 Course: FYCS Semester : I

Name: Pallavi Tawde Subject: Operating Systems


VMware Root123—> Right click Terminal
Aim: Linux Commands
1. pwd Command
The pwd command is used to display the location of the current working directory.
Syntax:
1. pwd

2. mkdir Command
The mkdir command is used to create a new directory under any directory.
Syntax:
1. mkdir <directory name>

3. rmdir Command
The rmdir command is used to delete a directory.
Syntax:
1. rmdir <directory name>

4. ls Command

The ls command is used to display a list of content of a directory.

Syntax:

Ls
5. cd Command
The cd command is used to change the current directory.
Syntax:
1. cd <directory name

6. touch Command

The touch command is used to create empty files. We can create multiple empty files
by executing it once.

Syntax:

1. touch <file name>


2. touch <file1> <file2> ....

7. cat Command

1
Roll No: 01 Course: FYCS Semester : I
Name: Pallavi Tawde Subject: Operating Systems
The cat command is a multi-purpose utility in the Linux system. It can be used to
create a file, display content of the file, copy the content of one file to another file, and
more.

Syntax:

1. cat [OPTION]... [FILE]..

To create a file, execute it as follows:

1. cat > <file name>


2. // Enter file content

Press "CTRL+ D" keys to save the file. To display the content of the file, execute it as
follows:

1. cat <file name>

8. rm Command

The rm command is used to remove a file.

Syntax:

rm <file name>

9. cp Command
The cp command is used to copy a file or directory.
Syntax:
To copy in the same directory:
1. cp <existing file name> <new file name>

10. mv Command
The mv command is used to move a file or a directory form one location to another
location.
Syntax:
1. mv <file name> <directory path>

2
Roll No: 01 Course: FYCS Semester : I
Name: Pallavi Tawde Subject: Operating Systems
11. rename Command
The rename command is used to rename files. It is useful for renaming a large group of
files.
Syntax:
rename 's/file/newfile/' file.txt

12. head Command


The head command is used to display the content of a file. It displays the first 10 lines
of a file.
Syntax:
1. head <file name>

13. tail Command


The tail command is similar to the head command. The difference between both
commands is that it displays the last ten lines of the file content. It is useful for reading
the error message.
Syntax:
1. tail <file name>

14. tac Command


The tac command is the reverse of cat command, as its name specified. It displays the
file content in reverse order (from the last line).
Syntax:
1. tac <file name>

15. grep Command


The grep is the most powerful and used filter in a Linux system. The 'grep' stands for
"global regular expression print." It is useful for searching the content from a file.
Generally, it is used with the pipe.
Syntax:
1. command | grep <searchWord>

16. sort Command


The sort command is used to sort files in alphabetical order.
Syntax:

3
Roll No: 01 Course: FYCS Semester : I
Name: Pallavi Tawde Subject: Operating Systems
1. sort <file name>

17. date Command


The date command is used to display date, time, time zone, and more.
Syntax:
1. date

18. cal Command


The cal command is used to display the current month's calendar with the current date
highlighted.
Syntax:
1. cal

19. sleep Command


The sleep command is used to hold the terminal by the specified amount of time. By
default, it takes time in seconds.
Syntax:
1. sleep <time>

20. clear Command


Linux clear command is used to clear the terminal screen.
Syntax:
1. clear

21. exit Command


Linux exit command is used to exit from the current shell. It takes a parameter as a
number and exits the shell with a return of status number.
Syntax:
1. exit

You might also like