1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253
|
[mo@mos-computer ~]$ nano grades.csv [mo@mos-computer ~]$ cat grades.csv Mark,95/10, 针不戳 Matthew,30/100, 和平常一样水 Maria,70/100,有进步 Luke,54/100,接近平均分了 John,68/100,不错,但还可以更好 Samuel,100/100,总是那么完美 David,40/100,退步挺大呀 [mo@mos-computer ~]$ cut -d , -f 1 grades.csv Mark Matthew Maria Luke John Samuel David [mo@mos-computer ~]$ cut -d , -f 3 grades.csv 针不戳 和平常一样水 有进步 接近平均分了 不错 总是那么完美 退步挺大呀 [mo@mos-computer ~]$ cut -d , -f 1,3 grades.csv Mark, 针不戳 Matthew, 和平常一样水 Maria,有进步 Luke,接近平均分了 John,不错 Samuel,总是那么完美 David,退步挺大呀 [mo@mos-computer ~]$ cut -d , -f 2- grades.csv 95/10, 针不戳 30/100, 和平常一样水 70/100,有进步 54/100,接近平均分了 68/100,不错,但还可以更好 100/100,总是那么完美 40/100,退步挺大呀
[mo@mos-computer ~]$ mv grades.csv redirect/ [mo@mos-computer ~]$ cd redirect/ [mo@mos-computer redirect]$ s bash: s: command not found... [mo@mos-computer redirect]$ ls grades.csv [mo@mos-computer redirect]$ cut -d , -f 1 grades.csv > students.txt [mo@mos-computer redirect]$ cat students.txt rk Matthew Maria Luke John Samuel David
[mo@mos-computer redirect]$ cut -d , -f 1 grades.csv > /dev/null [mo@mos-computer redirect]$ cut -d , -f 1 grades.csv >> students.txt [mo@mos-computer redirect]$ cat students.txt rk Matthew Maria Luke John Samuel David rk Matthew Maria Luke John Samuel David
[mo@mos-computer redirect]$ cat grades.csv rk,95/10, 针不戳 Matthew,30/100, 和平常一样水 Maria,70/100,有进步 Luke,54/100,接近平均分了 John,68/100,不错,但还可以更好 Samuel,100/100,总是那么完美 David,40/100,退步挺大呀 [mo@mos-computer redirect]$ cd .. [mo@mos-computer ~]$ cat grades.csv cat: grades.csv: No such file or directory
[mo@mos-computer ~]$ cat not_exxist_file.csv > results.txt cat: not_exxist_file.csv: No such file or directory
[mo@mos-computer ~]$ cat not_exxist_file.csv > results.txt 2> errors.log [mo@mos-computer ~]$ cat errors.log cat: not_exxist_file.csv: No such file or directory
[mo@mos-computer ~]$ cat not_exxist_file.csv > results.txt 2>&1 [mo@mos-computer ~]$ cat results.txt cat: not_exxist_file.csv: No such file or directory [mo@mos-computer ~]$ cat not_exxist_file.csv >> results.txt 2>&1 [mo@mos-computer ~]$ cat results.txt cat: not_exxist_file.csv: No such file or directory cat: not_exxist_file.csv: No such file or directory
[mo@mos-computer ~]$ cd [mo@mos-computer ~]$ cd redirect/ [mo@mos-computer redirect]$ cat < grades.csv rk,95/10, 针不戳 Matthew,30/100, 和平常一样水 Maria,70/100,有进步 Luke,54/100,接近平均分了 John,68/100,不错,但还可以更好 Samuel,100/100,总是那么完美 David,40/100,退步挺大呀
[mo@mos-computer redirect]$ sort -n << END > 12 > 9 > 27 > 99 > 30 > 14 > END 9 12 14 27 30 99 [mo@mos-computer redirect]$ wc -n << END > how many chars are there in this sentence? > END wc: invalid option -- 'n' Try 'wc --help' for more information. [mo@mos-computer redirect]$ wc -m << END > how many chars are there in this sentence? > END 44
[mo@mos-computer redirect]$ sort -n << END > number_sorted.txt 2>&1 > 12 > 7 > 10 > 56 > 101 > 84 > END [mo@mos-computer redirect]$ cat number_sorted.txt 7 10 12 56 84 101
[mo@mos-computer redirect]$ cat grades.csv rk,95/10, 针不戳 Matthew,30/100, 和平常一样水 Maria,70/100,有进步 Luke,54/100,接近平均分了 John,68/100,不错,但还可以更好 Samuel,100/100,总是那么完美 David,40/100,退步挺大呀 [mo@mos-computer redirect]$ cut -d , -f 1 grades.csv | sort David John Luke Maria Matthew rk Samuel [mo@mos-computer redirect]$ cut -d , -f 1 grades.csv | sort > sorted_names.txt [mo@mos-computer redirect]$ cat sorted_names.txt David John Luke Maria Matthew rk Samuel [mo@mos-computer ~]$ du | sort -nr | head
530960 . 319984 ./.cache 210440 ./.cache/google-chrome 210144 ./.cache/google-chrome/Default 186324 ./.cache/google-chrome/Default/Cache 63248 ./.mozilla/firefox 63248 ./.mozilla 63236 ./.mozilla/firefox/cu0s4zn2.default-default 59884 ./.icons 54236 ./.cache/tracker [mo@mos-computer ~]$ sudo grep log -Ir /var/log | cut -d : -f 1 | sort | uniq /var/log/anaconda/anaconda.log /var/log/anaconda/journal.log /var/log/anaconda/packaging.log /var/log/anaconda/program.log /var/log/anaconda/storage.log /var/log/anaconda/syslog /var/log/anaconda/X.log /var/log/audit/audit.log /var/log/boot.log-20210228 /var/log/boot.log-20210304 /var/log/cron /var/log/cron-20210228 /var/log/dmesg /var/log/dmesg.old /var/log/gdm/ /var/log/messages /var/log/messages-20210228 /var/log/secure /var/log/secure-20210228 /var/log/vmware-network.1.log /var/log/vmware-network.2.log /var/log/vmware-network.3.log /var/log/vmware-network.4.log /var/log/vmware-network.5.log /var/log/vmware-network.6.log /var/log/vmware-network.7.log /var/log/vmware-network.8.log /var/log/vmware-network.9.log /var/log/vmware-network.log /var/log/vmware-vgauthsvc.log.0 /var/log/Xorg.0.log /var/log/Xorg.0.log.old /var/log/Xorg.1.log /var/log/Xorg.2.log /var/log/Xorg.9.log /var/log/yum.log
|