
Terminal - Commands using cut - 407 results
netstat -n -f inet|awk '/\.389/{print $2}'|cut -f1-4 -d.|sort -u
This is sample output - yours may be different.
ip -f inet addr |grep "global eth0$"|awk '{print $2}'|cut -d '/' -f 1
This is sample output - yours may be different.
lsof | grep 'DEL.*lib' | cut -f 1 -d ' ' | sort -u
This is sample output - yours may be different.
# lsof | grep 'DEL.*lib' | cut -f 1 -d ' ' | sort -u
crond
mpd
nginx
parcellite
X
Useful after a complete system update (without a new kernel) when you want to know, which processes need to be restarted
sudo lsof | grep 'DEL.*lib' | cut -f 1 -d ' ' | sort -u
This is sample output - yours may be different.
find . -maxdepth 1 -printf '%A@\t%p\n' | sort -r | cut -f 2,2 | head -1
This is sample output - yours may be different.
Uses UNIX time for sorting.
netstat -ntu | awk '{print $5}' | cut -d: -f1 | sort | uniq -c | sort -n
This is sample output - yours may be different.
paste <(cut -f1 log.txt) <(cut -f2- log.txt | shuf)
This is sample output - yours may be different.
dpkg --status nvidia-current | grep Version | cut -f 1 -d '-' | sed 's/[^.,0-9]//g'
This is sample output - yours may be different.
i've been writing a bash script where i needed to query the installed version number of the nvidia driver when it's not loaded. Unfortunately i have not found a easy way of doing this.
If i'm a stupid person, please enlighten me of a better way ;)
curl -s http://www.cavejohnsonhere.com/random/ | grep quote_main | cut -d \> -f 2- | fmt -w $(tput cols)
This is sample output - yours may be different.
Alright, I've been thinking. When life gives you lemons, don't make lemonade -
make life take the lemons back! Get mad! I don't want your damn lemons, what am
I supposed to do with these? Demand to see life's manager. Make life rue the
day it thought it could give Cave Johnson lemons. Do you know who I am? I'm
the man who's gonna burn your house down! With the lemons. I'm going to to
get my engineers to invent a combustible lemon that burns your house down!
There's been a similar Futurama thing around for a while, which grabs a quote from the /. headers [curl -Ism3 slashdot.org | egrep "^X-(F|B|L)" | cut -d \- -f 2- | fmt -w $(tput cols)]. Same deal, but more likely to stop working when someone forgets to pay the bill on the domain. Until then: Cave Johnson!
This is sample output - yours may be different.
pacman -Qi $(pacman -Qq)|grep 'Name\|Size'| cut -d: -f2 | paste - - | column -t | sort -nk2
This is sample output - yours may be different.
cut -f1 -d" " ~/.bash_history | sort | uniq -c | sort -nr | head -n 30
This is sample output - yours may be different.
for arq in *.png; do size=$(identify $arq | cut -f3 -d" "); [ $size == "280x190" ] || rm $arq ; done
This is sample output - yours may be different.
Removes all png files whose geometry is not 280x190 pixels
function command_not_found_handle(){ apt-get install $( apt-file search "$1" | grep bin | grep -w "$1" | head -n1 | cut -d ':' -f 1 ) && $* ; }
This is sample output - yours may be different.
juluan@juluan-desktop ~ 21:56:04 [130] $ scribus
Lecture des listes de paquets... Fait
Construction de l'arbre des d?pendances
Lecture des informations d'?tat... Fait
Les paquets suppl?mentaires suivants seront install?s?:
blt python-tk
Paquets sugg?r?s?:
blt-demo tix python-tk-dbg scribus-template scribus-doc
Les NOUVEAUX paquets suivants seront install?s?:
blt python-tk scribus
0 mis ? jour, 3 nouvellement install?s, 0 ? enlever et 3 non mis ? jour.
Il est n?cessaire de prendre 11,5Mo dans les archives.
Apr?s cette op?ration, 32,2Mo d'espace disque suppl?mentaires seront utilis?s.
Souhaitez-vous continuer [O/n]??
Work only with bash and apt-file installed.
When it found an unknow command, it will search for a file named "scribus" (in my example), in a folder named bin and then install the corresponding package.
After installation, it will run the command.
Usefull juste after reinstalling linux and missing lot of package.
egrep -ie "<*HREF=(.*?)>" index.html | cut -d "\"" -f 2 | grep ://
This is sample output - yours may be different.
you can also use cut instead of awk. less powerful but probably faster. ;)
for R in `svn log file:///path/repo | grep ^r | grep dude | cut -d' ' -f1 | cut -dr -f2`; do svn ps svn:log --revprop -r $R "`svn pg svn:log --revprop -r $R file:///path/repo; perl -e 'print ".\n";' | fromdos`" file:///path/repo; done
This is sample output - yours may be different.
property 'svn:log' set on repository revision ###
property 'svn:log' set on repository revision ###
property 'svn:log' set on repository revision ###
...
Let's supose some moron used some m$ shit to commit to a later svnsynced repo. On a svn sync all his message logs cause a svnsync: Error setting property 'log': this commands finds all its contributions and fix all his commit logs
while :; do OLD=$NEW; NEW=`cat /proc/net/dev | grep eth0 | tr -s ' ' | cut -d' ' -f "3 11"`; echo $NEW $OLD | awk '{printf("\rin: % 9.2g\t\tout: % 9.2g", ($1-$3)/1024, ($2-$4)/1024)}'; sleep 1; done
This is sample output - yours may be different.
while [ /bin/true ]; do OLD=$NEW; NEW=`cat /proc/net/dev | grep eth0 | tr -s ' ' | cut -d' ' -f "3 11"`; echo $NEW $OLD | awk '{printf("\rin: % 9.2g\t\tout: % 9.2g", ($1-$3)/1024, ($2-$4)/1024)}'; sleep 1; done
This is sample output - yours may be different.
Just a simple way without the need of additional tools. Of course, replace eth0 with your IF.
quota -q $(cat /etc/passwd|cut -d ':' -f 1)
This is sample output - yours may be different.
Disk quotas for user ****** (uid 1021):
Block limit reached on /dev/md/2
Disk quotas for user ****** (uid 1037):
Block limit reached on /dev/md/2
Check disk quota for all user
wget -U "Mozilla/5.0" -qO - "http://translate.google.com/translate_a/t?client=t&text=translation+example&sl=auto&tl=fr" | sed 's/\[\[\[\"//' | cut -d \" -f 1
This is sample output - yours may be different.
substitute "example" with desired string;
tl = target language (en, fr, de, hu, ...);
you can leave sl parameter as-is (autodetection works fine)
for i in *; do j=`echo $i | cut -d "-" -f1`; j=$j; mv $i $j; done
This is sample output - yours may be different.
Before:
TFO-RINGTONE.mp3
After:
TFO.mp3
Renames files eliminating suffix, in this case everything after "-" is cutted. Just change "-" with the character you need.
echo -n "String to MD5" | md5sum | cut -b-32
This is sample output - yours may be different.
echo -n "String to MD5" | md5sum | cut -f1 -d' '
This is sample output - yours may be different.
23e4a2a9d1c125733a2e6b797f7f54ef
Nothing special about hashing here, only the use of cut, I think, could result at fewer keystrokes.
for h in `find /proc/*/fd -ilname "/tmp/Flash*" 2>/dev/null`; do ln -s "$h" `readlink "$h" | cut -d' ' -f1`; done
This is sample output - yours may be different.
Newer versions of the flashplayer browser plugin delete the tmp flash video immediately after opening a filehandle to prevent the user from "exporting" the video by simply copying the /tmp/FlashXYZ file. This command searches such deleted flash videos and creates symbolic links to the opened filehandle with the same name as the deleted file.
This allows you to play your flash-videos (from e.g. youtube) with e.g. mplayer or copy the buffered video if you want to keep it.
nice -n 5 electricsheep -window-id `xwininfo -root|head -n 2|grep xwininfo|cut -c 22-26`
This is sample output - yours may be different.
This is a simple command which makes electricsheep render directly to your background