• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EDT 17:12
CEST 23:12
KST 06:12
  • 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
RSL Season 1 - Final Week6[ASL19] Finals Recap: Standing Tall12HomeStory Cup 27 - Info & Preview18Classic wins Code S Season 2 (2025)16Code S RO4 & Finals Preview: herO, Rogue, Classic, GuMiho0
Community News
Firefly given lifetime ban by ESIC following match-fixing investigation17$25,000 Streamerzone StarCraft Pro Series announced7Weekly Cups (June 30 - July 6): Classic Doubles7[BSL20] Non-Korean Championship 4x BSL + 4x China10Flash Announces Hiatus From ASL85
StarCraft 2
General
TAKE CONTROL OF YOUR LOSS CRYPTO-HIRE RAPID DIGITA RSL Revival patreon money discussion thread The GOAT ranking of GOAT rankings Weekly Cups (June 30 - July 6): Classic Doubles Server Blocker
Tourneys
$5,100+ SEL Season 2 Championship (SC: Evo) WardiTV Mondays RSL: Revival, a new crowdfunded tournament series Sparkling Tuna Cup - Weekly Open Tournament FEL Cracov 2025 (July 27) - $8000 live event
Strategy
How did i lose this ZvP, whats the proper response Simple Questions Simple Answers
Custom Maps
External Content
Mutation # 482 Wheel of Misfortune Mutation # 481 Fear and Lava Mutation # 480 Moths to the Flame Mutation # 479 Worn Out Welcome
Brood War
General
Flash Announces Hiatus From ASL BW General Discussion [ASL19] Finals Recap: Standing Tall BGH Auto Balance -> http://bghmmr.eu/ A cwal.gg Extension - Easily keep track of anyone
Tourneys
[Megathread] Daily Proleagues 2025 ACS Season 2 Qualifier Small VOD Thread 2.0 Last Minute Live-Report Thread Resource!
Strategy
Simple Questions, Simple Answers I am doing this better than progamers do.
Other Games
General Games
Path of Exile Stormgate/Frost Giant Megathread CCLP - Command & Conquer League Project The PlayStation 5 Nintendo Switch Thread
Dota 2
Official 'what is Dota anymore' discussion
League of Legends
Heroes of the Storm
Simple Questions, Simple Answers Heroes of the Storm 2.0
Hearthstone
Heroes of StarCraft mini-set
TL Mafia
TL Mafia Community Thread Vanilla Mini Mafia
Community
General
US Politics Mega-thread Summer Games Done Quick 2025! Russo-Ukrainian War Thread Things Aren’t Peaceful in Palestine The Accidental Video Game Porn Archive
Fan Clubs
SKT1 Classic Fan Club! Maru Fan Club
Media & Entertainment
Movie Discussion! [Manga] One Piece Anime Discussion Thread [\m/] Heavy Metal Thread
Sports
2024 - 2025 Football Thread Formula 1 Discussion NBA General Discussion TeamLiquid Health and Fitness Initiative For 2023 NHL Playoffs 2024
World Cup 2022
Tech Support
Computer Build, Upgrade & Buying Resource Thread
TL Community
The Automated Ban List
Blogs
Men Take Risks, Women Win Ga…
TrAiDoS
momentary artworks from des…
tankgirl
from making sc maps to makin…
Husyelt
StarCraft improvement
iopq
Trip to the Zoo
micronesia
Customize Sidebar...

Website Feedback

Closed Threads



Active: 619 users

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

Blogs > evanthebouncy!
Post a Reply
Normal
evanthebouncy!
Profile Blog Joined June 2006
United States12796 Posts
Last Edited: 2009-01-07 21:00:51
January 07 2009 06:56 GMT
#1
I've exhausted my question for this entry, I'll bug u guys later :D /thread

So I'm doing the first example of the textbook now... I ran into trouble.

In Emacs
yada.c:
===
#include <stdio.h>

