• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EDT 02:08
CET 07:08
KST 15:08
  • Home
  • Forum
  • Calendar
  • Streams
  • Liquipedia
  • Features
  • Store
  • EPT
  • TL+
  • StarCraft 2
  • Brood War
  • Smash
  • Heroes
  • Counter-Strike
  • Overwatch
  • Liquibet
  • Fantasy StarCraft
  • TLPD
  • StarCraft 2
  • Brood War
  • Blogs
Forum Sidebar
Events/Features
News
Featured News
[ASL21] Ro24 Preview Pt1: New Chaos0Team Liquid Map Contest #22 - Presented by Monster Energy7ByuL: The Forgotten Master of ZvT30Behind the Blue - Team Liquid History Book19Clem wins HomeStory Cup 289
Community News
Weekly Cups (March 16-22): herO doubles, Cure surprises3Blizzard Classic Cup @ BlizzCon 2026 - $100k prize pool47Weekly Cups (March 9-15): herO, Clem, ByuN win42026 KungFu Cup Announcement6BGE Stara Zagora 2026 cancelled12
StarCraft 2
General
Blizzard Classic Cup @ BlizzCon 2026 - $100k prize pool Weekly Cups (March 16-22): herO doubles, Cure surprises Weekly Cups (August 25-31): Clem's Last Straw? Team Liquid Map Contest #22 - Presented by Monster Energy What mix of new & old maps do you want in the next ladder pool? (SC2)
Tourneys
Sparkling Tuna Cup - Weekly Open Tournament World University TeamLeague (500$+) | Signups Open RSL Season 4 announced for March-April WardiTV Team League Season 10 KSL Week 87
Strategy
Custom Maps
Publishing has been re-enabled! [Feb 24th 2026]
External Content
The PondCast: SC2 News & Results Mutation # 518 Radiation Zone Mutation # 517 Distant Threat Mutation # 516 Specter of Death
Brood War
General
ASL21 General Discussion mca64Launcher - New Version with StarCraft: Remast BGH Auto Balance -> http://bghmmr.eu/ Soulkey's decision to leave C9 JaeDong's form before ASL
Tourneys
[ASL21] Ro24 Group B [ASL21] Ro24 Group C 2026 Changsha Offline Cup [ASL21] Ro24 Group A
Strategy
Fighting Spirit mining rates Simple Questions, Simple Answers Soma's 9 hatch build from ASL Game 2
Other Games
General Games
Nintendo Switch Thread General RTS Discussion Thread Stormgate/Frost Giant Megathread Path of Exile Dawn of War IV
Dota 2
Official 'what is Dota anymore' discussion The Story of Wings Gaming
League of Legends
Cheapest Rent a Car in Fujairah – Budget Travel Gu G2 just beat GenG in First stand
Heroes of the Storm
Simple Questions, Simple Answers Heroes of the Storm 2.0
Hearthstone
Deck construction bug Heroes of StarCraft mini-set
TL Mafia
TL Mafia Community Thread Five o'clock TL Mafia Mafia Game Mode Feedback/Ideas Vanilla Mini Mafia
Community
General
US Politics Mega-thread Russo-Ukrainian War Thread European Politico-economics QA Mega-thread Things Aren’t Peaceful in Palestine YouTube Thread
Fan Clubs
The IdrA Fan Club
Media & Entertainment
[Req][Books] Good Fantasy/SciFi books Movie Discussion! [Manga] One Piece
Sports
2024 - 2026 Football Thread Cricket [SPORT] Formula 1 Discussion Tokyo Olympics 2021 Thread General nutrition recommendations
World Cup 2022
Tech Support
Laptop capable of using Photoshop Lightroom?
TL Community
The Automated Ban List
Blogs
Funny Nicknames
LUCKY_NOOB
Money Laundering In Video Ga…
TrAiDoS
Iranian anarchists: organize…
XenOsky
FS++
Kraekkling
Shocked by a laser…
Spydermine0240
Unintentional protectionism…
Uldridge
ASL S21 English Commentary…
namkraft
Customize Sidebar...

Website Feedback

Closed Threads



Active: 5409 users

