
Terminal - Commands using cat - 380 results
watch -n 1 cat /proc/net/wireless
This is sample output - yours may be different.
Every 1.0s: cat /proc/net/wireless Thu Jun 7 05:34:54 2012
Inter-| sta-| Quality | Discarded packets | Missed | WE
face | tus | link level noise | nwid crypt frag retry misc | beacon | 22
wlan0: 0000 70. -36. -256 0 0 0 0 0 0
Values will depend on the driver and the hardware specifics, so you need to refer to your driver documentation for proper interpretation of those values.
cat urls.txt | wget -i- -T 10 -t 3 --waitretry 1
This is sample output - yours may be different.
cat urls.txt | xargs -n1 curl -O --max-time 10 --retry 3 --retry-delay 1
This is sample output - yours may be different.
cat /var/log/nginx/access.log | grep -oe '^[0-9.]\+' | perl -ne 'system("geoiplookup $_")' | grep -v found | grep -oe ', [A-Za-z ]\+$' | sort | uniq -c | sort -n
This is sample output - yours may be different.
71 , Poland
116 , France
300 , United States
2426 , Spain
Per country GET report, based on access log. Easy to transform to unique IP
while true; do sudo cat /dev/input/mouse0|read -n1;streamer -q -o /tmp/cam.jpeg -s 640x480 > /dev/null 2>&1; sleep 10;done
This is sample output - yours may be different.
This takes a webcam picture every everytime the mouse is moved (waits 10 seconds between checking for movement) and stores the picture wherever you want it.
Ideas:
Use in conjunction with a dropbox type application to see who is using your computer
Use /dev/input/mice if /dev/input/mouse* doesn't work
Use the bones of this to make a simple screensaver
while true; do iptables -nvL > /tmp/now; diff -U0 /tmp/prev /tmp/now > /tmp/diff; clear; cat /tmp/diff; mv /tmp/now /tmp/prev; slee p 1; done
This is sample output - yours may be different.
@@ -28 +28 @@
- 339 27684 zone_lan_forward all -- br-lan * 0.0.0.0/0 0.0.0.0/0
+ 340 27768 zone_lan_forward all -- br-lan * 0.0.0.0/0 0.0.0.0/0
this alternative shows the differences as they occur so that they are made plain
yes "" | cat -n | awk '{print "S=`echo All work and no play makes Jack a dull boy. | cut -c",($1 - 1) % 43 + 1 "`;echo -n \"$S\";seq 500000 > /dev/null"}'| bash
This is sample output - yours may be different.
All work and no play makes Jack a dull boy.All work and no play makes Jack a dull boy.All work and no play makes Jack a dull boy.All work and no play makes Jack a dull boy.All awork and no play makes Jack a dull boy.All work and no play makes Jack a dull boy.All work and no play makes Jack a dull boy.All work and no play makes Jack a dull boy.All work and no play makes Jack a dull boy.All work and no play makes Jack a dull boy.All work and no play makes Jack a dull boy.All work and no play makes Jack a dull boy.All work and no play makes Jack a dull boy.All work and no play makes Jack a dull boy.All work and no play makes Jack a dull boy.All work and no play makes Jack a dull boy.All work and no play makes Jack a dull boy.All work and no play makes Jack a dull boy.All work and no play makes Jack a dull boy.All work and no play makes Jack a dull boy.All work and no play makes Jack a dull boy.All work and no play makes Jack a dull boy.All work and no play makes Jack a dull boy.All work and no play makes Jack a dull boy.All work and no play makes Jack a dull boy.All work and no play makes Jack a dull boy.All work and no play makes Jack a dull boy.All work and no play makes Jack a dull boy.
This is sample output - yours may be different.
cat z.log | perl -ne 'BEGIN{ print "DATE;RATE\n"; } /\[(\d.*)\]/ && print $1; /CURRENT RATE: +(\S+) msg.*/ && print ";" .$1 . "\n"; '
This is sample output - yours may be different.
from file:
@SG: --------------------------------------------------------------------
@SG: [pmphost6] [2012-04-02 21:23:59.268]
@SG: --------------------------------------------------------------------
@SG: [SAFEGUARD STATUS]
@SG: > RATE THRESHOLD: 30 msg/sec
@SG: > TIME TO LIVE: 1800 sec
@SG: > CURRENT RATE: 43.017 msg/sec 2581.000 msg/min
@SG: > ELAPSED TIME: 60 sec
@SG: > TIME COUNT: 0 sec
@SG: > TIME TO LIVE COUNT: 360 sec
@SG: > SAFEGUARD STATUS: ON
@SG: --------------------------------------------------------------------
@SG: --------------------------------------------------------------------
@SG: [pmphost6] [2012-04-02 21:24:59.268]
@SG: --------------------------------------------------------------------
@SG: [SAFEGUARD STATUS]
@SG: > RATE THRESHOLD: 30 msg/sec
@SG: > TIME TO LIVE: 1800 sec
@SG: > CURRENT RATE: 42.417 msg/sec 2545.000 msg/min
@SG: > ELAPSED TIME: 60 sec
@SG: > TIME COUNT: 0 sec
@SG: > TIME TO LIVE COUNT: 420 sec
@SG: > SAFEGUARD STATUS: ON
@SG: --------------------------------------------------------------------
@SG: --------------------------------------------------------------------
@SG: [pmphost6] [2012-04-02 21:25:59.269]
@SG: --------------------------------------------------------------------
@SG: [SAFEGUARD STATUS]
@SG: > RATE THRESHOLD: 30 msg/sec
@SG: > TIME TO LIVE: 1800 sec
@SG: > CURRENT RATE: 42.833 msg/sec 2570.000 msg/min
@SG: > ELAPSED TIME: 60 sec
@SG: > TIME COUNT: 0 sec
@SG: > TIME TO LIVE COUNT: 480 sec
@SG: > SAFEGUARD STATUS: ON
@SG: --------------------------------------------------------------------
estract csv
DATE;RATE
2012-04-02 21:23:59.268;43.017
2012-04-02 21:24:59.268;42.417
2012-04-02 21:25:59.269;42.833
extract data in multiline blocks of data with perl pattern matching loop
pdftk A=1.pdf B=2.pdf C=3.pdf cat C A output CA.pdf
This is sample output - yours may be different.
pdftk 1.pdf 2.pdf cat output 12.pdf
This is sample output - yours may be different.
This is sample output - yours may be different.
Write script or commands in notepad/Editplus/MS word etc, copy the contents, type the above command and click on enter now, paste by right click-ing the mouse. Entire contents in the clip-board gets pasted now again click on Enter to go to new line/next line. Press Ctrl+D to close/save the file. Not always required to vi to create a new file.
wget -q ip.nu && cat index.html
This is sample output - yours may be different.
find . -type f -name "*.*" -exec cat {} > totalLines 2> /dev/null \; && wc -l totalLines && rm totalLines
This is sample output - yours may be different.
ps h --ppid $(cat /var/run/apache2.pid) | awk '{print"-p " $1}' | xargs sudo strace
This is sample output - yours may be different.
Like the original version except it does not include the parent apache process or the grep process and adds "sudo" so it can be run by user.
for a in $(cat sample.txt); do echo "${#a} $a";done|sort -n
This is sample output - yours may be different.
for a in $(cat sample.txt); do echo "$(wc -m<<<$a) $a";done|sort -n
This is sample output - yours may be different.
optionally you can add
|cut -d' ' -f2|uniq
to the end of the command line.
x=1024; y=32768; cat <(echo -e "P5\n$x $y\n255\n") <(dd if=/dev/sda1 bs=$x count=$y) > sda1.pgm
This is sample output - yours may be different.
Don't share this output with the Internet. It's your raw naked data.
cat z.log | cut -d ':' -f1,2 | uniq -c
This is sample output - yours may be different.
6 2012-02-24 11:26
10 2012-02-24 11:27
8 2012-02-24 11:28
7 2012-02-24 11:29
7 2012-02-24 11:30
8 2012-02-24 11:31
7 2012-02-24 11:32
7 2012-02-24 11:33
9 2012-02-24 11:34
9 2012-02-24 11:35
8 2012-02-24 11:36
depends on date format locale ...
cat z.log | cut -d ':' -f1 | sort | uniq | xargs -l1 -iFF echo 'echo FF $(cat z.log | grep -e "^FF" | grep -e Timeout | wc -l )' | bash
This is sample output - yours may be different.
2012-02-24 08 28
2012-02-24 09 122
2012-02-24 10 110
2012-02-24 11 95
cat z.log | grep Timeout | cut -d ':' -f1 | sort | uniq -c
This is sample output - yours may be different.
28 2012-02-24 08
122 2012-02-24 09
110 2012-02-24 10
95 2012-02-24 11
useful to count events in logs
This is sample output - yours may be different.
#(see sample) $ cat x | perl -pe 'BEGIN{ print "TIME;...\n"; } s!(\S+) - (\S+) - \[(\d\d)/(\S\S\S)/(\S+):(\d\d):(\d\d:\d\d) \S+\] "(\S+) (.*/)(\S+)(?:\.([^?]*)(\?\S*)?) HTTP/\S+" (\d+) (\S+)!$3-$4-$5 $6:$7;$6;$2;$1;$8;$13;1;$14;$11;$10;$9;$12;!' > x.csv
This is sample output - yours may be different.
cat access.log | perl -pe 'BEGIN{ print "TIME;HOUR;USER;HOST;METHOD;STATUS;REQ;COST;TYPE;PAGE;PATH;QUERY\n"; } s!(\S+) - (\S+) - \[(\d\d)/(\S\S\S)/(\S+):(\d\d):(\d\d:\d\d) \S+\] "(\S+) (.*/)(\S+)(?:\.([^?]*)(\?\S*)?) HTTP/\S+" (\d+) (\S+)!$3-$4-$5 $6:$7;$6;$2;$1;$8;$13;1;$14;$11;$10;$9;$12;!' > access.csv
$ head access.log
93.57.16.194 - x2 - [07/Feb/2012:12:56:06 -0200] "GET /pmp/faces/jspx/MainWindow/Header.jspx HTTP/1.1" 200 0,010
93.57.16.194 - x2 - [07/Feb/2012:12:56:06 -0200] "GET /pmp/faces/jspx/MainWindow/Header/SearchDevice.jspx HTTP/1.1" 200 0,198
93.57.16.194 - x2 - [07/Feb/2012:12:56:06 -0200] "GET /pmp/faces/jspx/MainWindow/Panel.jspx HTTP/1.1" 200 0,012
$ head access.csv
TIME;HOUR;USER;HOST;METHOD;STATUS;REQ;COST;TYPE;PAGE;PATH;QUERY
07-Feb-2012 12:56:06;12;x2;93.57.16.194;GET;200;1;0,010;jspx;Header;/pmp/faces/jspx/MainWindow/;;
07-Feb-2012 12:56:06;12;x2;93.57.16.194;GET;200;1;0,198;jspx;SearchDevice;/pmp/faces/jspx/MainWindow/Header/;;
07-Feb-2012 12:56:06;12;x2;93.57.16.194;GET;200;1;0,012;jspx;Panel;/pmp/faces/jspx/MainWindow/;;
07-Feb-2012 12:56:06;12;x2;93.57.16.194;GET;200;1;0,024;jspx;WorkArea;/pmp/faces/jspx/MainWindow/Panel/;;
- excel date compatible with a separate hour field
- added a fixed 1 for easier request counter aggregation
- split URL in directory, filename, fileext, query
- used with tomcat valve with response bytes replaced by elapsed time
x="/tmp/auth.html";sudo cat /var/log/auth.log | logtool -o HTML >$x;xdg-open $x;rm $x
This is sample output - yours may be different.
similar to previous except this exports to a temporary file, opens that file with your default web browser, then deletes it.
PID=`ps | grep process_name | grep -v grep | head -n 1 | awk '{print $1}'`; cat /proc/$PID/smaps | grep heap -A 2
This is sample output - yours may be different.
00014000-00174000 rwxp 00000000 00:00 0 [heap]
Size: 1408 kB
Rss: 1292 kB