User Tools

Site Tools


os_cp:redirects_pipes:solutions

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
os_cp:redirects_pipes:solutions [2023/03/22 00:44] – utworzono jkonczakos_cp:redirects_pipes:solutions [2023/03/22 10:37] (current) – jkonczak
Line 19: Line 19:
 |~~#~~|cp /etc/services . \\ hexdump <>services 1>&0 \\ # hexdump reads a chunk of data, outputs (in the middle of the file) the hex dump, \\ # and repeats this until it processes whole file. | |~~#~~|cp /etc/services . \\ hexdump <>services 1>&0 \\ # hexdump reads a chunk of data, outputs (in the middle of the file) the hex dump, \\ # and repeats this until it processes whole file. |
 |~~#~~|cat /etc/motd /etc/shadow 3>&1 1>&2 2>&3 <nowiki>|</nowiki> rev | |~~#~~|cat /etc/motd /etc/shadow 3>&1 1>&2 2>&3 <nowiki>|</nowiki> rev |
-|~~#25~~|echo //'some text'// <nowiki>|</nowiki> xxd|+|~~#25~~|echo '2+2*2' <nowiki>|</nowiki> bc| 
 +|~~#~~|echo //'some text'// <nowiki>|</nowiki> xxd|
 |~~#~~|ls <nowiki>|</nowiki> cat \\ ls <nowiki>|</nowiki> cat -n| |~~#~~|ls <nowiki>|</nowiki> cat \\ ls <nowiki>|</nowiki> cat -n|
 |~~#~~|ps -eF <nowiki>|</nowiki> fold| |~~#~~|ps -eF <nowiki>|</nowiki> fold|
-|~~#~~| Work in progress... \\ <nowiki>|</nowiki>| +|~~#~~|mkfifo //p// \\ fold < //p// \\ ps -eF > //p// | 
-|~~#~~|<nowiki>|</nowiki>| +|~~#~~|paste <(seq 15) <(seq 15 -1 1) <nowiki>|</nowiki> head -n3 \\ paste <(seq 15) <(seq 15 -1 1) <nowiki>|</nowiki> tail -n3 \\ paste <(seq 15) <(seq 15 -1 1) <nowiki>|</nowiki> head -n -3 \\ paste <(seq 15) <(seq 15 -1 1) <nowiki>|</nowiki> tail -n +4 \\ paste <(seq 15) <(seq 15 -1 1) <nowiki>|</nowiki> head -n9 <nowiki>|</nowiki> tail -n 4  | 
-|~~#~~|<nowiki>|</nowiki>| +|~~#~~|seq 25 > //file// \\ tail -f //file// \\ seq 26 30 >> //file// | 
-|~~#~~|<nowiki>|</nowiki>| +|~~#~~|seq 75 <nowiki>|</nowiki> grep 5 \\ seq 75 <nowiki>|</nowiki> grep '5$' \\ seq 75 <nowiki>|</nowiki> egrep '5$<nowiki>|</nowiki>0$' \\ seq 75 <nowiki>|</nowiki> grep -B3 '33' \\ seq 75 <nowiki>|</nowiki> grep -C2 '33' | 
-|~~#~~|<nowiki>|</nowiki>| +|~~#~~|grep 10 /etc/passwd /etc/group \\ grep -R ecdsa ~/.ssh | 
-|~~#~~|<nowiki>|</nowiki>| +|~~#~~|mount <nowiki>|</nowiki> cut -f 5 -d ' ' \\  cut -f 3 -d ' ' /etc/mtab | 
-|~~#~~|<nowiki>|</nowiki>| +|~~#~~|egrep '<nowiki>^</nowiki>[Ee]{2}' /usr/share/myspell/en_US.dic <nowiki>|</nowiki> cut -f1 -d/ | 
-|~~#~~|<nowiki>|</nowiki>| +|~~#37~~|cat random_data \\ sort random_data| 
-|~~#~~|<nowiki>|</nowiki>| +|~~#~~|sort -k3 random_data \\ sort -nk3 random_data | 
-|~~#~~|<nowiki>|</nowiki>| +|~~#~~|sort -k2,2 -k6,6 random_data | 
-|~~#~~|<nowiki>|</nowiki>| +|~~#~~|sort -k2,2 random_data \\  sort -sk2,2 random_data \\ # the latter preserves order of lines with identical sort key| 
-|~~#~~|<nowiki>|</nowiki>| +|~~#~~|sort -k2,2 -k3,3n random_data| 
-|~~#~~|<nowiki>|</nowiki>| +|~~#~~|man wc <nowiki>|</nowiki> cat \\ man wc <nowiki>|</nowiki> wc| 
-|~~#~~|<nowiki>|</nowiki>| +|~~#44~~|perl -e 'printf "%d\n", (int rand(6)+1)+(int rand(6)+1) for(1..100)' <nowiki>|</nowiki> uniq -cd \\ perl -e 'printf "%d\n", (int rand(6)+1)+(int rand(6)+1) for(1..10000)' <nowiki>|</nowiki> sort -n <nowiki>|</nowiki> uniq -c | 
-|~~#~~|<nowiki>|</nowiki>| +|~~#~~|echo -e '1 2 3\n4 5 6\n7 8 9' \\ echo -e '1 2 3\n4 5 6\n7 8 9'  <nowiki>|</nowiki> rev \\ echo -e '1 2 3\n4 5 6\n7 8 9'  <nowiki>|</nowiki> tac | 
-|~~#~~|<nowiki>|</nowiki>| +|~~#~~|ls -l <nowiki>|</nowiki> tr '0-9' '-' \\ ls -l <nowiki>|</nowiki> tr '[:lower:]' '[:upper:]' \\ # or     ls -l <nowiki>|</nowiki> tr 'a-z' 'A-Z' \\ ls -l <nowiki>|</nowiki> tr -s ' ' ' ' \\ ls -l <nowiki>|</nowiki> tr -d 'rwx'| 
-|~~#~~|<nowiki>|</nowiki>| +|~~#48~~|less /usr/share/doc/packages/apparmor-docs/techdoc.pdf \\ less -L /usr/share/doc/packages/apparmor-docs/techdoc.pdf \\ less /usr/share/doc/packages/automake/amhello-1.0.tar.gz \\ less /usr/include| 
-|~~#~~|<nowiki>|</nowiki>| +|~~#~~|tree <nowiki>|</nowiki> tee //file// \\ less //file//|
-|~~#~~|<nowiki>|</nowiki>| +
-|~~#~~|<nowiki>|</nowiki>|+
  
 <html></code></html> <html></code></html>
os_cp/redirects_pipes/solutions.1679445863.txt.gz · Last modified: (external edit)