So I got Linux n stuff... now help? :( - Page 2

Blogs > evanthebouncy!
Post a Reply
Prev 1 2 3 Next All
Jank
Profile Blog Joined March 2008
United States308 Posts
January 07 2009 09:34 GMT
#21
Not that linux isn't a fantastic os and emacs a fantastic powerful editor, but I think you should stick to windows while learning C (at least at first). I think you're trying to tackle too many things at once. I would pick one thing to focus on at a time, attempting to learn programming on an unfamiliar os will just slow you down. Not to mention how complicated emacs can be if you want it to be perfect for your use lol. I'd suggest using visual studio express or something first in windows. It'll let you focus more on the programming and will be a lot less overwhelming.

But, if you don't wanna heed my advice then uh Good luck!
"You don't know you're wearing a leash if you sit by the peg all day." - Michael Parenti
evanthebouncy!
Profile Blog Joined June 2006
United States12796 Posts
January 07 2009 09:42 GMT
#22
On January 07 2009 18:34 Therapy wrote:
Not that linux isn't a fantastic os and emacs a fantastic powerful editor, but I think you should stick to windows while learning C (at least at first). I think you're trying to tackle too many things at once. I would pick one thing to focus on at a time, attempting to learn programming on an unfamiliar os will just slow you down. Not to mention how complicated emacs can be if you want it to be perfect for your use lol. I'd suggest using visual studio express or something first in windows. It'll let you focus more on the programming and will be a lot less overwhelming.

But, if you don't wanna heed my advice then uh Good luck!


Everyone in my class, or will be in 20 days will be using linux coding in C. I don't think it's that hard or overwhelming. As I said, I'm not completely hopeless. Anyways I just wrote my first program and it printed hello world, awesome!
Wish I know how to let it print it 10 times or more, wish I could write a program that could take an input x, that would print hello-world x times.
Life is run, it is dance, it is fast, passionate and BAM!, you dance and sing and booze while you can for now is the time and time is mine. Smile and laugh when still can for now is the time and soon you die!
r3dox
Profile Blog Joined May 2003
Germany261 Posts
January 07 2009 09:44 GMT
#23
u have to use ./a.out in order to run a executable
Jank
Profile Blog Joined March 2008
United States308 Posts
Last Edited: 2009-01-07 09:50:45
January 07 2009 09:46 GMT
#24
Ah, if your class is using it then definitely stick with linux. Sounds like you're coping with the semi-foreign os fairly well (tho ubuntu is pretty nice and preconfigured for beginning users) Good luck with C, I'm a programming n00bie myself, just know a bit of c++ and php but not enough to really create anything of value. Although I've made my own lil forum system in php/mysql its fairly simplistic and boring

EDIT:
also,

On January 07 2009 18:42 evanthebouncy! wrote:
Wish I know how to let it print it 10 times or more, wish I could write a program that could take an input x, that would print hello-world x times.


int num;
printf ("Enter number of super awesome greetings you want: ");
scanf ("%d",&num);

for(int i = 0; i < num; i++)
printf ("Hello World! ");

should work fine, I'm not overly familiar with printf/scanf tho as i primarily use cout and cin for console programs (c++ stuff)
"You don't know you're wearing a leash if you sit by the peg all day." - Michael Parenti
evanthebouncy!
Profile Blog Joined June 2006
United States12796 Posts
January 07 2009 09:52 GMT
#25
On January 07 2009 18:44 r3dox wrote:
u have to use ./a.out in order to run a executable

Hmm what does ./ do?
Life is run, it is dance, it is fast, passionate and BAM!, you dance and sing and booze while you can for now is the time and time is mine. Smile and laugh when still can for now is the time and soon you die!
Jank
Profile Blog Joined March 2008
United States308 Posts
January 07 2009 09:53 GMT
#26
On January 07 2009 18:52 evanthebouncy! wrote:
Show nested quote +
On January 07 2009 18:44 r3dox wrote:
u have to use ./a.out in order to run a executable

Hmm what does ./ do?

well in windows to run a program in console u just type the program name, but in bash on linux the ./ says you are trying to run something in the current directory
"You don't know you're wearing a leash if you sit by the peg all day." - Michael Parenti
evanthebouncy!
Profile Blog Joined June 2006
United States12796 Posts
January 07 2009 09:53 GMT
#27
Aside from that it's been a long night, partitioning my laptop till now, I'm very happy. I'm going to bed. Thanks alot everyone. Gnite!
Life is run, it is dance, it is fast, passionate and BAM!, you dance and sing and booze while you can for now is the time and time is mine. Smile and laugh when still can for now is the time and soon you die!
evanthebouncy!
Profile Blog Joined June 2006
United States12796 Posts
January 07 2009 09:54 GMT
#28
On January 07 2009 18:53 Therapy wrote:
Show nested quote +
On January 07 2009 18:52 evanthebouncy! wrote:
On January 07 2009 18:44 r3dox wrote:
u have to use ./a.out in order to run a executable

Hmm what does ./ do?

well in windows to run a program in console u just type the program name, but in bash on linux the ./ says you are trying to run something in the current directory

Then how come emacs work in every directory?
Life is run, it is dance, it is fast, passionate and BAM!, you dance and sing and booze while you can for now is the time and time is mine. Smile and laugh when still can for now is the time and soon you die!
Jank
Profile Blog Joined March 2008
United States308 Posts
January 07 2009 09:57 GMT
#29
Because its registered as an appliation in linux. Whereas programs you create or things not yet installed will need to be run using ./ if you wish to run them from current direction
"You don't know you're wearing a leash if you sit by the peg all day." - Michael Parenti
HeadBangaa
Profile Blog Joined July 2004
United States6512 Posts
January 07 2009 10:06 GMT
#30
Evan, are you Comp Sci? I thought you were something in social sciences, because your family is full of engineers and you wanted to c-c-c-combo break?

I assume you are not Comp Sci. I'm always excited to see people take up hobby programming! It is sooo enabling.

Let's see... I bought that same C book, read a few pages, and never opened it again. Yucky.

Ahh shit nevermind. I went over and grabbed this book from my boxes and am looking through it. It's not bad at all. I think I was thinking of a C++ book I bought that was written by the C++ author (yep I checked, I was thinking of Bjarne Stroustrup's The C++ Programming Language).

