 Let's do some more things on our text files. We've created a text file. We've Did a word count? Let me just clear and show what I have. I've got two files. One of them is empty. My file contains some some content Instead of using a text editor to display the file. There are some other commands to display a very simple one is called cat cat It's not an animal, but it is a program that shows the contents of a file. It's short for concatenate It simply prints the contents of the file on the screen Cat followed by the file name prints it on the screen You may have noticed in my case because there are lots of lines on that file when I did the cat I missed the first lines So instead of using cat sometimes we can use less less Again shows the contents of the file on the screen, but page by page and now I can scroll up and down with my arrow keys So it's got the top lines and I scroll down and I get to the bottom of the file So less is us is slightly more advanced than cat cat just shows it less shows it but but has page breaks Queue to quit less like the man page queue to quit you want to just see the start of a file The head of a file Head By default shows the first ten lines of the file Or the end the tail Tail shows the last ten lines of the file you want to just get the first three lines of the file Head and minus and three my file or the last five lines You can actually do minus five as a shortcut Minus n three or simply minus three Shows that selection of or that number of lines are the head or tail Cat shows the full file less shows the file page by page head shows the first n lines tail shows the last n lines the reason we have all these commands on files is because many programs in Linux and Unix systems are Configured by files the operating system configuration is not done in a registry or a separate database, but in plain text files and similar for many applications and Many programs on the command line use text files to do processing So it's useful to be able to process those text files Let's copy some files CP to copy Copy my file dot txt to new dot txt and we now have a copy of that file Copy doesn't have to go to the same directory. I can copy my file back a directory and change it the name To another file and if we look in the higher directory We see that new file So copy uses a source and destination the source and destination can include the the path the directory of the file What if I want to copy? Another dot txt into my current directory. How would I do that? I mean it is 352 In the higher directory, there's a file called another dot txt and I want to copy it into this directory copy Another dot txt from the higher directory. What's the destination? The destination is this directory the shortcut for this directory is dot copy Another dot txt from the higher directory into this directory and we now have a copy So be careful or make note that I use the dot there when you would do a copy We must always specify source and destination Sometimes we can use the dot to represent this current directory Move is similar to copy move new dot txt Upper level New dot txt is gone from this directory. It's now in the higher level directory move Moves the file we can move it back. I moved from the higher directory new dot txt into this directory Moving a file is also the same as renaming a file. You want to change the name Here I simply rename new dot txt to XYZ dot txt So we can use move to rename note that we can rename files and The names of files in Linux the extension doesn't matter in the examples I've used I've used dot txt because we knew they were text files But the extension is not important if I change the name you use a different extension It doesn't change the format of the file XYZ is still the same text file as before Contains some text I Can move XYZ To XYZ Doc It's not a Microsoft Word document. It's still just a text file Extensions are not necessary and are not necessarily interpreted So we can use any extension But it's common sense to or common practice to use an extension that is informative to the user and the last thing We can remove files RM Followed by the file name Or let's remove all of our text files Star dot txt When I say text files, I mean those that I've given the extension dot txt RM removes or deletes files There is no recycle bin. There is no trash on the command line if you delete a file. It's gone So you need to be careful In the graphical interface, there is a trash bin But we're not using that when you delete a file here. It's no longer available So be careful when you remove files, especially if you use a wildcard like star RM star deleted everything If you have a thousand files in that directory, they're all gone Sometimes the permissions on directories mean you can't delete everything But you can do some damage if you can delete your own files accidentally Before we have a break. Let's do the last few things on files. Let's Find some files on our file system. I'll go home Clear. I'm in my home directory