Page 1 of 7 123 ... LastLast
Results 1 to 10 of 65

Thread: Share your commandline cheat sheets

  1. #1
    Join Date
    Jul 2007
    Location
    Brugge, België
    Beans
    2,933

    Share your commandline cheat sheets

    Ok, I have been needing to do this for a long time.

    I need a cheat sheet of commands.

    I know there are some on the web, but they are mostly basic lists.

    Do you have a list with useful commands?

    Share them.

    (I'll be happy to rip them)

    ps: I have a basic one here:

    http://linuxowns.wordpress.com/2008/...y-cheat-sheet/

  2. #2
    Join Date
    Aug 2006
    Location
    US
    Beans
    1,681

    Re: Share your commandline cheat sheets

    It seems kind of redundant to open a root shell with sudo. I guess it's because Ubuntu doesn't set a root password by default.

    Here are some handy basic commands to know:

    cat - print contents of a file
    cd - change directories
    chmod - change file permissions
    cp - copy a file
    grep - searches for a given string
    ln - link files
    ls - list the files in the current directory
    mkdir - make directory
    more - helps page through output ( cat file.txt | more)
    mv - move a file
    rm - delete files and directories
    top - shows resource usage

    Helpful symbols:
    | - pipe the output of one command into the next
    & - detach process from shell (run in background)
    && - chain two or more commands together (if the first is successful)

  3. #3
    Join Date
    Jun 2008
    Location
    Vancouver Canada
    Beans
    3,136
    Distro
    Xubuntu 13.10 Saucy Salamander

    Re: Share your commandline cheat sheets

    Last edited by hansdown; October 3rd, 2008 at 03:56 PM.
    I learn something ubuntu everyday.
    dell precision T7500 1Tb hdd x 2
    2.67 Ghz intel xeon X5550 cpu
    nvidia quadro fx 4800-1.5 Gb video card

  4. #4
    Join Date
    Nov 2006
    Location
    Spain
    Beans
    175
    Distro
    Ubuntu 9.04 Jaunty Jackalope

    Re: Share your commandline cheat sheets

    And don't forget the >
    useful when doing top > top.txt or lspci > log.txt

  5. #5
    Join Date
    Jan 2006
    Beans
    1,352

    Re: Share your commandline cheat sheets

    These 4 commands are useful:




    -- CHANGE folder of .svg's to .png's and resize all the images:

    Code:
    for i in *.svg; do inkscape -f "$i" -e "$i.png" -w24 -h24; done



    -- CHANGE one .svg to a .png and resize the image:

    Code:
    inkscape *.svg --export-png=*.png -w24 -h24


    -- check hard drive temp:


    Code:
    hddtemp /dev/sda

    -- GDM screenshot:

    Code:
    chvt 7 ; sleep 5 ; XAUTHORITY=/var/lib/gdm/:0.Xauth DISPLAY=:0.0 import -window root /tmp/gdm-shot.png
    Last edited by crimesaucer; October 3rd, 2008 at 05:48 PM.

  6. #6
    Join Date
    Nov 2007
    Location
    England
    Beans
    733
    Distro
    Ubuntu 11.10 Oneiric Ocelot

    Re: Share your commandline cheat sheets

    One I use a lot is:
    ls -ltr
    ls -a -ltr
    For seeing what is actually in a directory
    Want an alternative to 99% of Windows applications?
    http://www.osalt.com/

    "Dude, real programmers compile" - Plato 428BC

  7. #7
    Join Date
    Apr 2007
    Beans
    14,781

    Re: Share your commandline cheat sheets

    Code:
    ~$cat .bashrc | grep "alias"
    # ~/.bash_aliases, instead of adding them here directly.
    alias code='cd /media/STORAGE/code/'
    alias ccode='cd /media/STORAGE/cCode/'
    alias py='cd /media/STORAGE/code/pythonCode/'
    alias tti='./ttime'
    alias off='/home/laroza/off'
    alias search='apt-cache search'
    alias install='sudo aptitude install'
    alias clean='sudo apt-get clean && sudo apt-get autoremove'
    alias upgrade='sudo apt-get update && sudo apt-get upgrade && sudo apt-get autoclean && sudo apt-get clean'
    alias pingg='ping -c 1 www.google.com'
    alias targz="tar -xvvzf"
    alias headset='asoundconf set-default-card headset'
    alias intel='asoundconf set-default-card intel'
    alias black='/home/laroza/p/.setroot'
    alias tarup='tar -cvvf'
    ~$

  8. #8
    Join Date
    Aug 2007
    Beans
    2,132

    Re: Share your commandline cheat sheets

    Code:
    *
    I believe that says it all (literally!)

  9. #9
    Join Date
    Jul 2007
    Location
    Brugge, België
    Beans
    2,933

    Re: Share your commandline cheat sheets

    Quote Originally Posted by LaRoza View Post
    Code:
    ~$cat .bashrc | grep "alias"
    # ~/.bash_aliases, instead of adding them here directly.
    alias code='cd /media/STORAGE/code/'
    alias ccode='cd /media/STORAGE/cCode/'
    alias py='cd /media/STORAGE/code/pythonCode/'
    alias tti='./ttime'
    alias off='/home/laroza/off'
    alias search='apt-cache search'
    alias install='sudo aptitude install'
    alias clean='sudo apt-get clean && sudo apt-get autoremove'
    alias upgrade='sudo apt-get update && sudo apt-get upgrade && sudo apt-get autoclean && sudo apt-get clean'
    alias pingg='ping -c 1 www.google.com'
    alias targz="tar -xvvzf"
    alias headset='asoundconf set-default-card headset'
    alias intel='asoundconf set-default-card intel'
    alias black='/home/laroza/p/.setroot'
    alias tarup='tar -cvvf'
    ~$
    Interesting.

    I might start doing this when intrepid comes out.

  10. #10
    Join Date
    Apr 2007
    Beans
    14,781

    Re: Share your commandline cheat sheets

    Quote Originally Posted by billgoldberg View Post
    Interesting.

    I might start doing this when intrepid comes out.
    Aliases are quite handy, especially ones for apt and tar, as the most command things I do are rather verbose.

Page 1 of 7 123 ... LastLast

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •