
Terminal - Commands using head - 256 results
cat "log" | grep "text to grep" | awk '{print $1}' | sort -n | uniq -c | sort -rn | head -n 100
This is sample output - yours may be different.
git verify-pack -v .git/objects/pack/pack-*.idx | grep blob | sort -k3nr | head | while read s x b x; do git rev-list --all --objects | grep $s | awk '{print "'"$b"'",$0;}'; done
This is sample output - yours may be different.
mco ping | head -n -4 | awk '{print $1}' | sort
This is sample output - yours may be different.
du -a | sort -nr | head -10
This is sample output - yours may be different.
psql -h <SERVER NAME HERE> -t -c 'SELECT version();' |head -1
This is sample output - yours may be different.
PostgreSQL 9.2.5 on x86_64-unknown-linux-gnu, compiled by gcc (GCC) 4.7.2 20121109 (Red Hat 4.7.2-8), 64-bit
-t, --tuples-only print rows only
history |awk '{print $3}' |awk 'BEGIN {FS="|"} {print $1}'|sort|uniq -c |sort -rn |head -10
This is sample output - yours may be different.
142 cd
100 ll
98 tail
76 vi
70 service
53 ps
52 dstat
44 cat
41 stat_peek.sh
30 ifconfig
google() { Q="
[email protected]"; GOOG_URL='https://www.google.com/search?q='; AGENT="Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/33.0.1750.152 Safari/537.36" elinks -dump "${GOOG_URL}${Q//\ /+}" | grep "\*" | head -1 }
This is sample output - yours may be different.
du -hsx * | sort -rh | head -10
This is sample output - yours may be different.
< /dev/urandom tr -dc _A-Z-a-z-0-9 | head -c${1:-16};echo;
This is sample output - yours may be different.
This snippet will produce an alpha-numeric 16 character password
echo $(sudo lshw -businfo | grep -B 1 -m 1 $(df "/path/to/file" | tail -1 | awk '{print $1}' | cut -c 6-8) | head -n 1 | awk '{print $1}' | cut -c 5- | tr ":" "-") | sudo tee /sys/bus/usb/drivers/usb/unbind
This is sample output - yours may be different.
[email protected]:~$ echo $(sudo lshw -businfo | grep -B 1 -m 1 $(df "/media/0AF2108209E826EE/test" | tail -1 | awk '{print $1}' | cut -c 6-8) | head -n 1 | awk '{print $1}' | cut -c 5- | tr ":" "-") | sudo tee /sys/bus/usb/drivers/usb/unbind
2-1.3
You have an external USB drive or key.
Apply this command (using the file path of anything on your device) and it will simulate the unplug of this device.
If you just want the port, just type :
echo $(sudo lshw -businfo | grep -B 1 -m 1 $(df "/path/to/file" | tail -1 | awk '{print $1}' | cut -c 6-8) | head -n 1 | awk '{print $1}' | cut -c 5- | tr ":" "-")
This is sample output - yours may be different.
$ A=$(head -3)
Line1
line2
line3
$ echo "$A"
Line1
line2
line3
Reads n lines from stdin and puts the contents in a variable. Yes, I know the read command and its options, but find this logical even for one line.
function brainwallet_exponent () { printf %s "$1"|sha256sum|head -c 64; }
This is sample output - yours may be different.
> brainwallet_exponent "correct horse battery staple"
> c4bbcb1fbec99d65bf59d85c8cb62ee2db963f0fe106f483d9afa73bd4e39a8a
> echo -ne "correct horse battery staple" | sha256sum
> c4bbcb1fbec99d65bf59d85c8cb62ee2db963f0fe106f483d9afa73bd4e39a8a -
A bitcoin "brainwallet" is a secret passphrase you carry in your brain.
The Bitcoin Brainwallet Exponent Calculator is one of three functions needed to calculate the bitcoin PRIVATE key. Roughly, the formula is exponent = sha256 (passphrase)
Note that this is a bash function, which means you have to type its name to invoke it.
You can check the accuracy of the results here http://brainwallet.org
cat /dev/urandom | env LC_CTYPE=C tr -dc a-zA-Z0-9 | head -c 16; echo
This is sample output - yours may be different.
Feel free to put this in your ~/.profile:
random(){ cat /dev/urandom | env LC_CTYPE=C tr -dc $1 | head -c $2; echo; }
Then use it to generate passwords:
random [:alnum:] 16
Or DNA sequences:
random ACGT 256
wget -q -O- http://bitinfocharts.com/markets/btc-e/btc-usd.html |grep -o -P 'lastTrade">([0-9]{1,})(.){0,1}[0-9]{0,}' |grep -o -P '(\d)+(\.){0,1}(\d)*' |head -n 1
This is sample output - yours may be different.
sysctl -a | grep boottime | head -n 1
This is sample output - yours may be different.
kern.boottime = Wed Jan 22 00:41:33 2014
phpunit --log-json php://stdout | awk '$NF ~ '/,/' && $1 ~ /"(test|time)"/' | cut -d: -f2- | sed "N;s/\n/--/" | sed "s/,//"| awk 'BEGIN{FS="--"}; {print $2 $1}' | sort -r | head -n 5
This is sample output - yours may be different.
curl -s -k https://www.kernel.org/feeds/kdist.xml | sed -n -e '
[email protected]*
<guid>\(.*\)</guid>.*@\
[email protected]' | grep 'stable' | head -1 | awk -F , '{print $3}'
This is sample output - yours may be different.
Fetches latest stable release version from first entry between tags
wget "us.download.nvidia.com$(wget -qO- "$(wget -qO- "nvidia.com/Download/processFind.aspx?psid=95&pfid=695&osid=19&lid=1&lang=en-us"|awk '/driverResults.aspx/ {print $4}'|cut -d "'" -f2|head -n 1)"|awk '/url=/ {print $2}'|cut -d '=' -f3|cut -d '&' -f1)"
This is sample output - yours may be different.
HTTP request sent, awaiting response... 200 OK
Length: 211183464 (201M) [application/octet-stream]
Saving to: ?331.82-desktop-win8-win7-winvista-64bit-english-whql.exe?
Download latest NVIDIA Geforce x64 Windows7-8 driver from Nvidia's website. Pulls the latest download version (which includes beta). This is the "English" version. The following command includes a 'sed' line to replace "english" with "international" if needed. You can also replace the starting subdomain with "eu." "uk." and others. Enjoy this one liner! 1 character under the max :)
wget "us.download.nvidia.com$(wget -qO- "$(wget -qO- "nvidia.com/Download/processFind.aspx?psid=95&pfid=695&osid=19&lid=1&lang=en-us" | awk '/driverResults.aspx/ {print $4}' | cut -d "'" -f2 | head -n 1)" | awk '/url=/ {print $2}' | sed -e "s/english/international/" | cut -d '=' -f3 | cut -d '&' -f1)"
base64 /dev/urandom | head -c 33554432 | split -b 8192 -da 4 - dummy.
This is sample output - yours may be different.
Avoiding a for loop brought this time down to less than 3 seconds on my old machine. And just to be clear, 33554432 = 8192 * 4086.
for i in {1..4096}; do base64 /dev/urandom | head -c 8192 > dummy$i.rnd ; done
This is sample output - yours may be different.
Using the 'time' command, running this with 'tr' took 28 seconds (and change) each time but using base64 only took 8 seconds (and change). If the file doesn't have to be viewable, pulling straight from urandom with head only took 6 seconds (and change)
for i in `seq 1 4096`; do tr -dc A-Za-z0-9 </dev/urandom | head -c8192 > dummy$i.rnd; done
This is sample output - yours may be different.
echo $(< /dev/urandom tr -dc _A-Z-a-z-0-9 | head -c10)
This is sample output - yours may be different.
Uses urandom and tr to generate a random password. Change the value of head -c## for the lenght of the password.
wget --no-check-certificate https://www.kernel.org/$(wget -qO- --no-check-certificate https://www.kernel.org | grep tar | head -n1 | cut -d\" -f2)
This is sample output - yours may be different.
--2013-11-07 14:39:06-- https://www.kernel.org/pub/linux/kernel/v3.x/linux-3.12.tar.xz
Resolvendo www.kernel.org (www.kernel.org)... 149.20.4.69, 198.145.20.140
Conectando-se a www.kernel.org (www.kernel.org)|149.20.4.69|:443... conectado.
A requisi??o HTTP foi enviada, aguardando resposta... 200 OK
Tamanho: 76384600 (73M) [application/x-xz]
Salvando em: ?linux-3.12.tar.xz?
46% [=================> ] 35.282.696 111KB/s TED 3m 14s
Access www.kernel.org and download the last stable linux kernel release.
find . -name '*pdf*' -print0 | xargs -0 ls -lt | head -20
This is sample output - yours may be different.
fuat$ find . -name '*pdf*' -print0 | xargs -0 ls -lt | head -20
[email protected] 1 fuat staff 2416379 Sep 30 22:36 ./Software Engineering/Book/debug_it.pdf
[email protected] 1 fuat staff 852248 Sep 30 00:14 ./_READING/NLPWithPython.pdf alias
[email protected] 1 fuat staff 852292 Sep 30 00:12 ./_READING/HeadFirstNetworking.pdf alias
[email protected] 1 fuat staff 16214242 Sep 24 16:20 ./Algorithms/Algorithms_for_Interviews.pdf
[email protected] 1 fuat staff 4349195 Sep 24 13:46 ./Java/General/JavaProgrammingFundamentals.pdf
[email protected] 1 fuat staff 11168880 Sep 24 13:34 ./Distributed System/1617290521_HBas.pdf
[email protected] 1 fuat staff 5920000 Sep 24 13:32 ./Stream Processing/Storm.pdf
[email protected] 1 fuat staff 13571530 Sep 24 13:24 ./Database/InMemoryDataManagement.pdf
[email protected] 1 fuat staff 12625760 Sep 24 13:13 ./Network/ComputerNetworkingTopDown.pdf
[email protected] 1 fuat staff 3290769 Sep 24 13:01 ./Algorithms/GraphAlgorithms.pdf
[email protected] 1 fuat staff 24854307 Sep 24 11:18 ./Java/OSGi/EnterpriseOSGiINAction.pdf
[email protected] 1 fuat staff 39195922 Sep 24 11:16 ./Operating System/OSXMountainLion.pdf
[email protected] 1 fuat staff 5593725 Sep 24 11:11 ./Software Engineering/Book/EffectiveUnitTesting.pdf
[email protected] 1 fuat staff 9917832 Sep 24 11:06 ./Stream Processing/Twisted.pdf
[email protected] 1 fuat staff 11022359 Sep 24 11:05 ./Message Queues/ZeroMQ.pdf
[email protected] 1 fuat staff 3155642 Sep 24 11:02 ./Source Control/Git35-672.pdf
[email protected] 1 fuat staff 4718051 Sep 24 10:59 ./Data Mining/RobustDataMining.pdf
[email protected] 1 fuat staff 38314681 Sep 24 10:55 ./Ruby/Rails515775.pdf
[email protected] 1 fuat staff 37028497 Sep 24 10:53 ./User Interface/11445Interactivity2nd.pdf
[email protected] 1 fuat staff 6139406 Sep 24 10:52 ./User Interface/UI_154783.pdf
Sorts by latest modified files by looking to current directory and all subdirectories
du -ah | sort -hr | head -n50 | cat -n
This is sample output - yours may be different.
1 19M .
2 11M ./docs
3 4.1M ./ydownloads/youtube-dl.exe
4 4.1M ./ydownloads
5 3.1M ./docs/Learn-Linux-and-get-certified_20120711.pdf
6 1.7M ./.vim
7 1.4M ./docs/building-NAS-Server.doc
8 1.4M ./.vim/colors
9 1.3M ./seznami
10 772K ./docs/port-numbers.txt
11 748K ./docs/building-NAS-Server.pdf
12 610K ./bin