Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
labs:unix_intermediate [2024/09/05 17:13] – [Finding Content: grep] adminlabs:unix_intermediate [2024/09/05 17:21] (current) – [Intermediate Unix Commands] admin
Line 1: Line 1:
 ====== Intermediate Unix Commands ====== ====== Intermediate Unix Commands ======
  
 +This page contains just a teaser of some helpful commands.  You should use ''man'' or search for more information about the commands, e.g., what arguments and flags you can use to customize the command.
 ===== Permissions ===== ===== Permissions =====
  
Line 20: Line 21:
   grep Sara names.txt   grep Sara names.txt
 ===== Finding Files: find ===== ===== Finding Files: find =====
 +
 +You can find files with various characteristics using the ''find'' command.  It will look in the directory specified and all of its subdirectories.  You can then apply a command to those found files.
 +
 +Examples:
 +
 +Find all of the files with the .txt extension in the current directory and its subdirectories
 +
 +  find . -name "*.txt"
 +  
 +Find all of the files in my home directory (and its subdirectories) that have no data in them (have 0 Bytes of data)
 +
 +  find ~ -size 0
 +  
 +View all of the information (e.g., last modified date) of all of the files in my home directory (and its subdirectories) that have no data in them 
 +
 +  find ~ -size 0 -exec ls -l {} \;
 ===== Finding Differences Between Files: diff ===== ===== Finding Differences Between Files: diff =====
  
 ===== Beginning of Files: head ===== ===== Beginning of Files: head =====
  
 +Usage: 
 +
 +  head <filename>
 +
 +shows the first few lines of a file.  You can use a flag to change how many lines are displayed
 ===== End of Files: tail ===== ===== End of Files: tail =====
  
labs/unix_intermediate.1725556430.txt.gz · Last modified: 2024/09/05 17:13 by admin
CC Attribution-Noncommercial-Share Alike 4.0 International
Driven by DokuWiki Recent changes RSS feed Valid CSS Valid XHTML 1.0