main()
{
printf("hello, world\n");
}
===

In Terminal
evan@Evan-Box:~/Documents/tryingout$ cc yada.c
evan@Evan-Box:~/Documents/tryingout$ ls
a.out yada.c yada.c~
evan@Evan-Box:~/Documents/tryingout$ a.out
bash: a.out: command not found



nvm got it
evan@Evan-Box:~/Documents/tryingout$ a.out
bash: a.out: command not found
evan@Evan-Box:~/Documents/tryingout$ ~/Documents/tryingout/a.out
hello, world

So what did I do wrong? It seems I could type "emacs" in anywhere on the directory and emacs would run, but my a.out need to be specified by ~/Documents/tryingout/a.out for it to run... hmm

**
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 06:57 GMT
#2
I'll be watching this blog constantly for the next 1 hour until I get answers xD
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!
selboN
Profile Blog Joined January 2008
United States2523 Posts
January 07 2009 07:14 GMT
#3
You got a Linux n stuff....
So now you can't play iCCup n stuff...
You can't use Chaos Launcher n stuff...
Poor guy I feel your pain.
At least you won't have virus issues. People don't code viruses for Linux very often.
"That's what happens when you're using a mouse made out of glass!" -Tasteless (Referring to ZergBong)
tec27
Profile Blog Joined June 2004
United States3696 Posts
January 07 2009 07:18 GMT
#4
Why you had to get linux to do C programming I don't know, but ah well

C is made in files that are basically .txt, but different extension (.h and .c). You compile those through gcc and link them and such, so that's what you'll be using mainly. Getting emacs can depend on your distro, but knowing Ubuntu, you probably already have it (I dunno though, never used Ubuntu). Someone more well-versed in C will have to help you with the rest
Can you jam with the console cowboys in cyberspace?
evanthebouncy!
Profile Blog Joined June 2006
United States12796 Posts
January 07 2009 07:29 GMT
#5
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.
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!
datscilly
Profile Blog Joined November 2007
United States528 Posts
January 07 2009 07:33 GMT
#6
I'm using Ubuntu and I find that emacs is not automatically installed. You can easily install it through "Add/Remove.." Applications.
IzzyCraft
Profile Blog Joined June 2007
United States4487 Posts
January 07 2009 07:34 GMT
#7
GNU GCC complier not good enough?
I have ass for brains so,
even when I shit I'm droping knowledge.
evanthebouncy!
Profile Blog Joined June 2006
United States12796 Posts
January 07 2009 07:53 GMT
#8
On January 07 2009 16:34 IzzyCraft wrote:
GNU GCC complier not good enough?

:p I have no idea what are you talking about. I have 0 experience, please explain
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!
cgrinker
Profile Blog Joined December 2007
United States3824 Posts
January 07 2009 08:12 GMT
#9
They made me get linux yesterday too at school for java.

Here's what you do. Edit the program in a text file inbuntu should come with a text editor. Put the file in the folder that you want to compile in, and then get your compiler up and running. Basically you can do it with the command prompt if you navigate to the right folder and then use whatever C command to run your compiler. I would look in your compiler documentation for that though.


