All commands (12,996)

  • bash-3.2$ find /logs -ls -xdev | sort -nrk 7 | head -10 1761905 205380 -rwxrwxr-x 1 wsadmin logadmin 210095353 Jul 22 01:33 /logs/intlpymt/Trace.log 652689 187360 -rwxrwxr-x 1 wsadmin logadmin 191663182 Jul 21 23:00 /logs/websphere/wsfpp1lppwa1213omsecureServer/SystemOut_13.07.21_23.00.12.log 2380449 186536 -rwxrwxr-x 1 wsadmin logadmin 190819939 Jul 16 14:03 /logs/omset/traceIntl.log.201307161403.lppwa1213.gz 2119524 183888 -rwxrwxr-x 1 wsadmin logadmin 188110111 Jul 22 01:33 /logs/intlpymt/intlpymtria/Trace.log 652816 160332 -rwxrwxr-x 1 wsadmin logadmin 164011871 Aug 14 2012 /logs/websphere/wsfpp1lppwa1213omsecureServer/SystemOut.log_08142012.gzip 653312 128916 -rwxrwxr-x 1 wsadmin logadmin 131873943 Jul 18 10:49 /logs/websphere/heapdump.20130718.104150.27592.0006.phd.201307181406.lppwa1213.gz 653320 128916 -rwxrwxr-x 1 wsadmin logadmin 131873735 Jul 18 10:40 /logs/websphere/heapdump.20130718.104012.27592.0002.phd.201307181406.lppwa1213.gz 653309 128912 -rwxrwxr-x 1 wsadmin logadmin 131867602 Jul 18 10:46 /logs/websphere/heapdump.20130718.104008.27592.0001.phd.201307181405.lppwa1213.gz 653323 128872 -rwxrwxr-x 1 wsadmin logadmin 131828157 Jul 18 10:41 /logs/websphere/heapdump.20130718.104109.27592.0004.phd.201307181407.lppwa1213.gz 652783 120288 -rwxrwxr-x 1 wsadmin logadmin 123047750 Aug 13 2012 /logs/websphere/wsfpp1lppwa1213omsecureServer/SystemOut.log_0813.2012.gzip bash-3.2$ Show Sample Output


    0
    find /logs -ls -xdev | sort -nrk 7 | head -10
    vidya99343 · 2013-07-22 08:36:03 0
  • Display a list of local shell scripts soft-linked to /usr/local/bin Put local shell scripts to local ~/bin/ directory and soft-link them to /usr/local/bin/ which is in the $PATH variable to run them from anywhere. Show Sample Output


    0
    for AAA in $(find /usr/local/bin -type l); do ls -gG "${AAA}"; done
    rgregor · 2013-10-01 10:49:12 0
  • When bootstrapping or repairing a node this is a simple way to keep tabs on what a node is actively doing. Show Sample Output


    0
    watch -d 'echo -e "Remaining: `(nodetool netstats | grep " 0%" | wc -l)` \nCurrent: `(nodetool netstats | grep "%" | grep -v " 0%")`"'
    mrwulf · 2014-01-01 16:59:01 0

  • 0
    find . |xargs grep '<html\|<body\|<table' |sed '/~/d;s/:.*//' |sed 's/.*/mv & &.html/' |uniq >run.sh; sh run.sh
    mobluse · 2014-07-09 19:20:40 0
  • to set the current time manually Show Sample Output


    0
    timedatectl set-time 'YYYY-MM-DD HH:MM:SS' && hwclock --systohc
    aysadk · 2017-02-19 01:15:38 0
  • There are two different ways that I would have done this. With the command posted or if you prefer xargs: pip freeze --local | awk -F "=" '{$1}' | xargs pip install -U # But this is a moot point considering the above replaces xargs


    0
    pip freeze --local | awk -F "=" '{print "pip install -U "$1}' | sh
    AdvancedThreat · 2017-11-26 16:11:18 0
  • This will drop you into vim to edit all files that contain your grep string.


    0
    grep -ir 'foo' * | awk '{print $1}' | sed -e 's/://' | xargs vim
    elubow · 2009-09-03 15:12:27 0
  • this is funny ;) alias sl="ls" ... is the useful solution, but that's boring ;P and You won't learn to think before You type !


    0
    apt-get install sl; sl
    alvinx · 2009-09-21 13:55:24 0

  • 0
    firefox http://en.wikipedia.org/wiki/$(date +'%b_%d')
    dbh · 2011-05-08 03:36:11 0
  • LC_ALL=C is here to always grep on "differ" whatever your language env. xargs -n 2 to run gvim -d with 2 arguments gvim --nofork to use only one instance of gvim


    0
    LC_ALL=C diff -q dir1 dir2 | grep differ | awk '{ print $2, $4 }' | xargs -n 2 gvim --nofork -d
    brock · 2011-09-06 11:50:33 0
  • Change file time stamp


    0
    touch -t [[CC]AA]MMJJhhmm[.ss]
    YouM · 2011-10-11 23:35:52 0
  • this one works on user crontab


    0
    gzip -c ~/.bash_history > ~/.backup/history-save-$(date +\%d-\%m-\%y-\%T).gz
    tictacbum · 2013-01-11 17:31:07 0

  • 0
    su - wsadmin
    vidya99343 · 2013-07-22 08:36:48 0

  • 0
    clear; tput cup 8 8; for i in $(seq 1 10); do echo -n "$((11-$i)) ";sleep 1; done; tput cup 10 8; echo -e "DONE\n\n"
    rgregor · 2013-10-01 11:21:25 0
  • Repair each node in sequence. Make sure you change the IP replacements to match your environment


    0
    for s in 172.16.{1,2}2.9{0,1,2}; do echo "Repairing node $s..."; nodetool -h $s repair -pr; done
    mrwulf · 2014-01-01 17:05:40 0

  • 0
    /^........ \([0-7a-f][0-9a-f] *\)*[89a-f][0-9a-f]
    vintage · 2014-07-10 01:45:38 0

  • 0
    rm ./--this_file.txt
    martisj · 2016-08-04 16:28:31 0

  • 0
    cat /proc/meminfo | awk -v"RS=~" '{print "Total:", $2/1024000, "GiB","|","In Use:",100-$5/$2*100"%"}'
    Moshem · 2017-02-20 12:20:01 0
  • You are piping too many commands


    0
    rsync --stats --dry-run -ax /home/myself/ /tmp
    AdvancedThreat · 2017-11-26 16:15:06 0
  • useful if you want to get the source code of a in memory function Show Sample Output


    0
    source_print(){ set | sed -n "/^$1/,/^}$/p"; };
    glaudiston · 2010-11-24 15:55:34 0
  • Use ps instead of top. But do not use BSD options at all, they are confusing. Use "s=" or "state=" to show consice process statuses. Show Sample Output


    0
    ps -eo stat= | sort | uniq -c | sort -n
    fossilet · 2011-03-25 13:01:42 0
  • ffmpeg [source specification if needed] -i $src -an -vcodec libx264 -coder 0 -threads 0 -flags +loop -cmp +chroma -partitions +parti4x4+partp8x8+partb8x8 -subq 5 -trellis 1 -refs 1 -coder 0 -me_range 16 -keyint_min 25 -sc_threshold 40 -i_qfactor 0.71 -rc_eq 'blurCplx^(1-qComp)' -qcomp 0.6 -qmin 10 -qmax 51 -level 13 -g 15 -crf 25 -s 320x224 -aspect 16:9 -r 15 -b 186000 -vb 186000 -minrate 176700 -maxrate 195300 -bt 9300 -bufsize 262500 -muxrate 195300 -vglobal 1 -f rtp rtp://$dstIP:$dstVideoPort1 -vn -acodec libfaac -async 2 -flags +global_header -ac 1 -ar 44100 -ab 64000 -f rtp rtp://$dstIP:$dstAudioPort1 -newaudio -an -vcodec libx264 -coder 0 -threads 0 -flags +loop -cmp +chroma -partitions +parti4x4+partp8x8+partb8x8 -subq 5 -trellis 1 -refs 1 -coder 0 -me_range 16 -keyint_min 25 -sc_threshold 40 -i_qfactor 0.71 -rc_eq 'blurCplx^(1-qComp)' -qcomp 0.6 -qmin 10 -qmax 51 -level 13 -g 20 -crf 25 -s 320x224 -aspect 16:9 -r 20 -b 286000 -vb 286000 -minrate 271700 -maxrate 300300 -bt 14300 -bufsize 367500 -muxrate 300300 -vglobal 1 -f rtp rtp://$dstIP:$dstVideoPort2 -newvideo -vn -acodec libfaac -async 2 -flags +global_header -ac 1 -ar 44100 -ab 64000 -f rtp rtp://$dstIP:$dstAudioPort2 -newaudio -an -vcodec libx264 -coder 0 -threads 0 -flags +loop -cmp +chroma -partitions +parti4x4+partp8x8+partb8x8 -subq 5 -trellis 1 -refs 1 -coder 0 -me_range 16 -keyint_min 25 -sc_threshold 40 -i_qfactor 0.71 -rc_eq 'blurCplx^(1-qComp)' -qcomp 0.6 -qmin 10 -qmax 51 -level 30 -g 25 -crf 25 -s 480x336 -aspect 16:9 -r 25 -b 386000 -vb 386000 -minrate 366700 -maxrate 405300 -bt 19300 -bufsize 472500 -muxrate 405300 -vglobal 1 -f rtp rtp://$dstIP:$dstVideoPort3 -newvideo -vn -acodec libfaac -async 2 -flags +global_header -ac 2 -ar 44100 -ab 64000 -f rtp rtp://$dstIP:$dstAudioPort3 -newaudio -an -vcodec libx264 -coder 0 -threads 0 -flags +loop -cmp +chroma -partitions +parti4x4+partp8x8+partb8x8 -subq 5 -trellis 1 -refs 1 -coder 0 -me_range 16 -keyint_min 25 -sc_threshold 40 -i_qfactor 0.71 -rc_eq 'blurCplx^(1-qComp)' -qcomp 0.6 -qmin 10 -qmax 51 -level 30 -g 25 -crf 25 -s 480x336 -aspect 16:9 -r 25 -b 686000 -vb 686000 -minrate 651700 -maxrate 720300 -bt 34300 -bufsize 787500 -muxrate 720300 -vglobal 1 -f rtp rtp://$dstIP:$dstVideoPort4 -newvideo -vn -acodec libfaac -async 2 -flags +global_header -ac 2 -ar 44100 -ab 64000 -f rtp rtp://$dstIP:$dstAudioPort4 -newaudio Show Sample Output


    0
    ffmpeg -i $src -an -vcodec [...details in description...] rtp rtp://$dstIP:$dstAudioPort4 -newaudio
    theflyingbear · 2011-07-29 15:36:37 0

  • 0
    sudo tcpdump -n -i eth0 -w data.pcap -v tcp or udp and 'not host 192.168.1.2'
    anhpht · 2011-10-12 00:20:52 0
  • The other 2 commands that are listed will also kill the egrep process and any libexec processes because the .exe isn't escaped so it is really using . meaning anything containing exe. The command i posted escapes the (dot) in .exe and then filters the actual egrep process so that it doesn't get killed before the other processes being killed. Also added the -9 switch for kill to send sigterm to the processes, in case people are wondering why processes aren't getting killed after running just kill . This should work better for people :)


    0
    wineserver -k; killall -9 wine wineserver; for i in `ps ax|egrep "*\.exe"|grep -v 'egrep'|awk '{print $1 }'`;do kill -9 $i;done
    godmachine81 · 2011-12-30 01:38:15 0
  • you could redirect output to /dev/NULL


    0
    lsof -i tcp:22 | grep 192.168.10.10 | awk "{print $2}" |xargs kill
    gda2004 · 2012-05-10 10:45:22 0
  • ‹ First  < 403 404 405 406 407 >  Last ›

What's this?

commandlinefu.com is the place to record those command-line gems that you return to again and again. That way others can gain from your CLI wisdom and you from theirs too. All commands can be commented on, discussed and voted up or down.

Share Your Commands



Stay in the loop…

Follow the Tweets.

Every new command is wrapped in a tweet and posted to Twitter. Following the stream is a great way of staying abreast of the latest commands. For the more discerning, there are Twitter accounts for commands that get a minimum of 3 and 10 votes - that way only the great commands get tweeted.

» http://twitter.com/commandlinefu
» http://twitter.com/commandlinefu3
» http://twitter.com/commandlinefu10

Subscribe to the feeds.

Use your favourite RSS aggregator to stay in touch with the latest commands. There are feeds mirroring the 3 Twitter streams as well as for virtually every other subset (users, tags, functions,…):

Subscribe to the feed for: