11
Linux - Ubuntu Lecture Two

Lecture Two. Objective: Enable students to understand the practical side of Linux operating system. Understand and implement the following commands:

Embed Size (px)

Citation preview

Page 1: Lecture Two. Objective: Enable students to understand the practical side of Linux operating system. Understand and implement the following commands:

Linux - UbuntuLecture Two

Page 2: Lecture Two. Objective: Enable students to understand the practical side of Linux operating system. Understand and implement the following commands:

Objective:Enable students to understand the practical

side of Linux operating system.

Understand and implement the following commands:

echo and wc commands. cat and more commands. find command. mv command. rm and rmdir commands.

Page 3: Lecture Two. Objective: Enable students to understand the practical side of Linux operating system. Understand and implement the following commands:

The echo and wc commands.

10 -)The echo command:

Create an empty file called testfile by redirecting a blank echo command.

Page 4: Lecture Two. Objective: Enable students to understand the practical side of Linux operating system. Understand and implement the following commands:

The echo and wc commands.

:11 -)The wc CommandUsing this command, you can quickly summarize the number of lines, words, andcharacters in a text file. You use it like this:

This tells you that document has 1 line, 3 words, and 24 characters.

Page 5: Lecture Two. Objective: Enable students to understand the practical side of Linux operating system. Understand and implement the following commands:

The cat and more commands.

12 )The cat command:

The cat command takes a file and outputs it to the screen. To use it, enter a command such as the following:

Page 6: Lecture Two. Objective: Enable students to understand the practical side of Linux operating system. Understand and implement the following commands:

The cat and more commands.

13 )The more command:

The more command is very useful for paging through text files that have more lines than can be displayed in the Terminal window. To use it, you enter the command’s name followed by the name of the file to view, like this:

* more testfile

Page 7: Lecture Two. Objective: Enable students to understand the practical side of Linux operating system. Understand and implement the following commands:

The find command.14)- The find command:

There are thousands of files in an Ubuntu installation (if not hundreds of thousands), so locating individual ones could be a nightmare without the find command. But with it, you can find almost any file within a few seconds.The program supports many options, but at its most basic you use it by entering acommand such as this:

find / -name blackjack

Page 8: Lecture Two. Objective: Enable students to understand the practical side of Linux operating system. Understand and implement the following commands:

The mv command.15 )The mv command:

• Ubuntu considers renaming and moving items to be equivalent. If you rename a file, Ubuntu treats it as if you have moved it to a new location comprising the current folder and the new filename. Therefore, unlike DOS, instead of having both a MOVE and a RENAME command, Ubuntu provides just the mv command.

• Rename or move the file or folder fname1 to fname2

Page 9: Lecture Two. Objective: Enable students to understand the practical side of Linux operating system. Understand and implement the following commands:

The rm and rmdir commands.16 )The rm command:

To delete a file or folder, use the rm command, which stands for remove. For example, to erase the file file_2 in the current folder, use this command:

Page 10: Lecture Two. Objective: Enable students to understand the practical side of Linux operating system. Understand and implement the following commands:

The rm and rmdir commands.17 )The rmdir command:

You can also delete an empty folder using rmdir.

Remove folder if it is empty (this will fail if folder contains any files or subfolders).

Page 11: Lecture Two. Objective: Enable students to understand the practical side of Linux operating system. Understand and implement the following commands:

Conclusion: Learn Linux commands.

Understand and implement the echo, wc, cat, more, find, mv, rm, rmdir commands.