Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

Command line tips & tricks

124»

Comments

  • Registered Users, Registered Users 2 Posts: 2,398 RebelButtMunch
    ✭✭✭


    Want to answer 'n' to lots of repetitive questions? Use the YES command
    e.g.
    "yes n | gzip -d *"


  • Registered Users, Registered Users 2 Posts: 2,398 RebelButtMunch
    ✭✭✭


    Want to answer 'n' to lots of repetitive questions? Use the YES command
    e.g.
    "yes n | gzip -d *"


  • Registered Users, Registered Users 2 Posts: 2,398 RebelButtMunch
    ✭✭✭


    cat a file backwards... use tac command


  • Registered Users, Registered Users 2 Posts: 887 Keplar240B
    ✭✭✭




  • Registered Users, Registered Users 2 Posts: 742 Dero
    ✭✭✭


    One thing that (irrationally) bugs me is seeing "grep -v grep"; e.g.
    ps -ef | grep java | grep -v grep
    

    So I use this character class trick that someone showed me years ago:
    ps -ef | grep [j]ava
    

    It'll also work anywhere else that regex can be used, like awk:
    ps -ef | awk '/[j]ava/ {print $2}'
    

    Yes, pgrep will do this, but I work a lot on AIX, which doesn't have pgrep.

    Also, for parallel execution, you can use xargs and nproc if parallel is not installed/available.
    ls -1 *.flac | xargs -P $(nproc) -n1 -I{} oggenc "{}"
    

    Using nproc will match the number of logical CPUs in your machine, but you could use more or less if you want.


  • Advertisement
  • Registered Users, Registered Users 2 Posts: 1,931 PrzemoF
    ✭✭✭


    $ cat a
    A
    B
    C
    D
    $ cat b
    1
    2
    3
    4
    $ paste a b
    A   1
    B   2
    C   3
    D   4
    

    Nothing really special about it, but it just saved me some work :-)


  • Registered Users, Registered Users 2 Posts: 83 rayzercork
    ✭✭


    if you have the xfce terminal installed type

    xfce4-terminal --drop-down

    and it will drop down from the top of your screen. if you create a launcher with that command and stick it into usr/share/applications you can run it from the menu or else assign a keyboard shortcut like F12 to activate it.
    i like to run cmus music player inside this terminal because i can hide it out of the way when not needed


  • Registered Users, Registered Users 2 Posts: 71 lyda
    ✭✭


    If you want to version control your home directory, look at vcsh: https://github.com/RichiH/vcsh

    It's also available in most distros. The nice part is that you can put different parts of your home dir in different repos.



Welcome!

It looks like you're new here. Sign in or register to get started.
Advertisement