Permalink
Switch branches/tags
Nothing to show
Find file
Fetching contributors…
Cannot retrieve contributors at this time
21 lines (20 sloc) 851 Bytes
---
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"