HERE WE GO

---------------------------------------------
DISCLAIMER: I AM NOT A LINUX EXPERT, BUT I USED IT THROUGHOUT COLLEGE. I HAVE A BS IN COMP SCI
---------------------------------------------

Let's start with your sexy Ubuntu environment. First thing, as a previous poster mentioned, make sure you have the incredible gcc ("GNU Compiler Collection") program installed. Basically, this all-in-one awesomeness will turn a simple text file into an executable program (it "compiles" your hand-written program). An executable on Unix/Linux is suffixed as ".out" whereas on Windows it is ".exe". You should expect gcc to spit out "a.out" (by default; this can be overriden) for any program you compile on Unix/Linux.

gcc works for many languages (thus, "all-in-one"). From their page:
The GNU Compiler Collection includes front ends for C, C++, Objective-C, Fortran, Java, and Ada, as well as libraries for these languages.


In other words, you can focus on the programming (fun stuff) instead of nasty library and dependency mangling.

(I won't go into details about the syntax of these commands, but you should read up on sudo and apt-get because this is essential Ubuntu/Linux stuff).

1) Update your Ubuntu installation files and install core utilities, including gcc
- open a terminal and enter these commands, one by one:
      sudo apt-get update
      sudo apt-get install build-essential

2) Choose a Linux text editor.
My favorite is vim ("Vi Improved"), which is a "modal text editor". It is an extended version of vi, an old school Unix editor.
My alma mater, UCSD, has a good introduction to vi and a brief addendum for vim.

This is the first challenge of programming. Learning how to use a REAL text editor! (the other "classic" alternative is emacs which some of my friends use, but I genuinely hate it. emacs is an editor. emacs is an operating system. emacs is a way of life. emacs is overkill).

Spend maybe 1 hour learning vim and you're set for life. It enables you to dominate text files without reaching for the mouse (gvim is a "cheater version" of vim that let's you click with mouse. Defeats the purpose, IMO).

Customizing vim is not necessary but very helpful. You can put default settings in your home directory. Just create a file named .vimrc in your home directory (cd ~) and put settings there. Here is my simple, conventional .vimrc file:

+ Show Spoiler +

" HeadBangaa's .vimrc
"
" 10/2008 -- for Cygwin VIM


