Command Line Magic

@climagic

Cool Unix/Linux Command Line tricks you can use in 140 characters or less. Here mostly to inspire all to try more. Read docs first, run later.

BASHLAND
Joined November 2009

Tweets

You blocked @climagic

Are you sure you want to view these Tweets? Viewing Tweets won't unblock @climagic

  1. Pinned Tweet
    3 Oct 2017

    "Step 1: Open the Terminal." :D

  2. Retweeted
    Jan 5

    What process is listening on port 1521? $ lsof -P -i :1521 | grep LISTEN tnslsnr 11348 oracle 9u IPv4 158729213 0t0 TCP *:1521 (LISTEN)

  3. Jan 1

    2018 resolution: make "bashism" not profanity.

  4. 29 Dec 2017

    What new commands did you learn about in 2017? It's ok if ls or cd are some of them. Welcome.

  5. 28 Dec 2017

    Sorry, it gets rather overloaded with so many followers. Not much I can do about that right now. Try coming back later.

    Show this thread
  6. 28 Dec 2017

    I set up real lights that YOU can control from the command line and see in real time. Please be gentle. ;-)

    Show this thread
  7. 28 Dec 2017

    LANG=C sort # Setting the LANG=C variable will often fix unexpected problems with sort ignoring symbol characters like +, - and * or just general weirdness. For instance, I just ran into problems because my LANG was set to en_US.UTF-8.

  8. 22 Dec 2017

    I love this! The terminal doesn't get old, it evolves.

  9. 21 Dec 2017

    PS1="# $PS1" # Make your prompt a bit safer with a # prefix so that if you accidentally copy & paste it, at least some lines won't execute.

  10. 20 Dec 2017

    ps auxwf | grep -B8 "[g]zip" # Show the process in a tree format, search for gzip and show 8 lines of pre-match context to see its "family". The [] around the g in gzip is a regex trick to avoid matching the grep process itself.

  11. 15 Dec 2017

    A sample of what the command above does.

    Show this thread
  12. 15 Dec 2017

    clear ; while : ; do ack --bar | lolcat --force ; sleep 0.05 ; printf "\e[0;0H" ; done

    Show this thread
  13. 15 Dec 2017
  14. 15 Dec 2017

    rm * happens

  15. 15 Dec 2017

    When you realize the typo you just made involves keys on opposite sides of the keyboard (break vs. bread)

  16. 14 Dec 2017

    sort lines.txt |uniq |hexdump -c # Use hexdump to find hidden characters (space, CR, NL, ...) that prevent uniq from collapsing all entries.

  17. 14 Dec 2017

    zcat dhcp.log.{12..1}.gz |cat - dhcp.log |awk '/DHCPREQUEST/ && !a[$10]++' # Show MAC address lines when they first showed up over past year

  18. Retweeted
    14 Dec 2017

    chronic <mycommand> # Hides stdout and stderr unless mycommand fails.

  19. 13 Dec 2017

    <Ctrl-e> # Move your cursor to the end of the line. Faster than holding down right arrow. You may also be able to use the End key to do the same, but that's not always convenient or setup by default

  20. 13 Dec 2017

    <Ctrl-a> # Move your cursor to the beginning of the line. Faster than holding down left arrow. In screen, you need to press <Ctrl-a a> You may also be able to use the Home key to do the same thing, but that's not always convenient or setup by default.

  21. 13 Dec 2017

    <Ctrl-l> # This is usually equivalent to running 'clear'. Its usually quicker and doesn't leave the command in your command line history.

Loading seems to be taking a while.

Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.

    You may also like

    ·