Day 7 - Commands of linux ( find and awk)

Day 7 - Commands of linux ( find and awk)

  • find -> the find command helps us to find a particular file within a directory. It is used to find the list of files for the various conditions like permission, user ownership, modification, date/time, size, and more.

search readable, writeable, and executable file and directories :

search empty directories:

search the file with less than 10MB in a directories :

search the file with more than 10MB in a directories:

search the file with more than 10MB and less than 10M :

wc (word count) -> It is used to find out number of lines, word count, byte and characters count in the files specified in the file arguments.

Syntax: wc [option] file

Count number of lines:

Count number of words:

  • awk -> awk is a scripting language, and it is helpful when working in the command line. It's also a widely used command for text processing.When using awk, you are able to select data – one or more pieces of individual text – based on a pattern you provide.

syntax: awk [option] pattern action source filename

By default Awk prints every line of data from the specified file:

Print only all directories:

Print all files ;

search the data with more than 1 MB:

Search 7 byte file :

Display with number records:

Number records and field records:

Display 410 to 420 lines:

Permissions check:

Thanks for reading to the end; I hope you gained some knowledge.❤️🙌

PARAMVEER SINGH