" fix backspace, and make everything pretty
set backspace=2
set syntax=color
syntax on
colorscheme pablo

" set search behavior, ruler, and line numbers
set showmatch
set ignorecase
set ruler
set nu

" use real tabs of length=4
set softtabstop=4
set shiftwidth=4
set smartindent

" set screen size
set lines=52
set columns=80
set textwidth=80


3) Open your The [ANSI] C Programming Language (2nd Ed.) book and read pages 5-6
Ok this is a bit lazy of me, but there's no better start, really. To make sure your compiler and operating system are getting along, this walks you through the trivial "Hello, World!" program. One slight alteration: use gcc instead of cc ("cc" is a Unix dinosaur; Linux redirects "cc" to "gcc" anyways.)

If you're using vim as recommended:
      cd ~
      mkdir HelloWorld ; cd HelloWorld
      vim hello.c
This will create "hello.c" in a subdirectory of your home directory.

I suggest reading the rest of Chapter 1 as well!

4) ......

You've entered the world of C/Linux programming!! YOU FUCKING GEEK~!


Got any cool program ideas?
People who fail to distinguish Socratic Method from malicious trolling are sadly stupid and not worth a response.
HeadBangaa
Profile Blog Joined July 2004
United States6512 Posts
Last Edited: 2009-01-07 15:05:38
January 07 2009 10:07 GMT
#31
Ooops, your blog grew while I was typing all this. DON'T USE EMACS EVAN, NOOOOO!!!


looool my entire post is OBSOLETE. You don't have zero experience!!! LIAR!!!
People who fail to distinguish Socratic Method from malicious trolling are sadly stupid and not worth a response.
chiflutz
Profile Joined June 2006
Romania1025 Posts
Last Edited: 2009-01-07 13:34:57
January 07 2009 11:05 GMT
#32
For the initial problem, after compiling you want to do a chmod +x a.out, which sets its executable bit. Then you can run it with ./a.out.

Also, regarding the path issue, the /bin directory contains the most common binaries (or executables, as it were) of software currently on the system. /bin is in the path environment variable of every user, thus you can run emacs from any directory by simply typing emacs because your shell looks for a binary called "emacs" in every directory within your current path variable.

Right, I'm sleepy, I read some more posts. Therapy's code for even more Hello Worlds is right.

To search for files/directories from the command line there's the ancient locate tool. You need to run sudo updatedb or sudo locate -u to force a database update, wait a bit until it finishes indexing everything new, then use locate <search query>.

New programs are mostly installed in the same place, /usr subdirectories (most software) or /home subdirectories (e.g. your /home/<username> one, the default if you're prompted for an install path or if you're compiling the program from source). The /bin (and, respectively, /sbin) directories actually contain symlinks - think Windows-style shortcuts - to the actual files, with the exact same name.

Hope this makes sense to you. Have fun
kt violet Korea (South). July 27 2012 15:54. Posts 23
0xDEADBEEF
Profile Joined September 2007
Germany1235 Posts
Last Edited: 2009-01-07 13:14:39
January 07 2009 13:10 GMT
#33
You can't write "a.out" and expect Linux to find the file in the current directory because the current directory is never set in $PATH by default. In Windows, it is. But that is considered a small security risk because you might accidentally execute a file in the current directory which you didn't want to execute. So by default only the stuff in the "bin" directories (/bin /usr/bin /usr/local/bin) is set in $PATH and so the system finds it when you just type the name without a full or relative path in front.
If you want to have the same behavior as in Windows, do a export PATH=$PATH:. (notice the dot at the end - it stands for current directory, which will thus be appended to the already existing PATH variable). This will just last for the current shell session though - to make it permanent add it to your ~/.bash_profile (or ~/.bashrc if it is executed) - I'm not going into detail on these files, just know that they are automatically executed when you log in (at a shell), so it's some sort of Autorun for the shell.

Executables in Linux typically don't have any file extension (think of /bin/ls, /bin/bash etc.) but you could name them however you want to - even ".exe" although that would be confusing because it would not be executable on Windows (because both systems have a different format for executables).
gcc names an executable a.out by default but you can change that by just writing e.g. gcc -o exename src.c
Recommendation: use no extension or ".bin"
phase
Profile Blog Joined January 2008
United States399 Posts
Last Edited: 2009-01-07 13:21:22
January 07 2009 13:13 GMT
#34
This is the first challenge of programming. Learning how to use a REAL text editor! (the other "classic" alternative is emacs which some of my friends use, but I genuinely hate it. emacs is an editor. emacs is an operating system. emacs is a way of life. emacs is overkill).


