Skip to main content

Posts

Showing posts with the label grep

Some more file commands

touch command We have seen how to copy, rename or delete a file. But how would we create a file? Using a text editor? touch command lets you create an empty file. touch file1.txt creates an empty file as can be seen from the above screen shot. But touch command with an existing file will change the access date of a file without opening the file or modifying it in any way.  It just touches the file. more or less? We have seen earlier that cat command will display the contents of a file (similar to type command in Windows) But what happens if the file is large?  cat in that case just displays the entire file and shows back the command prompt without us having time to view the complete file. In these situations, we can use more or less command to display the file, one screen at a time.  more command will display one screen and pause and by pressing Enter key it will scroll by one line.   less command does the same thing. But le...