removed space from dir names
This commit is contained in:
52
Linux/Basic-Administration/15-wc.md
Normal file
52
Linux/Basic-Administration/15-wc.md
Normal file
@@ -0,0 +1,52 @@
|
||||
# 📘 **Using the `wc` Command in Linux/Unix**
|
||||
|
||||
`wc` (word count) is a utility that counts lines, words, and bytes or characters in files. It’s useful for quickly getting file size details in text terms.
|
||||
|
||||
---
|
||||
|
||||
## ⚙️ Syntax
|
||||
|
||||
```bash
|
||||
wc [option] file
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 🔎 Basic Usage
|
||||
|
||||
```bash
|
||||
wc file
|
||||
```
|
||||
|
||||
**Example output:**
|
||||
|
||||
```
|
||||
5 6 43 file1
|
||||
```
|
||||
|
||||
This output means:
|
||||
|
||||
| Number | Meaning |
|
||||
| ------ | ------------------- |
|
||||
| `5` | Number of **lines** |
|
||||
| `6` | Number of **words** |
|
||||
| `43` | Number of **bytes** |
|
||||
|
||||
---
|
||||
|
||||
## 📋 Common Options
|
||||
|
||||
| Option | Description | Example |
|
||||
| ------ | ------------------------- | ------------ |
|
||||
| `-l` | Count **lines** only | `wc -l file` |
|
||||
| `-w` | Count **words** only | `wc -w file` |
|
||||
| `-c` | Count **bytes** only | `wc -c file` |
|
||||
| `-m` | Count **characters** only | `wc -m file` |
|
||||
|
||||
---
|
||||
|
||||
## 📌 Notes
|
||||
|
||||
* `bytes (-c)` counts raw bytes, which might differ from characters (`-m`) in multibyte encodings like UTF-8.
|
||||
* Without options, `wc` outputs lines, words, and bytes by default.
|
||||
|
||||
Reference in New Issue
Block a user