The real reason vi is better than emacs: it was written by someone at UC Berkeley.... and you go to UC Berkeley. hehe.

But in all seriousness, I like to use it because it doesn't involve using the mouse at all. You just gotta figure out all the little keys and commands that let you do stuff like search/replace, cut/paste, etc.

I picked up vi by just knowing the most basic commands (i to insert, hjkl to navigate when not in insert mode, :w to save, :q to quit, :wq to save and quit, :q! to quit without saving, u to undo, and spamming esc to get out of whatever mode you were in previously), and then if I had to do something more complicated, looking up a hack on google until I memorized how to do it. Basically the list I spelled out in the ( ) is like 90% of what you use in vi.

Edit: Also useful for when you code, is creating an .exrc file (with vi as well lol), and in that file type these things:

:set number
:set autoindent
haduken
Profile Blog Joined April 2003
Australia8267 Posts
January 07 2009 13:15 GMT
#35
If you want your executable to run from anywhere, you need to place it in /bin or /usr/bin

this is obviously not advisable for your own compiled code so yeah unless you declared your own path environ, you need to invoke the binary with a ./ in the front in the current directory.

like others have said, you should use gcc and gdb to compile and debug your programs.

do man gcc or info gcc...

expect to read through a lot of man pages blah blah to geta hang of the common tools.

I would suggest you head down to O'Reily 's site and have a look browse through their linux PDFs (Most of their books are open sourced so you can download and read it as a pdf)

But honestly, this is all very much info overload for some one starting out.
Rillanon.au
haduken
Profile Blog Joined April 2003
Australia8267 Posts
January 07 2009 13:18 GMT
#36
Oh yeah, stick with Linux
It is so much easier (and free) to obtain tools to learn programming.

VI or VIM is so much superior to emac in just about any way possible but apple is apple, orange is orange.
Rillanon.au
0xDEADBEEF
Profile Joined September 2007
Germany1235 Posts
January 07 2009 13:29 GMT
#37
On January 07 2009 22:18 haduken wrote:
VI or VIM is so much superior to emac in just about any way possible but apple is apple, orange is orange.


Uhm, no? :p
Both editors are amazingly powerful, and both are also amazingly weird for someone who is used to Windows or Mac GUI editors.
Decide for yourself whether it's worth learning one of them - if you already know a bit about Emacs, just stick with it. There's nothing wrong with one or the other except from a personal preference perspective.
If you want a more Windows/Mac like editor, I can recommend JEdit 4.3+, or Eclipse as an IDE.
HeadBangaa
Profile Blog Joined July 2004
United States6512 Posts
January 07 2009 15:04 GMT
#38
Also, emacs key bindings are available for every editor that exists. Eclipse, etc. Still, use Vi!
People who fail to distinguish Socratic Method from malicious trolling are sadly stupid and not worth a response.
b3h47pte
Profile Blog Joined May 2007
United States1317 Posts
January 07 2009 16:03 GMT
#39
On January 07 2009 16:29 evanthebouncy! wrote:
Thx Tec, my eecs roomate recommended getting a linux for that because he says linux has the more natural compiler and windows has a shit compiler or something haha.
Hi Selbon, I use linux just to learn C, I still have windows.


The Visual Studios compiler is absolutely fine :|
azndsh
Profile Blog Joined August 2006
United States4447 Posts
January 07 2009 17:17 GMT
#40
lolol... I've never seen so much bad/wrong/completely offtopic responses in one thread

your original question has already been answered, but to summarize very quickly:
in linux, the command you type has to be built-in command ("cd", "ls", etc.) or a program in one of your executable folders which is specified by the PATH stuff (most likely "emacs", and tons of other common stuff "top", "less", etc. can be run just by typing their name)

"./" simply specifies the current folder you're in. you need need to specify a location to run programs not in the default executable folders (or you can add it to your PATH like people have mentioned though I don't recommend it).

