Download your favorite Linux distribution at LQ ISO.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 06-26-2004, 01:23 PM   #1
Registered: May 2004
Location: Israel
Distribution: Debian
Posts: 98

Rep: Reputation: 15
what the command [source] does ?

it has nothing to do with "compile from source", right?
i tried to man, info for it but that didn't told me anything.

what [source ... ] does & how / when should i use it ?

thank you.
Old 06-26-2004, 04:03 PM   #2
Senior Member
Registered: Aug 2003
Location: New Delhi, India
Distribution: Fedora 7
Posts: 1,305

Rep: Reputation: 45
First of all, you need to phrase your questions well. That would help you fetch better answers.

Now, if you do
man source

You will find the manual page of source. The man pages are your best friend. Scroll down a little and you find the description of source
#source filename [arguments]
Read and execute commands from filename in the current shell
environment and return the exit status of the last command exe-
cuted from filename.
Old 06-26-2004, 04:33 PM   #3
Registered: May 2004
Location: Israel
Distribution: Debian
Posts: 98

Original Poster
Rep: Reputation: 15

LinuxLala, how would you prefer i asked the question?
if it wasn't clear enough from the title then sorry i tried to do this as informative as possible.

now about [man source], believe me i did this, i also did [info source] & i searched linuxquestion for posts about the command (as you might guess posts with the word source are not hard to find in linux forum)
now look i'm copying (by hand) from my linux screen onto my xp machine because i do not know how to get a linux
shell from windows yet .

$ man source


bash, :, ., [, alias, bg, bind, break, builtin, cd, command, compgen,
complete, continue, declare, dirs, disown, echo, enable, eval, exec,
exit, export, fc, fg, getopts, hash, help, history, jobs, kill, let,
local, logout, popd, printf, pushd, pwd, read, readonly, return, set,
shift, shopt, source, suspend, test, times, trap, type, typeset,
ulimit, umask, unalias, unset, wait - bash built-in commands, see
bash(1), sh(1)
you see when i type [man source] i get a list of all the basic commands available to me from bash and nothing more, this is on mandrake 10.0.
Old 06-26-2004, 05:05 PM   #4
Senior Member
Registered: May 2004
Location: In the DC 'burbs
Distribution: Arch, Scientific Linux, Debian, Ubuntu
Posts: 4,284

Rep: Reputation: 371Reputation: 371Reputation: 371Reputation: 371
Source is a bash builtin command, and all those commands are grouped together into one man page. If you had scrolled down, you would have seen a description of what source does. As LinuxLala says, it executes a file in the current bash shell environment. It's mostly useful for configuring environment -- for instance, I might want to make a bunch of custom aliases, or tweak my PATH or whatever. I would put the commands to do so in my .bashrc file, but that only gets read when I login or start a new shell. If I want my new things to apply to the shell I'm working under now, I do source .bashrc and that runs the .bashrc and applies any new aliases or environment variable settings to my current terminal session.

BTW -- you should look into ssh as a way to get a terminal on your Linux machine from a separate Windows machine.
Old 06-26-2004, 05:09 PM   #5
Senior Member
Registered: Aug 2003
Location: New Delhi, India
Distribution: Fedora 7
Posts: 1,305

Rep: Reputation: 45
If only you scroll down, using the down arrow key 'coz mouse scroll doesn't work, comes the description I gave.

This is some online man page for source. Don't know how old this is

About me saying you didn't frame your question right, I mean't
what [source ... ] does & how / when should i use it ?
I didn't understand the / part.

I understand how difficult it can be to search at LQ BTW, what Linux distribution are you running?

[EDIT}: The perils of keeping tabs open for too long and not replying sooner, someone else posts sooner, the same thing

btmiller, you are right, Cheers.

Last edited by LinuxLala; 06-26-2004 at 05:12 PM.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Where i can get source code of the 'cp' command? chaits Linux - General 5 11-22-2010 10:50 PM
about the source command kpachopoulos Linux - General 2 06-12-2005 09:16 PM
Linux Command Source Codes GodSendDeath Slackware 1 03-12-2004 04:12 AM
Where is source for 'who' command grittkmg Programming 2 10-15-2003 02:49 PM
What is the source (Bash) command do ? Linh Linux - General 5 06-09-2003 05:46 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 11:12 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration