The new forums will be named Coin Return (based on the most recent vote)! You can check on the status and timeline of the transition to the new forums here.
The Guiding Principles and New Rules document is now in effect.

The [Linux] Thread - Turn your three yard elf into a powerhouse!

VistiVisti Registered User regular
Handy Commands and Shortcuts
Keep in mind that these are only the most basic forms of each command, and that they all have dozens of switches and caveats that enable you to do awesome things with them.

FILE MANIPULATION:

cd <directory> : change current directory to <directory>
ls : list directory contents
ls -a : list directory contents including hidden files
ls -l : list directory contents in detailed list format
mkdir <dirname> : make subdirectory <dirname> (can also specify full directory e.g. mkdir /home/thesquid/giantAngryBear)
rmdir <dirname> : deletes empty subdirectory <dirname>
cp <file> <dest> : copy <file> to <dest>
cp -r <directory> <dest> : copy <directory> and everything inside it to location <dest>
mv <file> <dest> : moves <file> to <dest>
rm <file> : removes (deletes) <file>
rm -r <directory> : removes (deletes) <directory> and everything inside it
chown <user> <file> : change user ownership of <file> to <user>
chgrp <group> <file> : change group ownership of <file> to <group>
chmod XXX <file> : change permissions of <file> to octal number XXX (probably best to 'man' this one)
touch : change file timestamp (and will create an empty file if it doesn't exist)

HANDY TOOLS:

man : gives the manual page on any command including all of these ones (lol man mount)
man -k <string> : gives a list of all man pages with <string> in the title or short description
less : an extremely simple viewer of plaintext files, has regex searching and up/down movement
more : an even simpler viewer than less (now you get the less is more than more gag in bash)
view : a read-only version of vim, so has all the vim commands, but you can't edit the file
vim / emacs / pico / vi / nano : complex text editors that support enormously complicated yet awesome shortcuts, syntax colouring, the whole shebang

SYSTEM STUFF: (you will probably need to be root to take advantage of these)

top : display Linux tasks (equiv. to Task Manager) htop is a widely preferred and more interactive alternative
ifconfig : for configuring network interfaces (setting ip address, activating and deactivating network cards)
iwconfig : for configuring wireless network interfaces
iwlist : getting more info from a wireless network interface (especially seeing wireless networks in range)
route : show / manipulate the IP routing table
dhclient : DHCP client
lshw : list hardware
lspci : list all PCI devices
lsmod : list modules in Linux kernel
modprobe : add / remove <module> from Linux kernel
mount : mount a file system
umount : unmount a file system

USEFUL THINGOES:

wpa_supplicant : for connecting to WPA networks. Requires several reads of the man page, editing of a configuration file by looking at several example files for clarity, and possibly carving arcane symbols into your face.
tar : for making tarballs of a directory / several files
gzip : for compressing said tarball using *.gz
gunzip : for uncompressing a gzipped file
bzip2 : for compressing said tarball using *.bz2
bunzip : for uncompressing a bzipped file
tar xvfz <file> : for uncompressing a *.tar.gz file
tar xvjf <file> : uncormpressing a *tar.bz2 file
date : printing the date and time
ping : to ping
pwd : print out current directory name
killall <process> : kills all processes of name <process>
ps -aux : prints a snapshot of all current running processes
kill <jobid> : kills process of job id <jobid>. <jobid> can be found with ps -aux or top
which : locates a command
Useful techniques:

* Searching for a file based on file name:

e.g. I want to find all the files in the current directory and any subdirectories that start with Photo and end in jpg, such as Photo322.jpg.

Command: find . -iname "Photo*.jpg"

English translation: find, starting in the the current directory (the "." argument), any files that match the name "Photo*.jpg" in a case insensitive fashion (the "-iname") argument.

Notes: It is very important if you are passing wildcards to find that you escape the wildcards by using \ or ". If you do not, then the shell will expand the wildcards on the command line and your command will then be the equivalent of:
find . -iname
    * Doing the same operation on a bunch of files e.g. I want to gzip up each text file in the current directory into their own separate archive Command: for eachFile in *.txt; do gzip "$eachFile"; done English translation: Take the list of files that are returned by *.txt. Go through each of those filenames in the list one by and one, and each time 1.) Assign the current filename to the variable called "eachFile". This can be accessed by $eachFile. 2.) Execute the command between "do" and "done". In this example, it is gzip "$eachFile". Notes: "$eachFile" is enclosed in quotation marks so that any filenames with spaces get passed correctly to gzip. The semi-colons tell the shell that a command is done and to treat anything after the semi-colon as a new command. If you wanted to, you could have the loop do more than one command on a single line, like so: for eachFile in *.txt; do gzip "$eachFile"; mv "$eachFile".gz .. ; done Any more complexity, and you're probably at the stage where you should be writing a script instead of trying to fit it into one line. * Displaying the contents of files/simple manipulation of standard input head [filename] tail [filename] cat [filename] Head will show, by default, the first 10 lines of a file, or if no filename is provided, then standard input. Tail will show, by default, the last 10 lines of a file, or if no filename is provided, then standard input. Useful for looking at log files. cat will dump the entire contents of a file to standard output (typically the screen, but often not). If no filename is provided, then it will basically echo standard input to standard output. This is useful in creating simple files. e.g. I want to create a file called "hello.txt" containing the line "This is a test" cat > hello.txt This is a test Ctrl-D (Ctrl-D signals end-of-file). To *append* something to an existing file: cat >> hello.txt This will be the second line of the file Ctrl-D Note the >>! If you just use >, you will overwrite the file, instead of appending. * Displaying something to screen echo Hello world! The echo command will echo whatever arguments is passed to it back to the standard output. Typically used in scripts to show status reports. Chaining it all together! Let's list the first ten lines of every text file in the current directory and pretty it up with a header. for eachFile in *.txt; do echo "*** Ten lines of $eachFile ***"; head "$eachFile"; done Oh crud, it went by too fast to see it! Hang on - we know that we can use 'less' to view text files for eachFile in *.txt; do echo "*** Ten lines of $eachFile ***"; head "$eachFile"; done | less Tada! (push 'q' to quit from less, by the way). Replace with appropriate options for those times you want to sort mp3 files, or photos, or whatever.

So you want to run Linux?

Well, good! Here's some of the most popular distros, linked for your enjoyment. Deciding between these are a matter of personal preference, so look around their websites to see what they offer:

ubuntu-logo217.gif

Ubuntu is the leader in the field right now and is often suggested to newcomers.

fedora-logo-256.png

Fedora is another of the major distros - Also a fine beginner's choice.

deb_128x128.png

Debian is an old dog, but stable as hell. Ubuntu is built on a Debian foundation. Debian is known for it's strong views on only including free packages with the distribution.

arch-linux-logo.png

Arch Linux
is an increasingly popular distro, but is often not recommended unless you know what you're doing as it requires a good deal of setup. Their wiki is awesome, though.

More to come.. perhaps.

But what does it look like?

See, that's an interesting question because Linux can look in a lot of different ways. More so than just referring to themes and colour schemes and such, the entire user interface can change depending on which desktop environment you choose to use. Here are a couple of screenshots of the main ones:

Gnome - the main DE of Ubuntu and thus one of the most widespread desktop environments around. Here's a screenshot of the standard Ubuntu setup:
techrepublic_gnome_default_desktop.jpg

KDE - a bit more tweakable than Gnome, I'm led to believe. Recently in it's fourth incarnation - Looks like this:
kde4rc1.jpg

Openbox - a popular lighter DE. Can look like this, but is extremely flexible, so it's hard to have only one screenshot:
Openbox_Desktop_2009_01_20_by_Jaanos.png

There are several others if you don't like those. Here's a little taster:
Awesome:
AwesomeWM_Desktop_27_01_by_Gigamlol.png

Elive:
Elive042.png

XFCE:
xfce1.jpg

IceWM:
absolute-12.2.5.png


If anybody was working on a new OP, I'll put that in there! Credits go to Jasconius for this one.

[SIGPIC][/SIGPIC]
Visti on
«13456763

Posts

  • ImpersonatorImpersonator Registered User regular
    edited August 2009
    The OP should have links and images of current/popular distros.

    Impersonator on
  • VistiVisti Registered User regular
    edited August 2009
    The OP should have links and images of current/popular distros.

    On it. Are images really necessary? How about some links and then some pictures of the most popular DEs?

    Visti on
    [SIGPIC][/SIGPIC]
  • SeeksSeeks Registered User regular
    edited August 2009
    I was going to suggest pretty much the same thing.

    Links to webpages with pics should be fine, especially since mirrors move around so much.

    Seeks on
    userbar.jpg
    desura_Userbar.png
  • VistiVisti Registered User regular
    edited August 2009
    If you wanna do a write-up of your favorite DE/Dist, I'll post that up there.

    Visti on
    [SIGPIC][/SIGPIC]
  • ImprovoloneImprovolone Registered User regular
    edited August 2009
    I've been using Awesome for a few months an grew sick of it. I wanted to return to Gnome. So I uninstalled Awesome in Synaptic, then on log in, went into options and chose Gnome.
    Now all of my windows are frameless, can't be manipulated, don't appear in the panel, don't have the bar with the min max close buttons, etc etc etc.
    It's making things really fucking horrible. Right now I am using Fluxbox just because its the only thing that works.

    All I want is my Gnome back!
    Help me Linux thread, you're my only hope.

    Improvolone on
    Voice actor for hire. My time is free if your project is!
  • VistiVisti Registered User regular
    edited August 2009
    What distro are you on, Improv?

    Visti on
    [SIGPIC][/SIGPIC]
  • ImprovoloneImprovolone Registered User regular
    edited August 2009
    Ubuntu Jackal

    Thinking it had something to do with compiz, I also reinstalled it to get a fresh start. No dice.

    Improvolone on
    Voice actor for hire. My time is free if your project is!
  • MalkorMalkor Registered User regular
    edited August 2009
    I can't exactly grow a beard on my neck, are there prosthetic I can procure?

    Also after messing with Arch for a good long while I'm going to try 64-bit CrunchBang, because why not.

    Malkor on
    14271f3c-c765-4e74-92b1-49d7612675f2.jpg
  • zeenyzeeny Registered User regular
    edited August 2009
    I've been using Awesome for a few months an grew sick of it. I wanted to return to Gnome. So I uninstalled Awesome in Synaptic, then on log in, went into options and chose Gnome.
    Now all of my windows are frameless, can't be manipulated, don't appear in the panel, don't have the bar with the min max close buttons, etc etc etc.
    It's making things really fucking horrible. Right now I am using Fluxbox just because its the only thing that works.

    All I want is my Gnome back!
    Help me Linux thread, you're my only hope.

    Start metacity or emerald from a terminal. If it fixes it, restart X. All should be fine.

    zeeny on
  • FremFrem Registered User regular
    edited August 2009
    zeeny wrote: »
    I've been using Awesome for a few months an grew sick of it. I wanted to return to Gnome. So I uninstalled Awesome in Synaptic, then on log in, went into options and chose Gnome.
    Now all of my windows are frameless, can't be manipulated, don't appear in the panel, don't have the bar with the min max close buttons, etc etc etc.
    It's making things really fucking horrible. Right now I am using Fluxbox just because its the only thing that works.

    All I want is my Gnome back!
    Help me Linux thread, you're my only hope.

    Start metacity or emerald from a terminal. If it fixes it, restart X. All should be fine.

    Might also want to double check and make sure metacity is installed.

    Frem on
  • VistiVisti Registered User regular
    edited August 2009
    How about dropping to tty1 and doing a apt-get remove gnome-desktop (or whatever it's called) and then sudo apt-get autoclean and then getting it again?

    Visti on
    [SIGPIC][/SIGPIC]
  • zeenyzeeny Registered User regular
    edited August 2009
    Visti wrote: »
    How about dropping to tty1 and doing a apt-get remove gnome-desktop (or whatever it's called) and then sudo apt-get autoclean and then getting it again?

    That could work....but I still think that simply starting metacity would be kind of simpler.;o)

    zeeny on
  • VistiVisti Registered User regular
    edited August 2009
    Well, yeah - it pretty much seems like you're missing a window manager (compiz should do, though?), but since there's no real way to know what's been tinkered with and what hasn't I think those commands would give a nice clean start. Autoclean cleans stored settings too, right?

    Visti on
    [SIGPIC][/SIGPIC]
  • ImprovoloneImprovolone Registered User regular
    edited August 2009
    All fixed
    #!

    Thanks for the help, but I had been itching to give crunchbang a shot so I figured now would be a good time

    Improvolone on
    Voice actor for hire. My time is free if your project is!
  • VistiVisti Registered User regular
    edited August 2009
    Good call! How do you like it?

    Visti on
    [SIGPIC][/SIGPIC]
  • ImprovoloneImprovolone Registered User regular
    edited August 2009
    So far its really neat. I'm really excited about playing with tint2. I need to do a lot of work to firefox though, the basic theme fills too much of my 9'' screen.

    Improvolone on
    Voice actor for hire. My time is free if your project is!
  • FodderFodder Registered User regular
    edited August 2009
    But how can you use this as a learning experience if you don't spend 4 hours in a terminal and google open!?!?

    Really though, probably was just metacity, though I've never been one to dissuade people from trying new distros. I've been sort of considering arch, but I don't have much free time at the moment. Also considering using awesome, but setting up shortcuts and everything seems like something I'll hold off on until the new version with 9.10 anyways...

    EDIT: vimperator saves you a ton of screen real estate in firefox <.<

    Fodder on
    steam_sig.png
  • VistiVisti Registered User regular
    edited August 2009
    So far its really neat. I'm really excited about playing with tint2. I need to do a lot of work to firefox though, the basic theme fills too much of my 9'' screen.

    tinymenu, fission and moving the address bar and search up to the menu line has enabled me to only have two lines at the top and no status at the bottom. Works well.

    Visti on
    [SIGPIC][/SIGPIC]
  • ImprovoloneImprovolone Registered User regular
    edited August 2009
    VImperator looks a bit scary.
    Baby steps man, baby steps

    Improvolone on
    Voice actor for hire. My time is free if your project is!
  • ImprovoloneImprovolone Registered User regular
    edited August 2009
    Visti wrote: »
    So far its really neat. I'm really excited about playing with tint2. I need to do a lot of work to firefox though, the basic theme fills too much of my 9'' screen.

    tinymenu, fission and moving the address bar and search up to the menu line has enabled me to only have two lines at the top and no status at the bottom. Works well.

    Whoo, thanks

    Improvolone on
    Voice actor for hire. My time is free if your project is!
  • FodderFodder Registered User regular
    edited August 2009
    I'll be honest that it is a bit daunting to get into, and you'll spend a lot of time at the beginning referring to the (well laid out and informative) help page at the beginning, but the keyboard shortcuts make things a lot faster once you're comfortable with them, and it does save a shocking amount of space, particularly on smaller screens.

    Fodder on
    steam_sig.png
  • ImprovoloneImprovolone Registered User regular
    edited August 2009
    Fodder wrote: »
    I'll be honest that it is a bit daunting to get into, and you'll spend a lot of time at the beginning referring to the (well laid out and informative) help page at the beginning, but the keyboard shortcuts make things a lot faster once you're comfortable with them, and it does save a shocking amount of space, particularly on smaller screens.

    I'm going to heavily consider it. I have a 3+ hour plane flight coming up, so I'm going to have a lot of time on my hands.

    Improvolone on
    Voice actor for hire. My time is free if your project is!
  • ImprovoloneImprovolone Registered User regular
    edited August 2009
    I just found this thing which is a great help in messing with your tint2
    http://code.google.com/p/tintwizard/

    Improvolone on
    Voice actor for hire. My time is free if your project is!
  • VistiVisti Registered User regular
    edited August 2009
    Also, when configuring stuff like that: it's not a sin to steal!

    Visti on
    [SIGPIC][/SIGPIC]
  • BarrakkethBarrakketh Registered User regular
    edited August 2009
    Visti wrote: »
    Autoclean cleans stored settings too, right?

    Autoclean only removes stale packages from the download cache directory, while clean will remove all of them. System configuration files owned by a package can be removed along with the package by using purge instead of remove.

    Barrakketh on
    Rollers are red, chargers are blue....omae wa mou shindeiru
  • ImprovoloneImprovolone Registered User regular
    edited August 2009
    Visti wrote: »
    Also, when configuring stuff like that: it's not a sin to steal!

    Been there done that. Fun way to start in order to get a better feel for what is what.

    When I was backing up my previous and totally screwed Ubuntu, I must have missed getting copies of my complicated conky scripts. Goddamnit.

    Improvolone on
    Voice actor for hire. My time is free if your project is!
  • VistiVisti Registered User regular
    edited August 2009
    I think I've outgrown conky. It's fun and all and everyone who saw my laptop when I was on full blast with it was impressed, but I just started not caring at all, so it's disabled on all my new #! installs.

    If I lost my bashrc however.. *shudder*

    Visti on
    [SIGPIC][/SIGPIC]
  • theSquidtheSquid Sydney, AustraliaRegistered User regular
    edited August 2009
    I actually don't really like tint2 all that much. Just doesn't seem as configurable as everyone makes it out to be at the end of the day.

    theSquid on
  • ImprovoloneImprovolone Registered User regular
    edited August 2009
    I'm a sucker for editing code for things like conky, tint2, etcetcetc

    Improvolone on
    Voice actor for hire. My time is free if your project is!
  • SeeksSeeks Registered User regular
    edited August 2009
    I used Tint for about ten minutes, but one of the programs I opened (something I used frequently) didn't show up on the panel at all. Thus ended my tryst with Tint.

    Seeks on
    userbar.jpg
    desura_Userbar.png
  • ImpersonatorImpersonator Registered User regular
    edited August 2009
    Guys, I can't stop watching/listening to this video:

    http://www.youtube.com/watch?v=cH9WLrcsrx8

    Impersonator on
  • iTunesIsEviliTunesIsEvil Cornfield? Cornfield.Registered User regular
    edited August 2009
    Does anyone know of some good tutorials for using sed and awk? I see them used all the time for some really cool stuff, but they always look really frickin' confusing at the same time.

    iTunesIsEvil on
  • noweatnoweat Registered User regular
    edited August 2009
    there are probably better ones, but i use http://www.cs.hmc.edu/tech_docs/qref/sed.html. it's written out simply enough for me to understand, which is always a plus , as well as some other useful guides(awk).

    noweat on
    steam_sig.png
  • Michael HMichael H Registered User regular
    edited August 2009
    Marvelous OP. I was going to suggest putting something about Mint up, but then I figured it might be handy to have the following link. It kind of serves the same purpose as the brief distro intros, but with a few more in there:

    http://distrowatch.com/dwres.php?resource=major

    Distrowatch is just a great site overall, IMO.

    Michael H on
  • WeretacoWeretaco Cubicle Gangster Registered User regular
    edited August 2009
    I've been rocking ubuntu for the past week or so on my Dell e6400

    linux-backports-modules-jaunty seems to have fixed my wifi connection dropouts I was getting.

    Only issue now, is the headphone port on my docking station doesn't work. I've found 1 possible fix for it which involved messing with some volume meters/switches but no luck so far.

    Other than that, got my only windows app I need (quicken) running under wine pretty well, and I'm g2g on everything else with linux apps.

    Weretaco on
    Unofficial PA IRC chat: #paforums at irc.slashnet.org
  • VistiVisti Registered User regular
    edited August 2009
    Guys, I can't stop watching/listening to this video:

    *snip]

    As great as elive seems at first, I really detest it in practice.

    Visti on
    [SIGPIC][/SIGPIC]
  • ImpersonatorImpersonator Registered User regular
    edited August 2009
    Visti wrote: »
    Guys, I can't stop watching/listening to this video:

    *snip]

    As great as elive seems at first, I really detest it in practice.

    Care to explain?

    Impersonator on
  • VistiVisti Registered User regular
    edited August 2009
    Visti wrote: »
    Guys, I can't stop watching/listening to this video:

    *snip]

    As great as elive seems at first, I really detest it in practice.

    Care to explain?

    Hm, it's been a while, but try out the live-CD..

    Then menu-system they having going is one of the most unintuitive things I've used. Everything is organised in a really strange way. And on top of that, they don't follow the design principles put forth in the distro.

    Doing anything other than just gawking at my pretty desktop was excruciating.

    Visti on
    [SIGPIC][/SIGPIC]
  • Descendant XDescendant X Skyrim is my god now. Outpost 31Registered User regular
    edited August 2009
    So I finally got my alpha invite for Jolicloud last week, and I am really enjoying it. I realize that all it really does is install dedicated firefox mini apps, but it's still kind of cool. Everything on my netbook works great, except for the sleep mode, which is to be expected.

    Anyone else been able to use Jolicloud? What did you think?

    Descendant X on
    Garry: I know you gentlemen have been through a lot, but when you find the time I'd rather not spend the rest of the winter TIED TO THIS FUCKING COUCH!
  • ImpersonatorImpersonator Registered User regular
    edited August 2009
    So I finally got my alpha invite for Jolicloud last week, and I am really enjoying it. I realize that all it really does is install dedicated firefox mini apps, but it's still kind of cool. Everything on my netbook works great, except for the sleep mode, which is to be expected.

    Anyone else been able to use Jolicloud? What did you think?

    Install Newsmap, now! <3

    Impersonator on
This discussion has been closed.