Sign In

    Enjoy FOSSwire's content? Have it delivered! Subscribe

    Unix/Linux Command Cheat Sheet

    In an attempt to find a good Unix reference for you FOSSwire readers, I was unsuccessful at finding a decent one on the Internet. So, why not make one?

    fwunixrefshot.png

    Click the image above to download a full PDF. Print it out, stick it on your wall, and pass it on. It's licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported license, so feel free do distribute and modify it, even for commercial use! Just keep the FOSSwire credit on the page.

    Translations are already available, so if you have your own translation you would like to share, post it in the comments and we'll add it here!
    We'll occasionally update this with changes and additions every now and then (such as the problem fixed in the first two comments) so be sure to check back for updates!
    • Aug 3 1:20 AM EST: Typo fix in "mv."
    • Aug 3 1:28 AM EST: Added bg in the description for Ctrl-Z; updated "bg" under Process Management
    • Aug 3 1:34 AM EST: Added "which" and "whereis" commands for System Information
    • Aug 3 1:41 AM EST: Added "locate" under Searching
    • Aug 3 11:00 AM EST: Added Ctrl+R under Shortcuts
    • Nov 10 9:00 AM EST: New License: CC-BY-SA!

    Command line fundamentals - redirect a command’s output to a file

    This is a pretty basic command line tip, but if you're new to all this CLI goodness, you might not be aware of it.

    When you run a command normally, the output from that command gets sent to the terminal you're working on, so you can see what happened. Sometimes, though, this isn't what you want to do.

    All modern command line shells support something called redirecting. This is where you instruct the command line to run a command, but then redirect all the output from it to a file (or if you get into pipes, into another program, but that's for another day).

    You can achieve this by using the following notation:

    $ ls > file

    In this case, ls is the command and file is where we want the output sent to. As you might expect, the results of running ls are going to be dumped into the file you specified.

    There are a couple of other things you can do as well. The > notation will overwrite the target file if it already exists. To avoid this and to append to the given file, use a double arrow, like >>.

    $ ls >> file

    Finally, any errors or system messages may still appear on your terminal when you redirect the output of your command. This is because this information is sent to the stderr output instead of the stdout output (which is used for normal output).

    To catch stderr messages too, use the 2> notation.

    $ ls / >> file 2> errors

    Obviously, if no errors occur, nothing will be written to the file. You can use the same file for catching normal output and messages if you use the append operator properly.
    $ ls / >> file 2>> file

    In fact, you can also do other stuff with command redirection, such as use the arrows the other way when necessary, but I think that's more than enough for today. :)


    Automatix2 Installation Process

    Regarding my previous post criticizing Automatix2, I agreed to install Automatix2 on my system and see the effects. I'm going to be updating this post continuously as it installs.

    Install process log:


    1. Downloaded .deb from getautomatix.com
    2. Installed with GDebi
    3. Automatix2 started from Apps > System Tools > Automatix2
    4. About dialog opens, clicked OK
    5. Checked some software to install, including some that were config modifications
    6. Clicked Start
    7. A terminal window with a progress bar opened
    8. Ax2 begins to download and install Opera from a 3rd-party repository
    9. Ax2 downloads and installs Wine from a 3rd-party repo, even though I already have the latest version of Wine installed
    10. Alert dialog pops up, already I can see the process requires attention; not automated
    11. Winecfg opens, clicked OK
    12. Begins to install unzip tools from the official repository
    13. Installs sbackup, official
    14. Beagle, official
    15. gFTP, but already installed, so no action taken
    16. glipper, official
    17. clamav, official, but did not install. Sub-process error code 1.
    18. liferea, already installed, aborts
    19. Installs cracklib and other various encryption tools
    20. Installs debian menu from official
    21. Installs the SLAB from official
    22. Another confirmation dialog about NTFS and FAT32 mounts, clicked Yes
    23. Another repository refresh
    24. Installs ntfstools
    25. Yet another alert: need to restart computer when finished
    26. Removes my install of totem-gstreamer (!) and installs totem-xine
    27. Installs checkgmail from official
    28. Installs alien and RPM tools from official
    29. Downloads an RPM (!) for realplayer
    30. Installs an RPM for lightscribe
    31. Installs ndiswrapper + GUI from official repo
    32. Installs w32codecs, 3rd-party, no repository
    33. Installs DVD codecs, although already installed
    34. Installs Flash9 from Adobe, but I already have it
    35. Removed Ubuntu Restricted Extras and my own copy of Flash (hey!)
    36. Installed MPlayer and plugins for Firefox
    37. Removed Totem for Firefox
    38. Installed various gaim plugins, note that Automatix does not have Pidgin
    39. Installed some Perl repositories
    40. Reloaded repository list again
    41. Installed some DVD ripping tools
    42. More alerts: Streamripper needs to be closed after you open it, please stand by
    43. I pet the dog (still awake?)
    44. Streamtuner opened, I closed it
    45. Automatix2 opens back up, 2 fatal errors: Swiftfox not available, GNOME Security Suite, although no mention of ClamAV fail

    I closed Ax2, and began to look around my system. My media menu is pretty cluttered, although I probably selected those options. Nothing seems broken in Synaptic, so it seems for the most part the installation was successful. Here are some things I want to note about the installation:
    • It was not automated, and required me to stand by my laptop as it downloaded and installed software
    • I now have duplicate copies of Wine & some DVD tools
    • It reloaded the repositories many times during the installation.
    • It failed to install ClamAV, but it did not report it as an error in the end.
    • It did do each task that successfully completed right, the applications all opened correctly when it was done.
    • It added some KDE libraries, and for some reason installed the KDE help system even though I specifically told it not to.
    • It opened a terminal window for most tasks, something that new users probably don't like to see.
    • It used 3rd party repositories for tasks that would have sufficed with the official.
    Overall, I still stand by my decision, and while Ax2 does do some nice things, it also installs some software and configuration that can make your system feel bloated.

    I'm probably going to reinstall from a Feisty CD after this rather than try to remove everything it installed and changed.. I'm not sure I like the configuration it made.


    1. 1
    2. 2
    3. 3
    4. 4