
Terminal - Commands using head - 194 results
awk '{print $1}' ~/.bash_history | sort | uniq -c | sort -rn | head -n 10
This is sample output - yours may be different.
rpm -qa --queryformat '%{size} %{name}-%{version}-%{release}\n' | sort -k 1,1 -rn | nl | head -16
This is sample output - yours may be different.
$ rpm -qa --queryformat '%{size} %{name}-%{version}-%{release}\n' | sort -k 1,1 -rn | nl | head -16
1 205734852 libreoffice-core-4.0.2.1-1.mga3
2 145069876 google-chrome-stable-25.0.1364.172-187217
3 126625991 metasploit-4.5-1.mga3
4 126059188 gutenprint-foomatic-5.2.9-2.mga3
5 110096290 libffmpeg-static-devel-1.1.2-1.mga3
6 98677497 java-1.7.0-openjdk-1.7.0.6-2.3.8.1.mga3
7 92598166 libgweather-3.6.2-2.mga3
8 71248176 gnome-icon-theme-3.6.2-2.mga3
9 57972204 gimp-2.8.2-3.mga3
10 57019183 evolution-3.6.3-1.mga3
11 49940798 samba-common-3.6.12-1.mga3
12 46397791 kdebase4-workspace-4.10.1-1.mga3
13 45481232 firefox-17.0.4-1.mga3
14 42666340 kernel-desktop586-3.8.0-0.rc5.1.mga3-1-1.mga3
15 42656290 kernel-desktop586-3.8.0-0.rc4.1.mga3-1-1.mga3
16 42653069 kernel-desktop586-3.8.3-2.mga3-1-1.mga3
Interesting to see which packages are larger than the kernel package.
Useful to understand which RPMs might be candidates to remove if drive space is restricted.
find . -type f -exec ls -s {} \; | sort -n -r | head -5
This is sample output - yours may be different.
tr -dc 'A-Za-z0-9!@#$%^&*' < /dev/urandom | fold -w 12 | head -n 1
This is sample output - yours may be different.
xxd -p /dev/urandom |fold -60|head -30|sed 's/\(..\)/\1 /g'
This is sample output - yours may be different.
Replaces hexdump with the more succint xxd, and the sed was unnecessarily complex.
hexdump -v -e '"%u"' </dev/urandom|fold -60|head -n 30|sed 's/\(.\{2\}\)/\1 /g'
This is sample output - yours may be different.
or
od /dev/urandom -w60 -An|sed 's/ ..../ /g'|head -n 30
(this one lacks digits 8 and 9)
finger `whoami` | awk -F: '{ print $3 }' | head -n1 | sed 's/^ //'
This is sample output - yours may be different.
48 function gbl() { git for-each-ref --sort=-committerdate --format='%(committerdate) %(authorname) %(refname)' refs/remotes/origin/|grep -e ".$@"|head -n 10; }
This is sample output - yours may be different.
gbl soheil
Tue Dec 4 18:01:19 2012 -0800 Soheil refs/remotes/origin/branch3
Mon Nov 26 10:55:55 2012 -0800 Soheil refs/remotes/origin/branch2
Thu Nov 15 11:44:52 2012 -0800 Soheil refs/remotes/origin/branch1
du . | sort -nr | awk '{split("KB MB GB TB", arr); idx=1; while ( $1 > 1024 ) { $1/=1024; idx++} printf "%10.2f",$1; print " " arr[idx] "\t" $2}' | head -25
This is sample output - yours may be different.
Lists the size in human readable form and lists the top 25 biggest directories/files
This is sample output - yours may be different.
Above command will generate a random number between 1 to 10.
genpassdeep() { cat /dev/urandom | tr -dc [:alnum:] | head -c64 | whirlpooldeep; echo; }
This is sample output - yours may be different.
3e5401a1c2eae94bc177bad5ff73a14a0af5b58c1d591a4429aef81ba5287c9655eb22c1cd4f9e06bb56a29c7cc6fa067f55aebb5fe721ab12dbf6705706d4f9
/dev/urandom relies on operator input to set the random seed. By itself, this may not contain enough random bits to produce high entropy output, especially if the system was recently restarted. Therefore, key stretching through a hash reduces the risk of using low-entropy output as a security key.
cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 18 | head -1 | python -c "import sys,crypt; stdin=sys.stdin.readline().rstrip('\n'); print stdin;print crypt.crypt(stdin)"
This is sample output - yours may be different.
NH6wAL58sKSkqBNUwK
$6$6ZpaL7bakRyXzrpM$TVS4d217.BDjKLEnYkPBtpR8CwXes5HI6U2pcSEoB3x9xUbXVxacEhvlvKFCi4tftwxOJs.Comh7u.GiPvA6X1
Generate a 18 character password from character set a-zA-Z0-9 from /dev/urandom, pipe the output to Python which prints the password on standard out and in crypt sha512 form.
genpassdeep() { cat /dev/urandom | tr -dc [:alnum:] | head -c64 | sha256deep; echo; }
This is sample output - yours may be different.
95c23fc8a5eaff35ff98ea6e947c1fa03c20f4b4d1fbc359734cd6a9b9f8b2e5
/dev/urandom relies on operator input to set the random seed. By itself, this may not contain enough random bits to produce high entropy output, especially if the system was recently restarted. Therefore, key stretching through a hash reduces the risk of using low-entropy output as a security key.
for k in `git branch -r|awk '{print $1}'`;do echo -e `git show --pretty=format:"%Cgreen%ci_%C(blue)%c r_%Cred%cn_%Creset" $k|head -n 1`$k;done|sort -r|awk -F"_" '{printf("%s %17s %-22s %s\n",$1,$2,$3,$4)}'
This is sample output - yours may be different.
tr -dc '[:graph:]' </dev/urandom | head -c30; echo
This is sample output - yours may be different.
head -c7 /dev/urandom|base64|tr -d '='
This is sample output - yours may be different.
tr -dc A-Za-z0-9_ < /dev/urandom | head -c 10 | xargs
This is sample output - yours may be different.
ps axo %mem,pid,euser,cmd | sort -nr | head -n 10
This is sample output - yours may be different.
11.5 1957 lainme firefox http://twitter.com/keyi_bu/status/256446157193093120/photo/1
3.4 1813 lainme /usr/bin/gnome-shell
3.3 1867 lainme /usr/bin/python2 /usr/bin/hotot-gtk3
2.6 5183 lainme conky
1.5 1645 root /usr/bin/Xorg :0 -br -verbose -auth /var/run/gdm/auth-for-gdm-3aSYDI/database -nolisten tcp vt8
1.0 1854 lainme pidgin
1.0 18439 lainme fcitx
0.9 1998 lainme /usr/lib/firefox/plugin-container /usr/lib/mozilla/plugins/libflashplayer.so -greomni /usr/lib/firefox/omni.ja 1957 plugin
0.4 1821 lainme nm-applet
0.4 1785 lainme /usr/lib/gnome-settings-daemon/gnome-settings-daemon
echo $(</dev/urandom tr -dc 1-6 | head -c1)
This is sample output - yours may be different.
echo $((0x$(head -c5 /dev/random|xxd -ps)%6+1))
This is sample output - yours may be different.
/dev/random is said to by cryptographically secure, and unpredictable, as it gathers data from external sources, influenced by human timing interactions with computers, to fill the entropy pool. As such, this is a quick way to do a true random fair-6 dice roll. Using this method, you could easily create passphrases with Diceware http://diceware.com.
for i in {1..5}; do echo -n $((0x$(head -c5 /dev/random|xxd -ps)%6+1)); done; echo
sudo -s du -sm /Users/* | sort -nr | head -n 10
This is sample output - yours may be different.
19234 /Users/mematron
3 /Users/Shared
1 /Users/n00b
1 /Users/fignewton
1 /Users/spam
0 /Users/akira
In OSX you would have to make sure that you "sudo -s" your way to happiness since it will give a few "Permission denied" errors before finally spitting out the results. In OSX the directory structure has to start with the "Users" Directory then it will recursively perform the operation.
Your Lord and master,
Mematron
du -sh /home/*|sort -rh|head -n 10
This is sample output - yours may be different.
55G /home/user32
19G /home/user45
6.7G /home/user89
16M /home/user02
64K /home/user57
the -h option of du and sort (on appropriate distrib) makes output "Human" readable and still sorted by "reversed size" (sort -rh)
du -sm /home/* | sort -nr | head -n 10
This is sample output - yours may be different.
find . -type f | xargs -I% bash -c 'echo -e "\033[31m%\033[0m" && [[ ! `file %` =~ .*binary.* ]] && head "%"'
This is sample output - yours may be different.
wget --no-use-server-timestamps $(curl $(curl http://wallbase.cc/random/23/eqeq/1920x1080/0/100/20 | grep 'wallpaper/' | awk -F'"' '{print $2}' | head -n1) | grep -A4 bigwall | grep img | awk -F'"' '{print $2}'); feh --bg-center $(ls -1t | head -n1)
This is sample output - yours may be different.