John George Bauer-Buis
2018-03-25
NET-140-001N
This first section is a synopsis of this chapter using the headings and subheadings from the textbook, with descriptions in my own words.
• Synopsis: Chapter 8 Deleting, Moving, and Renaming Files and Directories
⁃ The rm command removes files, and can remove directories as well when applied recursively with the -r option. It can also be forced with the -f option.
⁃ Asterisks (*) can be used to match directories and files as a wildcard character when searching for or removing files. Since hidden files and directories on *NIX systems begin with a period character (.), it is necessary to include that when searching for them.
⁃ The copy command, cp, creates duplicates, and works in a similar way to the move command, mv. Both the move and copy commands can require a source and destination, like this: cp existingFileLocation newFileLocation and mv originalFileLocation newFileLocation. Likewise, both move and copy can be used interactively, which allows the user to avoid overwriting any existing data at the new location. The copy command can also be used recursively, either copying it into the existing directory if that is the destination, or creating it if it does not exist.
• Synopsis: Chapter 9 Finding, Sorting, and Comparing Files and Directories
⁃ The find command can be used to search for items, especially grouping or showing only some of them by different criteria, such as then name (-name something, and case-insensatively with -iname something), by age (-mtime ageInDays), size (-size theActualSize), etc.
⁃ The locate command is extremely similar to the find command, but it searches a database instead. Since the database is only updated daily, if it’s configured at all, it is not perfect, either.
⁃ Sorting inside files can be done with the sort command.
⁃ Comparing files can be done with the diff, sdiff, and vimdiff (which uses Vim) to compare files. They are used the same way as the the copy and move commands, with the names of the two files after the command, although in this case the order does not necessarily make a difference.
I may add to this post at a later date if I discover more useful information that I think I should feature here.
No comments:
Post a Comment