Linux Command Basics(ls and pwd)

Any other programming projects not covered in the other sections.

Linux Command Basics(ls and pwd)

Postby super3boy » Sun Dec 02, 2007 4:39 pm

Many people have wrote text tutorials for the site so I am going to do the same. Currently I am using Xandros which is a sub of Debian.

If you don't have a linux operating system grab yourself a live cd here: http://slax.hosting4p.com/download.php

I after your in your distro you have to get into command line. This will vary from distro to distro so I recommend you google it if you don't know where it is.

Google


Lets get started for my EEE pc I just hit atl+ctrl+t and the terminal pops up. Your screen should look somewhat like this:

console1.png
console1.png (9.91 KiB) Viewed 12151 times


Now the first command we are going to try is "ls" so just type in ls and press enter. After you do this you should be presented with something like this:
console2.png
console2.png (10.62 KiB) Viewed 12132 times


ls basically list any directories or files in your current directory, which brings us to out next command pwd. This prints out the current directory like so:
console3.png
console3.png (11.08 KiB) Viewed 12091 times


Well thats it for this tutorial. See you in the next one.
Image
Image
Image
Image
User avatar
super3boy
Site Admin
Site Admin
 
Posts: 4945
Joined: Sun May 20, 2007 3:57 pm
Location: Atlanta, GA

Re: Linux Command Basics(ls and pwd)

Postby Roswell » Sun Dec 02, 2007 4:58 pm

I'll add onto that a bit:

ls is more or less useless without a few other handy commands. For one, ls has a few flags you can use, the most helpful of which being
Code: Select all
ls -a
This will show all of the files is the current directory, including hidden ones. Nextly, there is cd, which is used to (you guessed it) change directory.
Code: Select all
cd mydir
can be used to change directory to mydir, which
Code: Select all
cd ..
can be used to switch to the parent directory (in any operating system, .. means "one directory higher").
Roswell
Moderator Team
Moderator Team
 
Posts: 2631
Joined: Thu Jul 05, 2007 5:06 pm

Re: Linux Command Basics(ls and pwd)

Postby nilamo » Sun Dec 02, 2007 7:33 pm

Code: Select all
ls -l

shows all files and directories within the current directory, along with the owner and permissions.

more cd fun...
Code: Select all
cd /

Change to root.
Code: Select all
cd ~

Change to your home directory. This is probably /home/yourname

Code: Select all
mkdir foo

makes a directory, called 'foo', within your current directory.

For more fun, look into rm, chmod, chown, pidof, and kill. Maybe even nano/vim/joe for text editing.
I don't .blend
User avatar
nilamo
Member
Member
 
Posts: 603
Joined: Thu Oct 11, 2007 2:50 pm
Location: The top of a tall tower, waiting for the bricks at the bottom to crumble so I can fall back down.

Re: Linux Command Basics(ls and pwd)

Postby super3boy » Sun Dec 02, 2007 8:37 pm

Looks like we all know a little linux here. I am going to try to do a tutorial everyday.
Image
Image
Image
Image
User avatar
super3boy
Site Admin
Site Admin
 
Posts: 4945
Joined: Sun May 20, 2007 3:57 pm
Location: Atlanta, GA

Re: Linux Command Basics(ls and pwd)

Postby Brent » Mon Dec 03, 2007 12:14 pm

super3boy wrote:Looks like we all know a little linux here. I am going to try to do a tutorial everyday.

Some linux commands work in cmd too. Except for ls (which is dir in cmd) and pwd (I don't know if there is a command equal to that in cmd) on those listed above.
Image
User avatar
Brent
Premium Member
Premium Member
 
Posts: 1821
Joined: Wed May 23, 2007 8:38 pm
Location: AZ, USA

Re: Linux Command Basics(ls and pwd)

Postby nilamo » Mon Dec 03, 2007 2:51 pm

dir also works with a lot of linux distros, but it's limited to just listing files.
I don't .blend
User avatar
nilamo
Member
Member
 
Posts: 603
Joined: Thu Oct 11, 2007 2:50 pm
Location: The top of a tall tower, waiting for the bricks at the bottom to crumble so I can fall back down.

Re: Linux Command Basics(ls and pwd)

Postby super3boy » Thu Dec 06, 2007 10:52 pm

Which is better? Linux or windows command line.
Image
Image
Image
Image
User avatar
super3boy
Site Admin
Site Admin
 
Posts: 4945
Joined: Sun May 20, 2007 3:57 pm
Location: Atlanta, GA

Re: Linux Command Basics(ls and pwd)

Postby Roswell » Thu Dec 06, 2007 11:06 pm

Linux.
Roswell
Moderator Team
Moderator Team
 
Posts: 2631
Joined: Thu Jul 05, 2007 5:06 pm

Re: Linux Command Basics(ls and pwd)

Postby super3boy » Fri Dec 07, 2007 9:56 pm

I agree.
Image
Image
Image
Image
User avatar
super3boy
Site Admin
Site Admin
 
Posts: 4945
Joined: Sun May 20, 2007 3:57 pm
Location: Atlanta, GA

Re: Linux Command Basics(ls and pwd)

Postby nilamo » Sat Dec 08, 2007 1:57 am

I installed Cygwin just because I didn't like cmd. On the plus side, I make use of wget pretty regularly.
I don't .blend
User avatar
nilamo
Member
Member
 
Posts: 603
Joined: Thu Oct 11, 2007 2:50 pm
Location: The top of a tall tower, waiting for the bricks at the bottom to crumble so I can fall back down.

Next

Return to Other Programming

Who is online

Users browsing this forum: No registered users and 1 guest

cron