Or run it in windows and feel better about your life because you aren't a open source zealot.
cgrinker
Profile Blog Joined December 2007
United States3824 Posts
January 07 2009 08:13 GMT
#10
Wait if your roommate told you how to do it why didn't you ask him? Just saying.
cgrinker
Profile Blog Joined December 2007
United States3824 Posts
January 07 2009 08:14 GMT
#11
And furthermore isn't C a little archaic? Is this for a class or did you decide that you wanted to make yourself suffer by learning to program in a language that is really really effing difficult?
Slithe
Profile Blog Joined February 2007
United States985 Posts
January 07 2009 08:18 GMT
#12
Out of curiosity, what do you plan on learning C for anyway? Depending on what you want to do, there may be a better language suited for your purposes.
IzzyCraft
Profile Blog Joined June 2007
United States4487 Posts
January 07 2009 08:24 GMT
#13
Well if you're just learning how to program there is probably no better language then C imo and i do believe it's true native linux's support C much better then windows. Anyways what i mentioned is probably the most used compiler used for any C work unless professional. Which can always be done though cmd prompt like alot of things it just doesn't come native to windows.
I have ass for brains so,
even when I shit I'm droping knowledge.
thedeadhaji *
Profile Blog Joined January 2006
39489 Posts
January 07 2009 08:36 GMT
#14
Kernighannn is an awesomee guuyyyyyyyyyyyy had him as faculty @ Pton
hymn
Profile Blog Joined February 2008
Bulgaria832 Posts
January 07 2009 08:37 GMT
#15
Like stated, you make text files with a text editor, doesn't matter if it's graphical or in the console. Then navigate the compiler to the file and compile it.

The extensions in Linux don't matter, while the permissions the files have - DO matter. I mean no matter what the file extension is, you can compile it with a C compiler as long as you have the permissions to do so.
azk he is the north american player but the titan he is the french stars
evanthebouncy!
Profile Blog Joined June 2006
United States12796 Posts
Last Edited: 2009-01-07 09:02:42
January 07 2009 08:44 GMT
#16
K guys thanks.
Is there anyway to find out if a certain application is on my system?
Say I want to search for starcraft, how do I do that in the terminal?
Now say I want to execute the program starcraft, how do that do that in the terminal?(Just type starcraft I guess? I typed emacs and it ran)
thanks!
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 08:58 GMT
#17
Alrite I just typed emacs in the terminal and it prompted me to install it. SO I guess I'll have emacs now.
Now quesiton is:
Where is emacs? It did not ask me where to put emacs and now I dunno where it is haha

All previous question still pertains.
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!
thedeadhaji *
Profile Blog Joined January 2006
39489 Posts
January 07 2009 09:01 GMT
#18
alternatives

emacs
xemcas
V
MasterOfChaos
Profile Blog Joined April 2007
Germany2896 Posts
January 07 2009 09:04 GMT
#19
If you want to use win, you could get Visual Studio Express which might be a bit more familiar. Emacs, GDB, etc might be powerful, but they are quite different from what a windowser is used to.
To play SC you need to install wine, as there is no linux native version of SC. And why do you want to do everything in the terminal? To manage apps there should be some packetmanager. But I don't know which one it is for your distri.
LiquipediaOne eye to kill. Two eyes to live.
evanthebouncy!
Profile Blog Joined June 2006
United States12796 Posts
January 07 2009 09:22 GMT
#20
Hai, I know how to use emacs.
I am not saying I want to play sc, I'm just using sc as an example of a program. I am asking how do I run a program from the terminal. So far my understanding is you just type the program.

For instance I jsut got emacs and to run it I just go
yadayada$Emacs&

and it'll run it for me.
Is my interpretation correct?
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: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
naventus
Profile Blog Joined February 2004
United States1337 Posts
January 07 2009 20:28 GMT
#41
On January 08 2009 02:17 azndsh wrote:
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


^This.

If you type this: echo $PATH

It will tell you what your current PATH variable is set to, which will be a list of a bunch of directories. This means that the shell looks for executables in those directories. Now, your a.out file is not in one of those directories - therefore it can't just run by command.

