Listing Files
When a user logs in to a UNIX system, he/she would probably want to see the contents of the home directory. How would you see them on console type environment? You don't have the luxury to click around like in windows.
The "ls" command comes to rescue us.
The "ls" command is used to list the contents of the current directory or any …show more content…
Command Syntax: wc [Options] [File] [File]...
Options & Usages
Option
Usage
Example
-l, --lines
prints the newline counts
$ wc -l mybigfile.txt
-w, --words
prints the word counts
$ wc -w mybigfile.txt
-c, --bytes
prints the byte counts
$ wc -c mybigfile.txt
-m, --chars
prints the character counts
$ wc -m mybigfile.txt
-L, --max-line-length
prints only the length of the longest line in the file
$ wc -L mybigfile.txt
Please refer to "wc" command reference & practical usages to explore the command.
Splitting Files
The "split" command is used to:
Split large files into a small and manageable small size files. By default, splits large files into 1000 lines per file.
Command Syntax: split [Options] [File]
Options
Option
Usage
Example
-l, --lines
split by number of lines
$ split -l 500 mybigfile.txt
-b, --bytes
split by size
$ split -b 2MB mybigfile.txt (splits into 2MB size files)
-n
split into defined number of files
$ split -n 2 mybigfile.txt
-d
Use numeric suffixes
$ split -d