Skip to content
This repository was archived by the owner on Jun 5, 2024. It is now read-only.

Commit 63af5d2

Browse files
cleaned up end of line whitespaces
1 parent ea341e6 commit 63af5d2

10 files changed

+370
-370
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ Learn about various commands available for common and exotic text processing nee
2525
* paste, column, pr, fold
2626
* [File attributes](./file_attributes.md)
2727
* wc, du, df, touch, file
28-
* [Miscellaneous](./miscellaneous.md) 
28+
* [Miscellaneous](./miscellaneous.md)
2929
* cut, tr, basename, dirname, xargs, seq
3030

3131
Rough drafts

file_attributes.md

+18-18
Original file line numberDiff line numberDiff line change
@@ -56,38 +56,38 @@ DESCRIPTION
5656
#### <a name="various-counts"></a>Various counts
5757
5858
```bash
59-
$ cat sample.txt
59+
$ cat sample.txt
6060
Hello World
6161
Good day
6262
No doubt you like it too
6363
Much ado about nothing
6464
He he he
6565

6666
$ # by default, gives newline/word/byte count (in that order)
67-
$ wc sample.txt
67+
$ wc sample.txt
6868
5 17 78 sample.txt
6969

7070
$ # options to get individual numbers
71-
$ wc -l sample.txt
71+
$ wc -l sample.txt
7272
5 sample.txt
73-
$ wc -w sample.txt
73+
$ wc -w sample.txt
7474
17 sample.txt
75-
$ wc -c sample.txt
75+
$ wc -c sample.txt
7676
78 sample.txt
7777

7878
$ # use shell input redirection if filename is not needed
79-
$ wc -l < sample.txt
79+
$ wc -l < sample.txt
8080
5
8181
```
8282
8383
* multiple file input
8484
* automatically displays total at end
8585
8686
```bash
87-
$ cat greeting.txt
87+
$ cat greeting.txt
8888
Hello there
8989
Have a safe journey
90-
$ cat fruits.txt
90+
$ cat fruits.txt
9191
Fruit Price
9292
apple 42
9393
banana 31
@@ -104,7 +104,7 @@ $ wc *.txt
104104
* use `-L` to get length of longest line
105105
106106
```bash
107-
$ wc -L < sample.txt
107+
$ wc -L < sample.txt
108108
24
109109

110110
$ echo 'foo bar baz' | wc -L
@@ -280,7 +280,7 @@ $ du -S
280280
281281
```bash
282282
$ # number of bytes
283-
$ stat -c %s words.txt
283+
$ stat -c %s words.txt
284284
938848
285285
$ du -b words.txt
286286
938848 words.txt
@@ -514,7 +514,7 @@ $ df -h --output=pcent,fstype | awk -F'%' 'NR>2 && $1>=40'
514514
$ touch --version | head -n1
515515
touch (GNU coreutils) 8.25
516516
517-
$ man touch
517+
$ man touch
518518
TOUCH(1) User Commands TOUCH(1)
519519
520520
NAME
@@ -544,7 +544,7 @@ $ ls foo.txt
544544
foo.txt
545545
546546
$ # use -c if new file shouldn't be created
547-
$ rm foo.txt
547+
$ rm foo.txt
548548
$ touch -c foo.txt
549549
$ ls foo.txt
550550
ls: cannot access 'foo.txt': No such file or directory
@@ -564,7 +564,7 @@ $ # last modification time
564564
$ stat -c %y fruits.txt
565565
2017-07-13 13:54:03.576055933 +0530
566566
567-
$ touch fruits.txt
567+
$ touch fruits.txt
568568
$ stat -c %x fruits.txt
569569
2017-07-21 10:11:44.241921229 +0530
570570
$ stat -c %y fruits.txt
@@ -642,14 +642,14 @@ $ stat -c $'%x\n%y' story.txt
642642
2017-06-24 12:59:53.316751651 +0530
643643
$ # tmp.txt is temporary empty file
644644
$ touch -r story.txt tmp.txt
645-
$ stat -c $'%x\n%y' tmp.txt
645+
$ stat -c $'%x\n%y' tmp.txt
646646
2017-06-24 13:00:31.773583923 +0530
647647
2017-06-24 12:59:53.316751651 +0530
648648
649649
$ # after text processing, copy back the timestamps and remove temporary file
650650
$ sed -i 's/cat/dog/g' story.txt
651-
$ touch -r tmp.txt story.txt && rm tmp.txt
652-
$ stat -c $'%x\n%y' story.txt
651+
$ touch -r tmp.txt story.txt && rm tmp.txt
652+
$ stat -c $'%x\n%y' story.txt
653653
2017-06-24 13:00:31.773583923 +0530
654654
2017-06-24 12:59:53.316751651 +0530
655655
```
@@ -699,10 +699,10 @@ DESCRIPTION
699699
#### <a name="file-type-examples"></a>File type examples
700700

701701
```bash
702-
$ file sample.txt
702+
$ file sample.txt
703703
sample.txt: ASCII text
704704
$ # without file name in output
705-
$ file -b sample.txt
705+
$ file -b sample.txt
706706
ASCII text
707707
708708
$ printf 'hi👍\n' | file -

0 commit comments

Comments
 (0)