-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathnl2shell.cm
More file actions
12607 lines (12607 loc) · 562 KB
/
nl2shell.cm
File metadata and controls
12607 lines (12607 loc) · 562 KB
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
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
top -b -d2 -s1 | sed -e '1,/USERNAME/d' | sed -e '1,/^$/d'
top -b -n 1 -u abc | awk 'NR>7 { sum += $9; } END { print sum; }'
top -b -d 5 -n 2 | awk '$1 == "PID" {block_num++; next} block_num == 2 {sum += $9;} END {print sum}'
top -n 1
top -bn1 | grep zombie
top -bn1 | sed -n '/Cpu/p'
top -bn1 | grep zombie | awk '{print $4" "$6" "$8" "$10}'
top -b -n1 -c
top -b -n1 | grep processname
top -n1 | sed 's/\(.*\)$/\1__CUSTOM_LINE_MARKER/g'
top -bn1 | sed -n '/Cpu/p' | awk '{print $2}' | sed 's/..,//'
top -b -n1 | head -8 | tail -1 | awk '{ printf "User: %s\nPID: %s\nCPU Usage: %s\nMEM Usage: %s\n", $2,$1,$9,$10 }'
top -b -n1 -c | awk '/PID *USER/{print;getline;print}'
top -b -n1 -c | grep -A 2 '^$'
top -u abc -d 30 -b -n 10
top -p $(pgrep -d',' http)
top -p "$(pgrep -d ',' java)"
top -p `pgrep process-name | tr "\\n" "," | sed 's/,$//'`
top -c -p $(pgrep -d',' -f string_to_match_in_cmd_line)
top -c
LINE=$(top -b -n 1 | tail -n +8 | head -n 1 | tr -s ' ')
OUTPUT=`top -b -n 1 | tail -n +8 | head -n 1`
top –p $PID
top -b -p `pidof a.out`
top -b -p `pidof a.out` -n 100
top -p "$(pgrep --newest ProgramName)"
top -p "$(pgrep ProgramName | head -n 1)"
top -p $(ps aux | awk '/ProgramName/ && ! /awk/ { print $2; exit; }')
top -p "$(pgrep --oldest ProgramName)"
top -b -n 1 | mail -s "any subject" your_email@domain.com
sudo cp mymodule.ko /lib/modules/$(uname -r)/kernel/drivers/
cat /boot/config-`uname -r` | grep IP_MROUTE
cat /boot/config-`uname -r`
find /lib/modules/`uname -r` -regex .*perf.*
grep “HIGHMEM” /boot/config-`uname -r`
cat /proc/2671/maps | grep `which tail`
view /boot/config-$(uname -r)
sudo lsusb -t|less
grep PROBES /boot/config-$(uname -r)
grep UTRACE /boot/config-$(uname -r)
grep ds1337 /lib/modules/`uname -r`/modules.alias
sudo lsusb -v|less
top -l 1 | grep $app_name
top -l 1 -s 0 -stats mem -pid $PID
top -l 1 -s 0 -i 1 -stats vprvt -pid $PID
sed -i "s/\\\\\n//g" filename
set -e
perl -pi -e 'BEGIN { print "A new line" }' $(find . -name '*.py')
for a in `find . -name '*.py'` ; do cp "$a" "$a.cp" ; echo "Added line" > "$a" ; cat "$a.cp" >> "$a" ; rm "$a.cp" ; done
find . -name \*.py -print0 | xargs -0 sed -i '1a Line of text here'
find . -name \*.py | xargs sed -i '1a Line of text here'
find ~ -type d -exec chmod +x {} \;
rename 's/(.*)$/new.$1/' original.filename
rename 's/^/new./' original.filename
nl -s prefix file.txt | cut -c7-
nl -s "prefix_" a.txt | cut -c7-
find /volume1/uploads -name "*.mkv" -exec mv \{\} \{\}.avi \;
cat <(crontab -l) <(echo "1 2 3 4 5 scripty.sh") | crontab -
ping google.com | xargs -L 1 -I '{}' date '+%c: {}'
ping host | perl -nle 'print scalar(localtime), " ", $_'
nl -ba infile
nl -ba long-file \
echo "$string" | nl -ba -s') '
crontab -l -u user | cat - filename | crontab -u user -
cat file1 file2 | crontab
crontab filename
pushd "$HOME/Pictures"
sudo chmod +x java_ee_sdk-6u2-jdk-linux-x64.sh
chmod +x pretty-print
chmod +x rr.sh
chmod a+x ComputeDate col printdirections
chmod +x *.sh
chmod g+w $(ls -1a | grep -v '^..$')
chmod g+w .[^.]* ..?*
find . -maxdepth 0 -type f -exec chmod g+w {} ';'
chmod g+w * ...*
nl -v1000001 file
sed 's/3d3d/\n&/2g' temp | split -dl1 - temp
for filename in *.jpg; do mv "$filename" "prefix_$filename"; done;
nl -s"^M${LOGFILE}> "
sudo chmod +rx $(which node)
find . -type d -exec chmod +rx {} \;
find . -name "rc.conf" -exec chmod o+r '{}' \;
find . -type f -iname '*.txt' -print0 | xargs -0 mv {} {}.abc
find ~/dir_data -type d -exec chmod a+xr,u+w {} \;
v=5 env|less
TESTVAR=bbb env | fgrep TESTVAR
pushd %Pathname%
chmod +x $(brew --prefix)/etc/bash_completion
touch -d "$(date -r filename) - 2 hours" filename
touch -d "$(date -r "$filename") - 2 hours" "$filename"
alias cd-='cd $(history -p !!:1)'
ssh -t example.com "screen -r -X ls"
ssh -t example.com "screen -r; ls"
ssh -t example.com "screen -r"
chmod a+x myscript.sh
chmod a+x $pathToShell"myShell.sh"
sudo chmod u+s `which Xvfb`
ssh -fL 127.0.0.1:someport:host.in.the.remote.net:22 proxy.host
yes no | <command>
yes 1 | command
yes n | rm -ir dir1 dir2 dir3
yes | cp * /tmp
yes | rm -ri foo
yes y | rm -ir dir1 dir2 dir3
yes '| COUNTRY' | sed $(wc -l < file)q | paste -d ' ' file -
sed 's/.*/& Bytes/' "$TEMPFILE" | column -t
find -type f | xargs -I {} mv {} {}.txt
echo -e "1\n2\n3" | sed 's/.*$/&<br\/>/'
sed 's/$/\r/g' input |od -c
echo 'deb blah ... blah' | sudo tee --append /etc/apt/sources.list > /dev/null
awk 'NR==1 {print $0, "foo", "bar"; next} {print $0, ($2=="x"?"-":"x"), ($4=="x"?"-":"x")}' file | column -t
find . -type f -name "*.java" | xargs tar rvf myfile.tar
find . -name -type f '*.mp3' -mtime -180 -print0 | xargs -0 tar rvf music.tar
find . \( -iname "*.png" -o -iname "*.jpg" \) -print -exec tar -rf images.tar {} \;
find . -mtime -1 -type f -exec tar rvf "$archive.tar" '{}' \;
find . -mtime -1 -type f -print0 | xargs -0 tar rvf "$archive.tar"
history -a
history -r .cwdhist
history -r file.txt
LOGNAME="`basename "$0"`_`date "+%Y%m%d_%H%M"`"
name="$(date +'%d%m%Y-%H-%M')_$(whoami)"
LBUFFER+="$(date)"
xhost +si:localuser:`whoami`
PROMPT_COMMAND='echo "$(date +"%Y/%m/%d (%H:%M)") $(history 1 |cut -c 7-)" >> /tmp/trace'
KEY+=`date -r "$arg" +\ %s`
find . -name text.txt | sed 's|.*/\(.*\)/.*|sed -i "s@^@\1 @" & |' | sh
find dir -name image\*.jpg -exec /bin/ksh script.ksh {} \;
find . -type f -print0 | xargs -0 ./group.sed --separate
find . -regex "xxx-xxx_[a-zA-Z]+_[0-9]+_[0-9]+\.jpg$" -exec ./rename.sh "{}" ";"
rsync -rvz -e 'ssh -p 2222' --progress ./dir user@host:/path
rsync -av --copy-dirlinks --delete ../htmlguide ~/src/
rsync -avh /home/abc/* /mnt/windowsabc
rsync -a --stats --progress --delete /home/path server:path
rsync -av /home/user1 wobgalaxy02:/home/user1
rsync -avz --progress local/path/some_file usr@server.com:"/some/path/"
rsync -avzru --delete-excluded server:/media/10001/music/ /media/Incoming/music/
rsync -avzru --delete-excluded /media/Incoming/music/ server:/media/10001/music/
rsync -av --exclude '*.svn' user@server:/my/dir .
rsync -avv source_host:path/to/application.ini ./application.ini
rsync -avz -e "ssh -p $portNumber" user@remote.host:/path/to/copy /local/path
rsync -chavzP --stats user@remote.host:/path/to/copy /path/to/local/storage
rsync -chavzP --stats /path/to/copy user@host.remoted.from:/path/to/local/storage
rsync -avlzp user@remotemachine:/path/to/files /path/to/this/folder
rsync -av --rsync-path="sudo rsync" /path/to/files user@targethost:/path
rsync -av /path/to/files user@targethost:/path
rsync -azP -e "ssh -p 2121" /path/to/files/source user@remoteip:/path/to/files/destination
rsync -avlzp /path/to/sfolder name@remote.server:/path/to/remote/dfolder
rsync -aHvz /path/to/sfolder name@remote.server:/path/to/remote/dfolder
rsync -aHvz /path/to/sfolder/ name@remote.server:/path/to/remote/dfolder
rsync -avz --ignore-existing /source folder/* user@remoteserver:/dstfolder/
rsync -ravz /source/backup /destination
rsync -a --relative /top/a/b/c/d remote:/
rsync --progress -avhe ssh /usr/local/ XXX.XXX.XXX.XXX:/BackUp/usr/local/
rsync -rave "ssh -i /home/test/pkey_new.pem" /var/www/test/ ubuntu@231.210.24.48:/var/www/test
rsync -av <SOURCE_DIR> rsyncuser@192.168.1.110:/srv/www/prj112/myfolder
rsync -aqz _vim/ ~/.vim
rsync -aqz _vimrc ~/.vimrc
rsync -a --delete blanktest/ test/
rsync -aPSHiv remote:directory .
rsync -ave ssh fileToCopy ssh.myhost.net:/some/nonExisting/dirToCopyTO
rsync -avR foo/bar/baz.c remote:/tmp/
rsync -a myfile /foo/bar/
rsync -vuar --delete-after path/subfolder/ path/
rsync -a --exclude .svn path/to/working/copy path/to/export
rsync -avR somedir/./foo/bar/baz.c remote:/tmp/
rsync -azP -e "ssh -p PORT_NUMBER" source destination
rsync -rvz --chmod=ugo=rwX -e ssh source destination
rsync -avz --rsh='ssh -p3382' source root@remote_server_name:/opt/backups
rsync -avz --chmod=ug=rwx --chmod=o=rx -e ssh src dest
rsync -a -v src dst
rsync -a -v --ignore-existing src dst
rsync -av --delete src-dir remote-user@remote-host:dest-dir
rsync -avz foo:src/bar /data/tmp
rsync -azvu -e ssh user@host1:/directory/ user@host2:/directory2/
rsync -avz -e "ssh -p $portNumber" user@remoteip:/path/to/files/ /local/path/
find /var/www/* -type d -print | tar -zcpvf {}.tar.gz -C /var/www/ --files-from - {} \;
rsync -aP --include=*/ --include=*.txt --exclude=* . /path/to/dest
find *.1 -exec tar czf '{}.tgz' '{}' --remove-files \;
find . -name \*.xml | grep -v /workspace/ | tr '\n' '\0' | xargs -0 tar -cf xml.tar
find . -type f -name "*html" | xargs tar cvf htmlfiles.tar -
find /path/to/directory/* -maxdepth 0 -type d -printf "%P\n" -exec sudo tar -zcpvf {}.tar.gz {} \;
find /path/* -maxdepth 0 -type d -exec sudo tar -zcpvf {}.tar.gz {} \;
find -x data -name "filepattern-*2009*" -print0 | tar --null --no-recursion -uf 2009.tar --files-from -
find data -xdev -name "filepattern-*2009*" -print0 | tar --null --no-recursion -uf 2009.tar --files-from -
find data/ -name "filepattern-*2009*" | cpio -ov --format=ustar > 2009.tar
find data/ -name 'filepattern-*2009*' -exec tar uf 2009.tar '{}' +
find data/ -name filepattern-*2009* -exec tar uf 2009.tar {} ;
find data/ -name filepattern-*2009* -print0 | xargs -0 tar uf 2009.tar
rsync -a -f"+ info.txt" -f"+ data.zip" -f'-! */' folder1/ copy_of_folder1/
rsync -vaut ~/.env* ~/.bash* app1:
rsync -av --files-from=- --rsync-path="sudo rsync" /path/to/files user@targethost:/path
find data/ -print0 | tar --null -T - --create -f archive.tar
find data/ -print0 | tar -T - --null --create -f archive.tar
find ./* | cpio -o > arch.cpio
tar -cvf - data/* | gzip > data.tar.gz
rsync -av remote_host:'$(find logs -type f -ctime -1)' local_dir
rsync -auve "ssh -p 2222" . me@localhost:/some/path
rsync -av . server2::sharename/B
rsync -az --delete /mnt/data/ /media/WD_Disk_1/current_working_data/;
rsync symdir/ symdir_output/ -a --copy-links -v
rsync -avz tata/ tata2/
rsync -avR $i /iscsi;
rsync -av $myFolder .
bzip2 -c file | tee -a logfile
rsync -a --filter="-! */" sorce_dir/ target_dir/
rsync -a /mnt/source-tmp /media/destination/
rsync -avz --rsh="ssh -p$2" key.pub $1:~/.ssh/key.pub
find "$(pwd -P)" -type d \( -path '/path/to/dir1' -or -path '/path/to/dir2' \) -prune -or -not \( -path '/path/to/file1' -or -path '/path/to/file2' \) -print0 | gnutar --null --no-recursion -czf archive.tar.gz --files-from -
sudo rsync -az user@10.1.1.2:/var/www/ /var/www/
rsync -av --progress sourcefolder /destinationfolder --exclude thefoldertoexclude
rsync -av --progress --exclude=*.VOB --exclude=*.avi --exclude=*.mkv --exclude=*.ts --exclude=*.mpg --exclude=*.iso --exclude=*ar --exclude=*.vob --exclude=*.BUP --exclude=*.cdi --exclude=*.ISO --exclude=*.shn --exclude=*.MPG --exclude=*.AVI --exclude=*.DAT --exclude=*.img --exclude=*.nrg --exclude=*.cdr --exclude=*.bin --exclude=*.MOV --exclude=*.goutputs* --exclude=*.flv --exclude=*.mov --exclude=*.m2ts --exclude=*.cdg --exclude=*.IFO --exclude=*.asf --exclude=*.ite /media/2TB\ Data/data/music/* /media/wd/network_sync/music/
find .. -type d -print0 | xargs -0 tar cf dirstructure.tar --no-recursion
find backup/ -type d -print0 | xargs -0 tar cf directory-structure.tar --no-recursion
find backup/ -type d | tar cf directory-structure.tar -T - --no-recursion
find backup/ -type d | xargs tar cf directory-structure.tar --no-recursion
find . -type d |xargs tar rf /somewhereelse/whatever-dirsonly.tar --no-recursion
find . -type d -print0 | tar cf directory-structure.tar --null --files-from - --no-recursion
find . -type d -print0 | tar cf dirstructure.tar --null --files-from - --no-recursion
find / -print0 | tar -T- --null --no-recursive -cjf tarfile.tar.bz2
find / -print0 | xargs -0 tar cjf tarfile.tar.bz2
tar -czf /fss/fi/outfile.tar.gz `find /fss/fin -d 1 -type d -name "*" -print`
sudo crontab -e -u apache
screen -S 'name' 'application'
screen -S foo
screen -S lynx lynx
screen -r 'name'
find . -type f -print0 | xargs -0 chmod 644
find . -type d -print0 | xargs -0 chmod 755
alias rm100m="find / -type f -name *.tar -size +100M -exec rm -i {} \;"
alias rm1g="find / -type f -name *.tar -size +1G -exec rm -i {} \;"
alias rm2g="find / -type f -name *.tar -size +2G -exec rm -i {} \;"
alias rm5g="find / -type f -name *.tar -size +5G -exec rm -i {} \;"
alias rmc="find . -iname core -exec rm {} \;"
ifconfig eth0 hw ether 00:80:48:BA:d1:30
screen -xr 14313
tmux attach -t test1
tmux attach -t <session name>
scp -p /home/reportuser/dailyReport.doc root@localhost:/root/dailyReports/20150105/
scp -o StrictHostKeyChecking=no root@IP:/root/K
scp -rp "DAILY_TEST_FOLDER" "root@${IPADDRESS}:/home/root/"
sshpass -p "YOUR_PASSWORD" ssh -o StrictHostKeyChecking=no YOUR_USERNAME@SOME_SITE.COM
sshpass -p "YOUR_PASSWORD" ssh -o StrictHostKeyChecking=no YOUR_USERNAME@SOME_SITE.COM:2400
yes | sudo rpm -Uvh https://mirror.webtatic.com/yum/el6/latest.rpm
yes 1 | script -c 'aspell check text.txt' /dev/null
yes 0 | script -c 'ispell text.txt' /dev/null
yes 0 | script -c 'ispell text.txt' out.txt
find /etc -name "*.txt" | xargs -I {} mv {} {}.bak
find /etc -print0 -name "*.txt" | xargs -I {} -0 mv {} {}.bak
mysqldump -e --user=username --password=pswd database | gzip | uuencode my-dbbackup.`date +"\%Y-\%m-\%d"`.gz | mail me@domain.com
screen -L bash -c '(while :; do tail ~/screenlog.0 | grep -o "[0-9]*%" | tail -1; done | zenity --progress --auto-close &); 7z a "output.zip" "/path/to/input"'
find -name "*.php" –exec cp {} {}.bak \;
find . -name "*.java" -exec cp {} {}.bk \;
find -depth -printf '%m:%u:%g:%p\0' >saved-permissions
mount --bind /tmp/fakerandom /dev/random
mount --bind /original/path /new/path
mount --bind /something /new_something
ifconfig eth0 down
find /usr/local/svn/repos/ -maxdepth 1 -mindepth 1 -type d -printf "%f\0" | xargs -0 -I{} echo svnadmin hotcopy /usr/local/svn/repos/\{\} /usr/local/backup/\{\}
yes '' | ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"
find . -type f | while read f; do g=`md5sum $f | awk '{print $1}'`; echo "$g $f"> $f-$g.md5; done
find . -type f | while read f; do g=`md5sum $f` > $f.md5; done
find . -type f -exec md5sum {} \; > MD5SUMS
md5sum *.java | awk '{print $1}' | sort | uniq -d
find . -type f -exec md5sum \{\} \;
find . | xargs md5sum
FILE="/tmp/command_cache.`echo -n "$KEY" | md5sum | cut -c -10`"
md5=$(echo "$line"|md5sum)
checksum=`md5sum /etc/localtime | cut -d' ' -f1`
ls -alR -I dev -I run -I sys -I tmp -I proc /path | md5sum -c /tmp/file
cpio -i -e theDirname | md5sum
echo -n "" | md5sum
echo -n | md5sum
md5sum "$ecriv"
md5=$(md5sum $item | cut -f1 -d\ )
md5="$(md5sum "${my_iso_file}")"
md5=`md5sum ${my_iso_file} | cut -b-32`
md5sum "$source_file" "$dest_file"
find "$path" -type f -print0 | sort -z | xargs -r0 md5sum | md5sum
md5sum main.cpp*
md5sum <(zcat /tmp/tst.gz) <(bzcat /tmp/tst.bz2) <(lzcat /tmp/tst.lzma) <(xzcat /tmp/tst.xz)
find //path/to/source/Directory -type f -exec md5sum {} + | awk '{print $0}' > Output.txt
find path/to/folder -type f -print0 | sort -z | xargs -0 sha1sum; find path/to/folder \( -type f -o -type d \) -print0 | sort -z | xargs -0 stat -c '%n %a' | sha1sum
find path/to/folder -type f -print0 | sort -z | xargs -0 cat | sha1sum
find path/to/folder -type f -print0 | sort -z | xargs -0 sha1sum | sha1sum
find path/to/folder -type f -print0 | xargs -0 sha1sum | sha1sum
echo -n teststring | gzip -1 | pigz -lv
echo -n teststring | gzip -1 | tail -c 8 | head -c 4 | hexdump -e '1/4 "%08x" "\n"'
seq -s "*" 1 500 |bc
SUM=$(tree | md5sum)
echo "a" | md5sum
echo -n 'exampleString' | md5sum
echo -n "logdir" | md5sum - | awk '{print $1}'
echo "password" | md5sum
cat submission.cpp | astyle -bj | cpp - | md5sum
echo -n "yourstring" |md5sum
grep -ar -e . --include="*.py" /your/dir | md5sum | cut -c-32
cat *.py | md5sum
grep -ar -e . /your/dir | md5sum | cut -c-32
grep -aR -e . /your/dir | md5sum | cut -c-32
find -maxdepth 1 -type f -exec md5sum {} \; | sed 's/[^(]*(\([^)]*\)) =/\1/'
find -maxdepth 1 -type f -exec md5sum {} \; | awk '{s=$2; $2=$1; $1=s;}1'
ls -p | grep -v / | xargs md5sum | awk '{print $2,$1}'
find . -name '.svn' -prune -o -type f -printf '%m%c%p' | md5sum
find /path -type f -name "*.py" -exec md5sum "{}" +;
echo -n -e '\x61' | md5sum
cat $FILES | md5sum
find /path -type f | sort -u | xargs cat | md5sum
cat $(echo $FILES | sort) | md5sum
md5sum filename |cut -f 1 -d " "
find . -maxdepth 1 -type f | md5sum
find "$path" -type f -print0 | sort -z | xargs -r0 md5sum | md5sum
du -csxb /path | md5sum -c file
find /path/to/dir/ -type f -name *.py -exec md5sum {} + | awk '{print $1}' | sort | md5sum
tar c dir | md5sum
find -iname "MyCProgram.c" -exec md5sum {} \;
find /path/to/dir/ -type f -name "*.py" -exec md5sum {} + | awk '{print $1}' | sort | md5sum
md5sum $(which cc)
md5sum $(which gcc)
md5sum `which c++`
<files.txt xargs stat -c %s | paste -sd+ - | bc
echo foo | tee >(sha1sum) >(md5sum)
octave -q --eval 'printf ("%f\n", sin([0:0.1:pi/2]))'|nl|tee y.txt
seq -5 10 | xargs printf "- - %s" | xargs | bc
seq -s+ -5 10 | bc
seq 10 | jq -s 'add'
seq 10 | tr '[\n]' '+' | sed -e 's/+/ + /g' -e's/ + $/\n/' | xargs expr
seq 10|jq -s add
seq 100000 | paste -sd+ | bc -l
ipcs -mb | awk 'NR > 3 { print $7 }' | paste -sd+ | bc
cat /file/with/numbers | php -r '$s = 0; while (true) { $e = fgets(STDIN); if (false === $e) break; $s += $e; } echo $s;'
alias memu="ps -u $(whoami) -o pid,rss,command | awk '{print \$0}{sum+=\$2} END {print \"Total\", sum/1024, \"MB\"}'"
find "$PWD" / -iname '*.jpg' -exec du -s {} + | sed "s/^/$(hostname): /"
find . -name "*jpg" -exec du -k {} \; | awk '{ total += $1 } END { print total/1024 " Mb total" }'
find . -type f -iname "*.jpg" -ls | awk 'BEGIN {print "0"}; {print $7, "+"}; END {print "p"}' | dc
octave -q --eval 'printf ("%f\n", [0:0.1:pi/2])'|nl|tee x.txt
depth=$(pstree -sA $processid | head -n1 | sed -e 's#-+-.*#---foobar#' -e 's#---*#\n#g' -eq | wc -l)
find . –iname "error" –print ( -i is for ignore ) find . –iname "error" –print ( -i is for ignore )
env | grep -i shell
cat report.txt | grep -i error | more
screen -D -m yourEvilProgram
rename -v 's/\.JPG/\.jpeg/' *.JPG
crontab -l | sed '/anm\.sh/s#\/5#\/10#' | crontab -
crontab -l | sed '/anm\.sh/s,^\*/5,*/10,' | crontab -
sudo find ./bootstrap/cache/ -type d -exec chown apache:laravel {} \;
sudo find ./storage/ -type d -exec chown apache:laravel {} \;
find htdocs -type f -exec chmod 664 {} + -o -type d -exec chmod 775 {} +
find ~ -group vboxusers -exec chown kent:kent {} \;
find . \( \! -user xx -exec chown -- xx '{}' + -false \)
sudo find /var/www -nouser -exec chown root:apache {} \;
echo ',s/foo/bar/g; w' | tr \; '\012' | ed -s file.txt
source <(export | sed 's/gcc.4.2/gcc64/g')
cd -P "$dir1"
cd /lib/modules/$(uname -r)/
cd /path/to/pdf
cd -L ..
cd $(dirname $(dirname $(which perl)))/lib
cd "$(find . -print0 | sort -z | tr '\0' '\n' | tail -1)"
cd $(basename $1 .tar.gz)
cd /home/`whoami`
cd "$(dirname "$1")"
cd "$(dirname $(which oracle))"
cd $(dirname $(which oracle))
cd $(dirname `which oracle`)
cd $(dirname $(which $0) )
cd $(which oracle | xargs dirname)
cd "$(grep DOWNLOAD $HOME/.config/user-dirs.dirs | cut -f 2 -d "=" | tr "\"" "\n" | tr -d "\n")"
cd "$(grep DOWNLOAD $HOME/.config/user-dirs.dirs | cut -f 2 -d "=" | tr "\"" "\n")"
cd $( ~/marker.sh go "$@" )
cd $(dirname $(readlink -f $0))
cd $(readlink /proc/$PID/cwd)
cd $(readlink -f $(dirname $0))
cd
sudo find /var/www/html/ -type d -exec chmod 775 {} \;
sudo find /var/www/html/ -type f -exec chmod 664 {} \;
find . -name "*.css" -exec sed -i -r 's/#(FF0000|F00)\b/#0F0/' {} \;
chown -v root:root /path/to/yourapp
find /path/to/directory -type f -exec chmod 644 {} +
cd $(dirname $(readlink -f $0))
find / -group 2000 -exec chgrp -h foo {} \;
chsh -s $(which zsh)
find . -name '*.php' -exec chmod 755 {} \; | tee logfile.txt
chown user_name file
sudo chown root:wheel com.xxxx.adbind.plist
chown root:root script.sh
chown user_name folder
sudo chown el my_test_expect.exp
chown $1:httpd .htaccess
chown $FUID:$FGID "$FILE2"
chown -- "$user:$group" "$file"
sudo chown bob:sftponly /home/bob/writable
sudo chown root:dockerroot /var/run/docker.sock
sudo chown root:wheel adbind.bash
sudo chown root:wheel bin
sudo chown root:www-data /foobar/test_file
sudo chown `whoami` /data/db
sudo chown `whoami` /vol
find /path/to/look/in/ -type d -name '.texturedata' -exec chmod 000 {} \; -prune
find /path/to/look/in/ -type d -name '.texturedata' -prune -print0 | xargs -0 chmod 000
find "$d/" -type d -print0 | xargs -0 chmod 755
find -perm 777 | xargs -I@ sudo chmod 755 '@'
find . -name "*.php" -exec chmod 755 {} \;
find . -name "*.php" -exec chmod 755 {} + -printf '.' | wc -c
find . -name "*.php" -exec chmod 755 {} \; -exec /bin/echo {} \; | wc -l
chmod 444 .bash_logout .bashrc .profile
sudo chmod 755 .git/hooks/pre-commit
sudo chmod 777 .git/hooks/prepare-commit-msg
sudo chmod 755 /dvtcolorconvert.rb
chmod 777 /usr/bin/wget
sudo chmod 755 mksdcard
find . -type d -exec chmod 755 {} +
find ~/dir_data -type d -exec chmod a+xr,u+w {} \;
find ./debian -type d | xargs chmod 755
find . -name "*.php" -exec chmod 755 {} + -printf '.' | wc -c
find . -name "*.php" | pv --line-mode | xargs chmod 755
find . -name '*.php' -exec chmod 755 {} \; -exec echo '+' \;
find . -name "*.php" -exec chmod 755 {} \; -exec /bin/echo {} \; | wc -l
find . -type f -exec chmod 644 {} +
find ~/dir_data -type f -exec chmod a-x,u+w {} \;
chmod 555 /home/sshtunnel/
find /path -type d -exec chmod 0755 "{}" \;
find /path -type d -exec chmod 0755 {} \;
find /path -type d | xargs chmod 0755
find . -type f -exec chmod 500 {} ';'
find . -name "*.rb" -type f -exec chmod 600 {} \;
find /usr/local -name "*.html" -type f -exec chmod 644 {} \;
find /path/to/someDirectory -type d -print0 | xargs -0 sudo chmod 755
find . -type f | xargs -I{} chmod -v 644 {}
find . -type f | xargs chmod -v 644
find ./ -type f -print0 | xargs -t -0 chmod -v 644
find . -type f -print | sed -e 's/^/"/' -e 's/$/"/' | xargs chmod 644
find /path/to/someDirectory -type f -print0 | xargs -0 sudo chmod 644
find /path/to/dir/ -type f -print0 | xargs -0 chmod 644
find /path/to/dir ! -perm 0644 -exec chmod 0644 {} \;
find /path/to/dir/ -type f ! -perm 0644 -print0 | xargs -0 chmod 644
find . -type d -print0|xargs -0 chmod 644
find . -perm 755 -exec chmod 644 {} \;
find . -type f -perm 755 -exec chmod 644 {} \;
find . -type f -name '*.php' -exec chmod 644 {} \;
find . -type f -exec chmod 644 {} \;
find . -mindepth 1 -type d | xargs chmod 700
find . -mindepth 2 | xargs chmod 700
find /path/to/dir -type d -exec chmod 755 {} \;
find . -type d | xargs chmod -v 755
find . -type d -print | sed -e 's/^/"/' -e 's/$/"/' | xargs chmod 755
find . -type d -exec chmod 755 {} \;
find . -type d -exec chmod 777 {} \;
find . -type f -exec chmod u=rw,g=r,o= '{}' \;
find . -type f -exec chmod u=rw,g=r,o= '{}' \;
find . -type d -exec chmod u=rwx,g=rx,o= '{}' \;
find . -type d -exec chmod u=rwx,g=rx,o= '{}' \;
find htdocs cgi-bin -name "*.cgi" -type f -exec chmod 755 {} \;
find . -type f -exec sed -i 's/searc/replace/g' {} \;
cp --remove-destination $(readlink $f) $f
find . -type f -name '*.java' -exec sh -c 'iconv -f cp1252 -t utf-8 "$1" > converted && mv converted "$1"' -- {} \;
find . -name "*.txt" | sed "s/\.txt$//" | xargs -i echo mv {}.txt {}.bak | sh
chown :friends myfile
find . -type d | sed -e 's/\.\///g' -e 's/\./avoid/g' | grep -v avoid | awk '{print $1"\t"$1}' | xargs chgrp
find . -type d | sed -e 's/\.\///g' | awk '{print $1, $1}' | xargs chgrp
find . -group root -print | xargs chgrp temp
chown root:root it
sudo chown root:root testfile.txt
sudo chown root:root uid_demo
chown $JBOSS_USER $JBOSS_CONSOLE_LOG
sudo chown nobody /var/www/html/mysite/images/
sudo chown nobody /var/www/html/mysite/tmp_file_upload/
chown user destination_dir
sudo chown root process
find /mydir -type f -name "*.txt" -execdir chown root {} ';'
ls /empty_dir/ | xargs -L10 chown root
ls /empty_dir/ | xargs -n10 chown root
find . -not -iwholename './var/foo*' -exec chown www-data '{}' \;
find dir_to_start -name dir_to_exclude -prune -o -print0 | xargs -0 chown owner
find dir_to_start -not -name "file_to_exclude" -print0 | xargs -0 chown owner
chown ${JBOSS_USER}: $(dirname $JBOSS_PIDFILE) || true
sudo chown hduser:hadoop {directory path}
chown owner:nobody public_html
chown root:specialusers dir1
chown user:group file ...
sudo chown root. /etc/udev/rules.d/51-android.rules
sudo chown root /home/bob
sudo chown root file.sh
find . -user aluno1 -exec chown aluno2 {}
find -user root -exec chown www-data {} \;
find . -exec chown myuser:a-common-group-name {} +
find -x / -user george -print0 | xargs -0 chown eva
find . -type d -user harry -exec chown daisy {} \;
find . -type f -exec chmod 644 {} \;
find . -type f -exec chmod 0644 {} +
find . -type f -exec chmod 0644 {} \;
find . -type d -exec chmod 0755 {} \;
find . -type f | xargs -I{} chmod -v 644 {}
find . -type f | xargs chmod -v 644
find . -type d | xargs chmod -v 755
find /var/ftp/mp3 -name '*.mp3' -type f -exec chmod 644 {} \;
find . -maxdepth 1 -type d -exec chmod -R 700 {} \;
find . -type d -exec chmod 755 {} \;
touch -h somesymlink
find /var/www -print0 | xargs -0 chown www-data:www-data
find . -type d -user harry -exec chown daisy {} \;
cd foo | cat
cd -P xyz
cd `cat $HOME/.lastdir`
cd "$(dirname "$(which oracle)")"
cd "$(dirname $(which oracle))"
cd $(dirname $(which oracle))
cd $(dirname `which oracle`)
cd $(which oracle | xargs dirname)
cd `dirname $TARGET_FILE`
cd -P ..
cd "$(dirname "$(which oracle)")"
cd `which <file> | xargs dirname`
cd `dirname $(which python)`
cd "$TAG"
find / -user 1005 -exec chown -h foo {} \;
chown amzadm.root /usr/bin/aws
chgrp btsync /etc/btsync/[prefered conf name].conf
chgrp www-data /home/www-user/php_user.sh
chgrp forge /var/run/fcgiwrap.socket
chgrp loggroup logdir
chgrp groupb myprog
chgrp "${USER}" myprogram
chgrp god public private
chgrp pub public
chgrp Workers shared
chgrp target_group target_directory
sudo chgrp gpio /sys/class/gpio/export /sys/class/gpio/unexport
chgrp
cd $(dirname $(which ssh));
find . -type f -iname "*.txt" -print | xargs grep "needle"
find . -type f -iname "*.txt" -print0 | xargs -0 grep "needle"
ssh -q $HOST [[ -f $FILE_PATH ]] && echo "File exists" || echo "File does not exist";
od -t x2 -N 1000 $file | cut -c8- | egrep -m1 -q ' 0d| 0d|0d$'
mount -l | grep 'type nfs' | sed 's/.* on \([^ ]*\) .*/\1/' | grep /path/to/dir
ssh remote_host test -f "/path/to/file" && echo found || echo not found
ssh host "test -e /path/to/file"
AMV=$(mount -l | grep "\[$VLABEL\]")
diff <(ssh server1 'rpm -qa | sort') <(ssh server2 'rpm -qa | sort')
mount | grep -q ~/mnt/sdc1
df $path_in_question | grep " $path_in_question$"
is_nullglob=$( shopt -s | egrep -i '*nullglob' )
tmux show-environment -g | grep RBENV
tmux show-environment -t sessname | grep RBENV
[[ $(find /path/to/file -type f -size +51200c 2>/dev/null) ]] && echo true || echo false
tmux show-environment | grep RBENV
mount |grep nfs
mount | grep $(readlink -f /dev/disk/by-uuid/$UUID )
mount | grep $(blkid -U '09b8f1ab-8d4b-4c5f-b395-40be09c090b0')
mount | grep $(blkid -U '09b8f1ab-8d4b-4c5f-b395-40be09c090b0') | grep '/media/WD_Disk_1 '
[ `md5sum $(which c++) | cut -d' ' -f1` == `md5sum $(which g++) | cut -d' ' -f1` ] && echo Yes, equal content || echo No, unequal content
cat *.txt | sort | sort -u -c
pstree --show-parents -p $$ | head -n 1 | sed 's/\(.*\)+.*/\1/' | wc -l
uname -m | grep '64'
find "$some_dir" -prune -empty -type d | read && echo empty || echo "not empty"
find "`echo "$some_dir"`" -maxdepth 0 -empty
[[ "$(find . -maxdepth 1 -cmin +60 -name file)" = "" ]] && echo "old"
kill -0 1
find "$somedir" -maxdepth 0 -empty -exec echo {} is empty. \;
comm -23 <(sort subset | uniq) <(sort set | uniq) | head -1
find "$somedir" -type f -exec echo Found unexpected file {} \;
ls `readlink somelink`
[ $(find your/dir -prune -empty) = your/dir ]
du -csxb /path | md5sum -c file
ssh -S my-ctrl-socket -O check jm@sampledomain.com
ssh -O check officefirewall
readelf -a -W libsomefile.a | grep Class: | sort | uniq
sudo env
find . -type f -name "*.php" -exec php -l {} \;
df $path_in_question | grep " $path_in_question$"
df /full/path | grep -q /full/path
pstree --show-parents -p $$ | head -n 1 | sed 's/\(.*\)+.*/\1/' | grep screen | wc -l
rpm -qf `which sort`
bzip2 -t file.bz2
groups monit |grep www-data
brew doctor
find . \( -name a.out -o -name '*.o' -o -name 'core' \) -exec rm {} \;
find . -type d -name ".svn" -print | parallel rm -rf
find . -type d -name ".svn" -print | xargs rm -rf
kill -9 $(ps -A -ostat,ppid | grep -e '[zZ]'| awk '{ print $2 }')
kill $(ps -A -ostat,ppid | awk '/[zZ]/{print $2}')
unzip -l some-jars-and-textfiles.zip | tr '[:blank:]' \\t | cut -f 5 | grep jar
history -c
history -cr
history -c
echo `clear`
clear
chown $(stat -c%u:%g "$srcdir") "$dstdir"
chown $(stat -f%u:%g "$srcdir") "$dstdir"
screen -X quit
ssh -S my-ctrl-socket -O exit jm@sampledomain.com
dir="`echo $dir | sed s,//,/,g`"
paste -d "" - -
diff "$source_file" "$dest_file"
diff current.log previous.log | grep ">\|<" #comparring users lists
diff -up fastcgi_params fastcgi.conf
diff -u file1 file2
find . -name "*.csv" -exec diff {} /some/other/path/{} ";" -print
find . -okdir diff {} /some/other/path/{} ";"
awk 'NR==1 { print; next } { print $0, ($1 == a && $2 == b) ? "equal" : "not_equal"; a = $1; b = $3 }' file | column -t
find . -name *.xml -exec diff {} /destination/dir/2/{} \;
find . -name '*.h' -execdir /bin/diff -u '{}' /tmp/master ';'
diff -ENwbur repos1/ repos2/
diff -u A1 A2 | grep -E "^\+"
comm abc def
diff -Naur dir1/ dir2
diff -Nar /tmp/dir1 /tmp/dir2/
comm <(sort -n f1.txt) <(sort -n f2.txt)
comm <(sort f1.txt) <(sort f2.txt)
diff <(echo hello) <(echo goodbye)
diff <(ls /bin) <(ls /usr/bin)
diff <(zcat file1.gz) <(zcat file2.gz)
find FOLDER1 -type f -print0 | xargs -0 -I % find FOLDER2 -type f -exec diff -qs --from-file="%" '{}' \+
comm -23 <(ls) <(ls *Music*)
DST=`dirname "${SRC}"`/`basename "${SRC}" | tr '[A-Z]' '[a-z]'`
g=`dirname "$f"`/`basename "$f" | tr '[A-Z]' '[a-z]'`
pstree -p | grep git
FOO=$(echo "Hello world" | gzip | base64)
gzip archive.tar
hey=$(echo "hello world" | gzip -cf)
gzip -c my_large_file | split -b 1024MiB - myfile_split.gz_
gzip -c mysqldbbackup.sql | uuencode mysqldbbackup.sql.gz | mail -s "MySQL DB" backup@email.com
gzip "$file"
find /var -iname \*.log | xargs bzip -
find /var -iname \*.log -exec bzip {} \;
gzip "{}"
gzip */*.txt
find . -type f -name "*.txt" -exec gzip {} \;
find ./ -name "*.img" -exec bzip2 -v {} \;
find . -name '*.txt' | xargs zip -9 txt.zip
find $LOGDIR -type d -mtime +0 -exec compress -r {} \;
find $LOGDIR -type d -mtime -1 -exec compress -r {} \;
find $PATH_TO_LOGS -maxdepth 1 -mtime +$SOME_NUMBER_OF_DAYS -exec gzip -N {} \;
find $FILE -type f -mtime 30 -exec gzip {} \;
find $FILE -type f -not -name '*.gz' -mtime 30 -exec gzip {} \;
find $PATH_TO_LOGS -maxdepth 1 -mtime +$SOME_NUMBER_OF_DAYS -exec sh -c "case {} in *.gz) ;; *) gzip '{}' ;; esac;" \;
find /source -type f -print0 | xargs -0 -n 1 -P $CORES gzip -9
find . -type f -print0 | xargs -0r gzip
echo *.txt | xargs gzip -9
sudo find / -xdev -type f -size +100000 -name "*.log" -exec gzip -v {} \;
sudo find / -xdev -type f -size +100000 -name "*.log" -exec gzip -v {} \; 2>&1 | awk '{print $6}'
sudo find / -xdev -type f -size +100000 -name "*.log" -exec gzip {} \; -exec echo {} \;
find *.1 -exec tar czf '{}.tgz' '{}' --remove-files \;
gzip -k *cache.html
find . -type f -name "*cache.html" -exec gzip -k {} \;
find . -type f -name "*cache.html" -exec sh -c "gzip < {} > {}.gz" \;
find folder -type f -exec gzip -9 {} \; -exec mv {}.gz {} \;
find . \! -name "*.Z" -exec compress -f {} \;
echo gzip. $( gzip | wc -c )
gzip
find . -type f -mtime +7 | tee compressedP.list | parallel compress
find . -type f -mtime +7 | tee compressedP.list | xargs -I{} -P10 compress {} &
find . -type f -mtime +7 | tee compressedP.list | xargs compress
uuencode <(head -c 200 /dev/urandom | base64 | gzip)
bzip2 file | tee -a logfile
find -name \*.xml -print0 | xargs -0 -n 1 -P 3 bzip2
bzip2 *
find PATH_TO_FOLDER -maxdepth 1 -type f -exec bzip2 -zk {} \;
compress $* &
bzip2 -k example.log
find "$1" -type f | egrep -v '\.bz2' | xargs bzip2 -9 &
date -ujf%s $(($(date -jf%T "10:36:10" +%s) - $(date -jf%T "10:33:56" +%s))) +%T
find ~/ -name '*.txt' -print0 | xargs -0 wc -w | awk 'END { print $1/(NR-1) }'
find ~/Journalism -name '*.txt' -print0 | xargs -0 wc -w | awk '$1 < 2000 {v += $1; c++} END {print v/c}'
find . -name '*.txt' -not -name "all.txt" | xargs cat > all.txt
pdfunite `find . -name "*.pdf" | sort` all.pdf
find . -iname '*test*' -exec cat {} \;
find . -name '*test*' -exec cat {} \;
paste -s -d' \n' input.txt
scp -qv $USER@$HOST:$SRC $DEST
ssh -S "$SSHSOCKET" -O exit "$USER_AT_HOST"
ssh -M -f -N -o ControlPath="$SSHSOCKET" "$USER_AT_HOST"
ssh -l ${USERNAME} ${HOSTNAME} "${SCRIPT}"
ssh -o StrictHostKeyChecking=no -l username hostname "pwd; ls"
scp -v user@remotehost:/location/KMST_DataFile_*.kms
scp -v /my_folder/my_file.xml user@server_b:/my_new_folder/
ssh -o UserKnownHostsFile=/dev/null username@hostname
scp -P 1234 user@[ip address or host name]:/var/www/mywebsite/dumps/* /var/www/myNewPathOnCurrentLocalMachine
scp -P 2222 /absolute_path/source-folder/some-file user@example.com:/absolute_path/destination-folder
scp -c blowfish -r user@your.server.example.com:/path/to/foo /home/user/Desktop/
yes > backingfile &
find . -name "*.txt" \( -exec echo {} \; -o -exec true \; \) -exec grep banana {} \;
yes | mv ...
yes a=\"20131202\" | sed -e :a -e 's/...\([0-9]\{4\}\)\([0-9]\{2\}\)\([0-9]\{2\}\)./\1 \2 \3/'
yes | pv --quiet --rate-limit 10
yes 123456789 | grep --line-buffered . | { head -n 1; head -n 1; }
ping google.com | awk -F'[ =]' 'NR>1{print system("echo -n $(date +%s)"), $11}'
yes Y | command-that-asks-for-input
yes Yes | ./ittp-update.sh
yes $'a\nb' | script.py
yes ok | recalcitrant.php
yes 2>/dev/null | ./MyScript.sh
yes | cat | more
yes | rm
yes | command
yes | command-that-asks-for-input
ping -b 10.10.0.255 | grep 'bytes from' | awk '{ print $4 }'
yes "Hidden" | dd of=/dev/sdb
yes "Hidden" | tr '\n' '\0' | dd of=/dev/sdb
yes "Hidden" | paste -d' ' -s - | dd of=/dev/sdb
yes 'UUUUUUUUUUUUUUUUU' | tr -d '\n' > /dev/to/overwrite
zcat /usr/share/man/man1/man.1.gz | groff -mandoc -Thtml
ping -c1 1199092913 | head -n1 | grep -Eow "[0-9]+[.][0-9]+[.][0-9]+[.][0-9]+"
echo 595a | awk -niord '$0=chr("0x"RT)' RS=.. ORS= | od -tx1c
echo "luke;yoda;leila" | tr ";" "\n"
echo abc | od -A n -v -t x1 | tr -d ' \n'
echo -ne 'some random\nbytes' | xxd -plain | tr -d '\n' | sed 's/\(..\)/%\1/g'
find -type f -name '*.au' | awk '{printf "%s %s\n",$0,$0".wav" }' | xargs sox
find -type f -name '*.au' | awk '{printf "sox %s %s\n",$0,$0".wav" }' | bash
find . -name '*.doc' | while read i; do antiword -i 1 "${i}" >"${i/doc/txt}"; done
find . -name '*.doc' | while read i; do antiword -i 1 "${i}" >"${i/doc/txt}" && rm "${i}"; done
cal -h 02 2012| cut -c4-17 | sed -r 's/(..)\s/\0\t\&/g' | sed 's/$/\t\\\\/' | head -n-1 | tail -n +2
cal 02 2012|perl -F'(.{1,3})' -anE'BEGIN{$,="\t&";$\="\t\\\\\n"}$.==1||eof||do{$i//=@F;print@F[map{$_*2-1}(1..$i/2)]}'
cal 02 2012|perl -lnE'$.==1||eof||do{$,="\t&";$\="\t\\\\\n";$l=$_;print map{substr($l,$_*3,3)}(1..5)}'
cal | sed '1d;2{h;s/./ /g;x};/^\s*$/b;G;s/\n/ /;s/^...\(.\{15\}\).*/\1/;s/.../ &\t\&/g;s/\&$/\\\\/'
find $STARTDIR -name '*.ps' -print | sed -e 's/.ps$//' | xargs -l -i ps2pdf '{}.ps' '{}.pdf'
find . -name *.txt | xargs dos2unix
find . -type f -exec dos2unix {} \;
find . -type f -exec dos2unix {} {} \;
find . -type f -print0 | xargs -0 -n 1 -P 4 dos2unix
find . -name "*bmp" -print0 | xargs -0 -l -i basename "{}" ".bmp" | xargs -0 -l -i convert "{}.bmp" "{}.png"
b=`echo "$a" | sed 's/./\L&/g'`
b=`echo "$a" | sed 's/./\U&/g'`
sed 's/.*/\L&/'
find ./polkadots -name 'image.pdf' -exec convert -transparent white -fuzz 10% {} image.png \; -print
find . -type f -name '*.m4a' -exec bash -c 'avconv -i "$0" "${0/%m4a/mp3}"' '{}' \;
find / -name "*.md" -type f -exec sh -c 'markdown "$0" > "$0.html"' {} \;
find / -name "*.md" -type f -exec sh -c 'markdown "${0}" > "${0%.md}.html"' {} \;
find . -type f | while read file; do sed -e 's/^M//g' -i "$file"; done
find /path/to/files -iname '*.jpg' -exec mogrify -format pdf {} +
readlink -f /x/y/../../a/b/z/../c/d
ln -sf "$(readlink -f "$link")" "$link"
od | cut -b 8- | xargs -n 1 | sort | uniq | wc -l
find . -type l | while read f; do /bin/cp -rf --remove-destination -f $(find . -name $(readlink "${f}")) "${f}";done;
CLEAN=`echo -n $CLEAN | tr A-Z a-z`
cat foo.md | pandoc -f markdown_github | lynx -stdin
cat infile | dos2unix -U | od -c
var1=`echo $var1 | tr '[A-Z]' '[a-z]'`
head -c1024 /dev/urandom | xxd -p | tr -d $'\n'
head /dev/random -c16 | od -tx1 -w16 | head -n1 | cut -d' ' -f2- | tr -d ' '
IFS=';' read -a myArray <<< "$myArray"
find $(pwd) -type f | xargs -I xxx sed -i 's/\r//g' xxx
cp -f "$project_dir"/iTunesArtwork Payload/iTunesArtwork
cp "${FILE}" "COLLECT/$(mktemp job_XXXXXXXXX)"
cp -v [MacVim_source_folder]/src/MacVim/mvim /usr/local/bin
sudo cp -a libgtest_main.so libgtest.so /usr/lib/
cp -n src dest
find . -name '*FoooBar*' | sed 's/.*/"&"/' | xargs cp ~/foo/bar
find . -name '*FooBar*' -exec cp -t ~/foobar -- {} +
find . -name "*foo*" | sed -e "s/'/\\\'/g" -e 's/"/\\"/g' -e 's/ /\\ /g' | xargs cp /your/dest
find . -type f -name '*.txt' | sed 's/'"'"'/\'"'"'/g' | sed 's/.*/"&"/' | xargs -I{} cp -v {} ./tmp/
cp lib*.so ~/usr/gtest/lib
find -name '*FooBar*' -print0 | xargs -0 cp -t ~/foo/bar
find . -type f -not -iname '*/not-from-here/*' -exec cp '{}' '/dest/{}' ';'
find . -iname "*foobar*" -exec cp "{}" ~/foo/bar \;
find . -name "file.ext"| grep "FooBar" | xargs -i cp -p "{}" .
find . | grep FooBar | xargs -I{} cp {} ~/foo/bar
cp -n
cp -vi /boot/config-`uname -r` .config
ls | xargs -n 1 cp -i file.dat
ls -d */ | xargs -iA cp file.txt A
echo dir1 dir2 dir3 | xargs -n 1 cp file1
cat allFolders.txt | xargs -n 1 cp fileName.txt
find . -mindepth 1 -maxdepth 1 -type d| grep \/a |xargs -n 1 cp -i index.html
find . -mindepth 1 -maxdepth 1 -type d| xargs -n 1 cp -i index.html
echo ./fs*/* | xargs -n 1 cp test
cp --parents src/prog.js images/icon.jpg /tmp/package
cp $(ls -1tr * | tail -1) /tmp/
rsync --blocking-io *.cc *.h SConstruct rsync://localhost:40001/bledge_ce
rsync -pr ./export /path/to/webroot
rsync --iconv=UTF-8-MAC,UTF-8 /Users/username/path/on/machine/ 'username@server.ip.address.here:/home/username/path/on/server/'
rsync --iconv=UTF-8,UTF-8-MAC /home/username/path/on/server/ 'username@your.ip.address.here:/Users/username/path/on/machine/'
rsync -a --relative /new/x/y/z/ user@remote:/pre_existing/dir/
rsync -r /path/to/source username@computer:/path/to/dest
rsync 6.3.3/6.3.3/macosx/bin/mybinary ~/work/binaries/macosx/6.3.3/
ssh USER@REMOTE "cat file"|xclip -i
cat allFolders.txt | xargs -n 1 cp fileName.txt
rsync --partial --progress --rsh=ssh local_file user@host:remote_file
rsync -P -e ssh local_file user@host:remote_file
echo 'some_file_name' | cpio -p --owner someuser:somegroup destination_directory
rsync -av --exclude='path1/to/exclude' --exclude='path2/to/exclude' source destination
rsync -u src dest
rsync -R src/prog.js images/icon.jpg /tmp/package
rsync -Rv src/prog.js images/icon.jpg /tmp/package/
set %PATH% | clip
rsync -r username@computer:/path/to/source /path/to/dest
find . -type f -name "*.mp3" -exec cp {} /tmp/MusicFiles \;
find dir/ -name '*.txt' | xargs cp -a --target-directory=dir_txt/ --parents
find "$somedir" -type d -empty -exec cp /my/configfile {} \;
find . -depth -print | cpio -o -O /target/directory
find . -name "*c" -print0 | xargs -0 -n1 cp xyz.c
find ./C -name "*.c" | xargs -n1 cp xyz.c
find . -type d -name "temp*" | xargs -n1 cp xyz.c
rsync --sparse sparse-1 sparse-1-copy
find ./ -mount -depth -print | cpio -pdm /destination_dir
find projects/ -name '*.php' -print | cpio -pdm copy/
find . -name \*.xml -print0 | cpio -pamvd0 /new/parent/dir
find /source_path -name *.data -exec cp {} /target_path \;
find /source_path -name \*.data | while read -r filename; do cp "${filename}" "$(printf "%s\n" "${filename}" | sed "s/^.*[/]\(category[^/]*\)[/]\(.*[.]data\)$/\/target_path\/\1_\2/")"; done
find jcho -name '*.data' | while read -r f; do cp "$f" "$(echo "$f" | sed 's~\([^)]*\)/\([^()]*\)$~\1_\2~')"; done
find jcho -name *.data -exec sh -c 'f="${0}"; d=$(echo ${f} | sed -re 's/0/2/' ); cp ${f} ${d} ' {} \;
find . -type f -name "*.mp3" -exec cp {} /tmp/MusicFiles \;
find . -name '*.txt' | while IFS= read -r FILE; do echo "Copying $FILE.."; cp "$FILE" /destination; done
find . -name '*.txt' | while read line; do echo "Copying '$line' to /tmp"; cp -- "$line" /tmp; done
find -name '*.patch' -print0 | xargs -0 -I {} cp {} patches/
find ./work/ -type f -name "*.pdf" -mtime +5 -size +2M | xargs -r cp -t ./backup/
find ~/ -name *.png -exec cp {} imagesdir \;
find dir/ -name '*.txt' | xargs cp -a --target-directory=dir_txt/ --parents
rsync -a --include='*/' --exclude='*' source/ destination/
rsync -a -f"+ */" -f"- *" source/ destination/
rsync /path/to/local/storage user@remote.host:/path/to/copy
find /home/ -maxdepth 1 -print | sudo cpio -pamVd /newhome
find -print0 | sort -z | cpio -pdv0 ../new
find -name '*FooBar*' -print0 | xargs -0 cp -t ~/foo/bar
find . | grep FooBar | xargs -I{} cp {} ~/foo/bar
find . -iname "*foobar*" -exec cp "{}" ~/foo/bar \;
find folder* -name '*.a' -print | cpio -pvd /path/to/dest
find . | cpio -pdumv /path/to/destination/dir
find /mail -type f | cpio -pvdmB /home/username
find /var/spool/mail -type f | cpio -pvdmB /home/username/mail
find . -type f -not -path '*/exlude-path/*' -exec cp --parents '{}' '/destination/' \;
find . -type f -not -iname '*/not-from-here/*' -exec cp '{}' '/dest/{}' ';'
find . -type f -not -path '*/not-from-here/*' -exec cp '{}' '/dest/{}' \;
cp `ls | grep -v Music` /target_directory
find . -type f | xargs grep -l "textToSearch" | cpio -pV $destination_path
rsync -zvr --include="*.sh" --exclude="*" $from/* root@$host:/home/tmp/
find . -name "*failed.ipynb" | cpio -pd ./fails
find . -name 'file_name.extension' -print | cpio -pavd /path/to/receiving/folder
find olddir -name script.sh -printf "%p\0" -printf "newdir/%P\0" | xargs -0L2 cp -n
find . | grep "FooBar" | tr \\n \\0 | xargs -0 -I{} cp "{}" ~/foo/bar
find myfiles | cpio -pmud target-dir
find foo -type f ! -name '*Music*' -exec cp {} bar \;
find /home/mine -iname "*.png" -printf "%P\n " | xargs -I % -n1 cp % /home/mine/pngcoppies/copy%
find /home/mine -iname "*.png" -execdir cp {} /home/mine/pngcoppies/copy{} \;
find "/tmp/2/" -iname "$j.sh" -exec cp {} "$i" \;
find . -type f -iname "*.flac" -o -print0 -iname "*.mp3" -print0 -o -iname "*.wav" -print0 -o -iname "*.aac" -print0 -o -iname "*.wma" -print0 | while read -d $'\0' file; do cp -ruv "$file" "/media/wd/network_sync/music/$file"; done
find . -type f -exec sh -c 'cp "$@" /tmp' {} +
find . -type f -exec sh -c 'cp "$@" /tmp' {} +
find . -type f -exec cp -t TARGET {} \+
find /path -type f -name '*~' -print0 | xargs -0 -I % cp -a % ~/backups
find src/ -type d -exec mkdir -p dest/{} \; -o -type f -exec touch dest/{} \;
yes | cp -rf /zzz/zzz/* /xxx/xxx
pwd | tr -d '\n' | pbcopy
pwd | xsel -i
ssh-copy-id myname@somehost
find dir/ -name '*.txt' | xargs cp -a --target-directory=dir_txt/ --parents
find "$sourceDir" -type d | sed -e "s?$sourceDir?$targetDir?" | xargs mkdir -p
find ./<SOURCE_DIR>/ -type d | sed 's/\.\/<SOURCE_DIR>//g' | xargs -I {} mkdir -p <DEST_DIR>"/{}"
find . -type d -exec mkdir -p -- /path/to/backup/{} \;
find olddir -type d -printf "newdir/%P\0" | xargs -0 mkdir -p
find . -depth -print | cpio -o -O /target/directory
mkdir dir2; tar cvf - dir1/ --exclude "*/exclude" | tar xvf - -C dir2
mkdir dir2; find dir1 \( -type l -o -type f \) -not -wholename '*/exclude/*' -exec cp -P --parents '{}' dir2/ \;
cp /file/that/exists /location/for/new/file
cp -n src dest
find dir1 dir2 dir3 dir4 -type d -exec cp header.shtml {} \;
scp -C file remote:
cp --remove-destination `readlink bar.pdf` bar.pdf
cp --remove-destination `readlink file` file
sudo cp -a include/gtest /usr/include
cp -rf --remove-destination `readlink file` file
any_command_what_produces_relative_path_names | cpio -pamVd /new/parent/dir
find . -type f -execdir bash -c ' dest=${1//[0-9]/} [[ -f $dest ]] || cp -- "$1" "$dest" ' _ {} \;
cat $1 | ssh $2 "mkdir $3;cat >> $3/$1"
rsync -e ssh file host:/directory/.
chmod --reference version2/somefile version1/somefile
rsync -rtvpl /source/backup /destination
rsync -avz --chmod=o-rwx -p tata/ tata2/
rsync -avzn --list-only --include 'company1/' --include 'company1/unique_folder1/***' --exclude '*' -e ssh user@server.com:/path/to/old/data/ /path/to/new/data
cp -nr src_dir dest_dir
cp --parents src/prog.js images/icon.jpg /tmp/package
find ./ -depth -print | cpio -pvd newdirpathname
find . | cpio -pdumv /path/to/destination/dir
find original -type d -exec mkdir new/{} \;
find . -type d | cpio -pdvm destdir
find src/ -type d -exec mkdir -p dest/{} \; -o -type f -exec touch dest/{} \;
rsync -rl --delete-after --safe-links pi@192.168.1.PI:/{lib,usr} $HOME/raspberrypi/rootfs
find . | cpio -pdumv /path/to/destination/dir
cp -R t1/ t2
cp `which python2.7` myenv/bin/python
tar -c -C /path/on/local/machine . | docker cp - dvc:/path/on/container
tar -c foo.sh | docker exec -i theDockerContainer /bin/tar -C /tmp -x
chown --reference=file.txt -- "$tempfile"
chown --reference=oldfile newfile
chown `stat -c %U originalfile`:`stat -c %G originalfile` newfile
bash | tee /var/log/bash.out.log
find /your/webdir/ -type d -print0 | xargs -0 chmod 755
find /your/webdir -type f | xargs chmod 644
find . -maxdepth 1 -type d -exec ls -dlrt {} \; | wc --lines
find . -type d -exec ls -dlrt {} \; | wc --lines
find /DIR -type f -print0 | tr -dc '\0' | wc -c
find . -name "*.c" -print0 | xargs -0 cat | wc -l
find -name '*php' | xargs cat | wc -l
find -name '*.php' | xargs cat | wc -l
find . -name "*.php" | xargs grep -v -c '^$' | awk 'BEGIN {FS=":"} { $cnt = $cnt + $2} END {print $cnt}'
find ./ -type f -exec wc -l {} \; | cut -d' ' -f1 | paste -sd+ | bc
find ~music -type f -iname *.mp3 | wc -l
find . -name '*.php' | xargs wc -l
find -type f -exec readlink -m {} \; | gawk 'BEGIN{FS="/";OFS="/"}{$NF=tolower($NF);print}' | uniq -c
find . -atime +30 -exec ls \; | wc -l
find "$DIR_TO_CLEAN" -mtime +$DAYS_TO_SAVE | wc -l
find . -maxdepth 1 -type f -printf '%TY-%Tm\n' | sort | uniq -c
find /home/my_dir -name '*.txt' | xargs grep -c ^.*
cat foo.pl | sed '/^\s*#/d;/^\s*$/d' | wc -l
find /path/to/dir/ -type f -name "*.py" -exec md5sum {} + | awk '{print $1}' | sort | md5sum
cat foo.c | sed '/^\s*$/d' | wc -l
sed '/^\s*$/d' foo.c | wc -l
result="$(dig +short @"$server" "$domain" | wc -l)"
git ls-files | xargs file | grep "ASCII" | cut -d : -f 1 | xargs wc -l
zcat Sample_51770BL1_R1.fastq.gz | wc -l
zcat *R1*.fastq.gz | wc -l
echo "123 123 123" | grep -o 123 | wc -l
who | awk -F' ' '{print $1}' | sort -u | wc -l
find /usr/src -name "*.html" -exec grep -l foo '{}' ';' | wc -l
find /usr/src -name "*.html" | xargs grep -l foo | wc -l
tr -d -C X <infile | wc -c
sed 's/[^x]//g' filename | tr -d '\012' | wc -c
find /home/user1/data1/2012/mainDir -name '*.gz' | wc -l
find -name "*.gz" | wc -l
find . -name "*.java" | wc -l
find . -mindepth 1 -maxdepth 1 -type d | wc -l
find /mount/point -maxdepth 1 -type d | wc -l
diff -U 0 file1 file2 | grep ^@ | wc -l
find . -type f | xargs | wc -c
diff file1 file2 | grep ^[\>\<] | wc -l
diff -U 0 file1 file2 | grep -v ^@ | wc -l
find . -type f -exec basename {} \; | wc -l
find /directory/ -maxdepth 1 -type d -print| wc -l
comm -12 <(sort file1.txt) <(sort file2.txt) | wc -l
comm -12 ignore.txt input.txt | wc -l
find /usr/ports/ -name pkg-plist\* -exec grep dirrmtry '{}' '+' | wc -l
find /usr/ports/ -name pkg-plist\* -exec grep -l etc/rc.d/ '{}' '+' | wc -l
find /usr/ports/ -name pkg-plist\* -exec grep 'unexec.rmdir %D' '{}' '+' | wc -l
find . -type d -exec basename {} \; | wc –l
find /dev/sd*[a-z] -printf . | wc -c
find /dev/sd*[a-z] | wc -l
find /data/SpoolIn -name job.history -exec grep -l FAIL {} \+ | wc -l
find /data/SpoolIn -name job.history -exec grep -l FAIL {} \; | wc -l
find /data/SpoolIn -name job.history | xargs grep -l FAIL | wc -l
find -name file1 | wc -l
find -name file1 | wc -l
find . -name "*.php" -exec chmod 755 {} \; -exec /bin/echo {} \; | wc -l
cat /dir/file.txt | wc -l
cat /etc/fstab | wc -l
cat myfile.txt | wc -l
fold -w "$COLUMNS" testfile | wc -l
find . -name '*.php' -type f | xargs cat | wc -l
wc -l `tree -if --noreport | grep -e'\.php$'`
cat `/gnuwin32/bin/find.exe . -name *.php` | wc -l
cat *.txt | wc -l
find xargstest/ -name 'file??' | sort | xargs wc -l
find . -name "*.java" -exec wc -l {} \;
find . -name "*.rb" -type f -exec wc -l \{\} \;
find . -name "*.rb" -type f -print0 | xargs -0 wc -l
git ls-files | xargs cat | wc -l
find ./ -type f -exec wc -l {} \; | cut -d' ' -f1 | paste -sd+ | bc
cat $(find /usr/share/doc/ -name '*.txt') | zegrep -ic '\<exception\>'
who | grep -v localhost | wc -l
watch "ls /proc/$PYTHONPID/fd | wc -l"
find ${DIRECTORY} -type f -print | sed -e 's@^.*/@@' | grep '[aeiouyAEIOUY]' | wc -l
find . -maxdepth 1 -type f -iname '*[aeiouy]*' -printf ".\n" | wc -l
find . -type f | wc -l
find . -type f -perm 755 | wc -l
find teste2 -type f -iname "$srchfor"|wc -l
find /students -type l -print 2> /dev/null |wc -l
find ./randfiles/ -type f | wc -l
who | awk '{print $1}' | sort | uniq -c | sort -n
zcat file.gz | awk -v RS="-----------\n" '/A=2[ ,\n]/ && /dummy=2[ ,\n]/{count++} !/dummy=2[ ,\n]/{other++} END{print "Final counter value=",count, "; other=", other}'
zcat file.gz | awk -v RS="-----------\n" '/A=2[ ,\n]/ && /dummy=2[ ,\n]/{count++} END{print "Final counter value=",count}'
find . -print0 | tr -cd '\0' | wc -c
find . -type f -name "*.*" | grep -o -E "\.[^\.]+$" | grep -o -E "[[:alpha:]]{3,6}" | awk '{print tolower($0)}' | sort | uniq -c | sort -rn
sort file1 file2 | uniq -d | wc -l
find . -type f | sed -e 's/.*\.//' | sed -e 's/.*\///' | sort | uniq -c | sort -rn
comm -23 a.txt b.txt | wc -l
who | wc -l
who | sed 1d | wc -l
echo "1 1 2 2 2 5" | tr ' ' $'\n' | grep -c 2
find . -name *.py -exec wc -l {} \; | awk '{ SUM += $0} END { print SUM }'
find . -type f -name '*.gz' | xargs zcat | wc -l
find /usr/src -name "*.html" -execdir /usr/bin/grep -H "foo" {} ';' | wc -l
time find /usr/src -name "*.html" | xargs /usr/bin/grep -l "foo" | wc -l
find . -type f -name '*.txt' -exec wc -l {} \; | awk '{total += $1} END{print total}'
wc -l `find . -type f -name '*.txt' `
find . -type f -exec wc -l {} \; | awk '{ SUM += $0} END { print SUM }'
df -h -B 1M | grep dev/sda | tr -s ' '| cut -d' ' -f3 |python -c "import sys; print sum([int(num) for num in sys.stdin.readlines()])"
ls -l /boot/grub/*.mod | wc -l
cal -h | cut -c 4-17 | tail -n +3 | wc -w
find DIR_NAME -type f | wc -l
find . -maxdepth 1 -type d -print0 | xargs -0 -I {} sh -c 'echo -e $(find "{}" -printf "\n" | wc -l) "{}"' | sort -n
find . -maxdepth 1 -type d -print0 | xargs -0 -I {} sh -c 'echo $(find {} | wc -l) {}' | sort -n
find . -maxdepth 1 -type d -print0 | xargs -0 -I {} sh -c 'echo $(find {} | wc -l) \\t {}' | sort -rn | less
find -type f -exec printf '\n' \; | wc -l
find -type f -printf '\n' | wc -l
find . -type f | wc -l
find `pwd` -type f -exec ls -l {} \; | wc -l
cat $i | wc -l
sed '/^\s*$/d' $i | wc -l ## skip blank lines
ls -1 | wc -l
wc -l `find . -type f \( -name "*.cpp" -o -name "*.c" -o -name "*.h" \) -print`
find . -name '*.php' -type f | sort | xargs wc -l
find . -name '*.php' -type f | xargs wc -l | sort -nr