If you added your folder to the PATH variable (google that), you would be able to run an executable without specifying the entire path.
hmm.
evanthebouncy!
Profile Blog Joined June 2006
United States12796 Posts
January 07 2009 21:00 GMT
#42
Okay thanks
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!
Normal
Please log in or register to reply.
Live Events Refresh
BSL20 Non-Korean Champi…
18:00
RO8 Round Robin Group - Day 2
Bonyth vs Dewalt
QiaoGege vs Dewalt
Hawk vs Bonyth
Sziky vs Fengzi
Mihu vs Zhanhun
QiaoGege vs Zhanhun
Fengzi vs Mihu
ZZZero.O287
LiquipediaDiscussion
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
ProTech80
SpeCial 23
StarCraft: Brood War
firebathero 326
ZZZero.O 287
LaStScan 134
Aegong 89
Dota 2
syndereN312
canceldota119
League of Legends
Grubby5133
Dendi1334
Counter-Strike
fl0m1756
pashabiceps1196
chrisJcsgo106
Super Smash Bros
hungrybox840
Heroes of the Storm
Khaldor408
Other Games
summit1g10582
B2W.Neo1751
mouzStarbuck292
Pyrionflax120
Sick71
ROOTCatZ61
Organizations
Other Games
gamesdonequick4859
EGCTV2544
BasetradeTV34
StarCraft 2
Blizzard YouTube
StarCraft: Brood War
BSLTrovo
sctven
[ Show 21 non-featured ]
StarCraft 2
• musti20045 26
• Hupsaiya 9
• davetesta6
• Kozan
• IndyKCrew
• sooper7s
• AfreecaTV YouTube
• Migwel
• intothetv
• LaughNgamezSOOP
StarCraft: Brood War
• Pr0nogo 8
• STPLYoutube
• ZZZeroYoutube
• BSLYoutube
Dota 2
• C_a_k_e 3634
• masondota22073
• Ler93
League of Legends
• Doublelift3781
Other Games
• imaqtpie2429
• Scarra1558
• Shiphtur192
Upcoming Events
Wardi Open
13h 48m
Replay Cast
1d 12h
WardiTV European League
1d 18h
PiGosaur Monday
2 days
uThermal 2v2 Circuit
2 days
Replay Cast
3 days
The PondCast
3 days
Replay Cast
4 days
Epic.LAN
4 days
CranKy Ducklings
5 days
[ Show More ]
Epic.LAN
5 days
BSL20 Non-Korean Champi…
5 days
Bonyth vs Sziky
Dewalt vs Hawk
Hawk vs QiaoGege
Sziky vs Dewalt
Mihu vs Bonyth
Zhanhun vs QiaoGege
QiaoGege vs Fengzi
Sparkling Tuna Cup
6 days
Online Event
6 days
BSL20 Non-Korean Champi…
6 days
Bonyth vs Zhanhun
Dewalt vs Mihu
Hawk vs Sziky
Sziky vs QiaoGege
Mihu vs Hawk
Zhanhun vs Dewalt
Fengzi vs Bonyth
Liquipedia Results

Completed

KCM Race Survival 2025 Season 2
HSC XXVII
NC Random Cup

Ongoing

JPL Season 2
BSL 2v2 Season 3
Acropolis #3
CSL 17: 2025 SUMMER
Copa Latinoamericana 4
Jiahua Invitational
2025 ACS Season 2: Qualifier
BSL20 Non-Korean Championship
Championship of Russia 2025
Murky Cup #2
BLAST.tv Austin Major 2025
ESL Impact League Season 7
IEM Dallas 2025
PGL Astana 2025
Asian Champions League '25
BLAST Rivals Spring 2025
MESA Nomadic Masters

Upcoming

CSL Xiamen Invitational
CSL Xiamen Invitational: ShowMatche
2025 ACS Season 2
CSLPRO Last Chance 2025
CSLPRO Chat StarLAN 3
BSL Season 21
K-Championship
RSL Revival: Season 2
uThermal 2v2 Main Event
SEL Season 2 Championship
FEL Cracov 2025
Esports World Cup 2025
Underdog Cup #2
StarSeries Fall 2025
FISSURE Playground #2
BLAST Open Fall 2025
BLAST Open Fall Qual
Esports World Cup 2025
BLAST Bounty Fall 2025
BLAST Bounty Fall Qual
IEM Cologne 2025
FISSURE Playground #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 © 2025 TLnet. All Rights Reserved.