Linux - Ubuntu LECTURE TWO
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.
echo and wc commands 10)- The echo command: The ECHO command redirected the output to file you specify. Create an empty file called testfile by redirecting a blank echo command.
echo and wc commands 11)- The wc Command Using this command, you can quickly summarize the number of lines, words, and characters in a text file. You can use it like this: This tells you that document has 1 line, 2 words, and 9 characters.
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:
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
The find command. 14)- The find command: There are thousands of files in an Ubuntu installation (if not hundreds of thousands. 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 a command such as this: find / -name blackjack
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
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:
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).
Conclusion: Learn Linux commands. Understand and implement the echo, wc, cat, more, find, mv, rm, rmdir commands.