/
cut.yml
20 lines (20 loc) · 851 Bytes
/
cut.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
---
cut: "Prints selected parts of lines (of a text file), or, in other words, removes certain sections of a line. You may wish to remove things according to tabs or commas, or anything else you can think of...\r\n\
\r\n\
Options for cut:\r\n\
\r\n\
\t-d \t\t\t\t\t\t# allows you to specify another delimiter\r\n\
\tcut -d ':' /etc/passwd\r\n\
\t\r\n\
\t-f \t\t\t\t\t\t# columns, separated by delimiter\r\n\
\tcut -d ',' -f 1 /etc/passwd \r\n\
\r\n\
\t, \t\t\t\t\t\t# separate numbers, used to cut particular columns.\r\n\
\tcut -d ':' -f 1,7 /etc/passwd\r\n\
\r\n\
\t- \t\t\t\t\t\t# from line x to line y\r\n\
\tcut -c 1-50 file1.txt\r\n\
\r\n\
\t-x \t\t\t\t\t\t# cut from line 1 to \xE2\x80\x9Cx\xE2\x80\x9D\r\n\
\tx- \t\t\t\t\t\t# cut from \xE2\x80\x9Cx\xE2\x80\x9D to the end.\r\n\
\tcut -5, 20-, 8 file2.txt"