basically, you don't need extra permissions to edit stuff in your personal folders, so you can't accidentally run a program and screw yourself over, and the "./" also means that you know you're running a program that's not in the executable folders
Prev 1 2 3 Next All
Please log in or register to reply.
Live Events Refresh
PiGosaur Cup
00:00
#74
PiGStarcraft227
Liquipedia
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
ProTech127
Nina 73
StarCraft: Brood War
GuemChi 5078
Soulkey 680
ggaemo 79
Bale 36
ajuk12(nOOB) 26
Icarus 6
Dota 2
febbydoto15
Counter-Strike
Stewie2K777
Super Smash Bros
C9.Mang0361
Other Games
PiGStarcraft220
Maynarde101
Livibee93
Organizations
Other Games
gamesdonequick903
Dota 2
PGL Dota 2 - Main Stream63
StarCraft 2
Blizzard YouTube
StarCraft: Brood War
BSLTrovo
sctven
[ Show 12 non-featured ]
StarCraft 2
• Berry_CruncH149
• practicex 43
• AfreecaTV YouTube
• intothetv
• Kozan
• IndyKCrew
• LaughNgamezSOOP
• Migwel
• sooper7s
StarCraft: Brood War
• BSLYoutube
• STPLYoutube
• ZZZeroYoutube
Upcoming Events
Replay Cast
2h 52m
Afreeca Starleague
3h 52m
hero vs YSC
Larva vs Shine
Kung Fu Cup
4h 52m
Replay Cast
17h 52m
KCM Race Survival
1d 2h
The PondCast
1d 3h
WardiTV Team League
1d 5h
OSC
1d 5h
Replay Cast
1d 17h
WardiTV Team League
2 days
[ Show More ]
RSL Revival
3 days
Cure vs Zoun
herO vs Rogue
WardiTV Team League
3 days
Platinum Heroes Events
3 days
BSL
3 days
RSL Revival
4 days
ByuN vs Maru
MaxPax vs TriGGeR
WardiTV Team League
4 days
BSL
4 days
Replay Cast
4 days
Replay Cast
5 days
Afreeca Starleague
5 days
Light vs Calm
Royal vs Mind
Wardi Open
5 days
Monday Night Weeklies
5 days
OSC
5 days
Sparkling Tuna Cup
6 days
Afreeca Starleague
6 days
Rush vs PianO
Flash vs Speed
Liquipedia Results

Completed

Proleague 2026-03-23
WardiTV Winter 2026
Underdog Cup #3

Ongoing

KCM Race Survival 2026 Season 1
BSL Season 22
CSL Elite League 2026
CSL Season 20: Qualifier 1
ASL Season 21
Acropolis #4 - TS6
RSL Revival: Season 4
Nations Cup 2026
NationLESS Cup
BLAST Open Spring 2026
ESL Pro League S23 Finals
ESL Pro League S23 Stage 1&2
PGL Cluj-Napoca 2026
IEM Kraków 2026
BLAST Bounty Winter 2026
BLAST Bounty Winter Qual

Upcoming

2026 Changsha Offline CUP
CSL Season 20: Qualifier 2
CSL 2026 SPRING (S20)
Acropolis #4
IPSL Spring 2026
BSL 22 Non-Korean Championship
CSLAN 4
Kung Fu Cup 2026 Grand Finals
HSC XXIX
uThermal 2v2 2026 Main Event
IEM Cologne Major 2026
Stake Ranked Episode 2
CS Asia Championships 2026
IEM Atlanta 2026
Asian Champions League 2026
PGL Astana 2026
BLAST Rivals Spring 2026
CCT Season 3 Global Finals
IEM Rio 2026
PGL Bucharest 2026
Stake Ranked Episode 1
TLPD

1. ByuN
2. TY
3. Dark
4. Solar
5. Stats
6. Nerchio
7. sOs
8. soO
9. INnoVation
10. Elazer
1. Rain
2. Flash
3. EffOrt
4. Last
5. Bisu
6. Soulkey
7. Mini
8. Sharp
Sidebar Settings...

Advertising | Privacy Policy | Terms Of Use | Contact Us

Original banner artwork: Jim Warren
The contents of this webpage are copyright © 2026 TLnet. All Rights Reserved.