LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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!

Notices


Reply
  Search this Thread
Old 07-24-2008, 06:30 AM   #1
jamesubuntufan
LQ Newbie
 
Registered: Aug 2007
Posts: 20

Rep: Reputation: 0
Trouble using simple commands in terminal


Hi,

I've been using ubuntu for a while but am not really experienced in the more technical side of things. I've decided to start using the terminal and thought i'd go to the linux help guide for help on commands.

I now know some basic commands, but i just can't work out how to use the "cd" command correctly.

I've tryed everything. I use the "pwd" command, to find out what directory i'm in, but how to i move around using "cd"???

I can use sudo and apt get, but not cd.

Thanks,
 
Old 07-24-2008, 06:34 AM   #2
Nylex
LQ Addict
 
Registered: Jul 2003
Location: London, UK
Distribution: Slackware
Posts: 7,464

Rep: Reputation: Disabled
I don't understand what you have trouble with. You just pass the directory you want to change to as an argument to cd. For example,

cd /usr/bin

will change your current directory to /usr/bin. Some things to note: "cd -" will take you to the previous directory and "cd .." will take you up a level in the tree (e.g from /usr/bin to /usr). You can use .. multiple times in a path, since it is shorthand for the parent directory (e.g. from /usr/local/bin, doing "cd ../../ will take you to /usr).
 
Old 07-24-2008, 07:07 AM   #3
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.8, Centos 5.10
Posts: 17,260

Rep: Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328
cd
on its own takes you back to your home dir
 
Old 07-24-2008, 08:53 AM   #4
PersonaErazed
LQ Newbie
 
Registered: Jul 2008
Location: /usa/newjersey
Distribution: Slackware 12.1
Posts: 4

Rep: Reputation: 0
Try reading Slackbook, it has tons of great unix tips. helped me lots
slackbook.org
 
Old 07-24-2008, 09:02 AM   #5
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Arch/XFCE
Posts: 17,802

Rep: Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738
If you use something like the Slackbook, you'll have to ignore a lot of stuff that is unique to Slackware.

Books I recommend:

Linux in a Nutshell from O'Reilly

Bash Guide for Beginners, free at http://tldp.org

for the basics on the "core utilities" (including cd), enter "man bash" in the terminal
 
Old 07-24-2008, 11:41 AM   #6
kenoshi
Member
 
Registered: Sep 2007
Location: SF Bay Area, CA
Distribution: CentOS, SLES 10+, RHEL 3+, Debian Sarge
Posts: 159

Rep: Reputation: 32
I recommend this book if you plan on learning shells:

http://www.amazon.com/gp/product/013...pr_product_top

Ellie Quigley is pretty well known in the field, authored quite a few first rate books, and is a great instructor...I've taken some of her classes in the past, she is top notch.
 
Old 07-24-2008, 11:47 AM   #7
dasy2k1
Member
 
Registered: Oct 2005
Location: 127.0.0.1
Distribution: Ubuntu 12.04 X86_64
Posts: 958

Rep: Reputation: 35
just
cd then the directory you want

eg
cd /usr/bin to get to /usr/bin

if you are allready in /usr then you just do
cd bin

for more information try
man cd
 
Old 07-24-2008, 10:39 PM   #8
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.8, Centos 5.10
Posts: 17,260

Rep: Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328
Read/bookmark this

http://tldp.org/LDP/Bash-Beginners-G...tml/index.html

then

http://www.tldp.org/LDP/abs/html/

and for Linux at the cmd line in general

http://rute.2038bug.com/index.html.gz
 
Old 07-24-2008, 10:58 PM   #9
Mr. C.
Senior Member
 
Registered: Jun 2008
Posts: 2,529

Rep: Reputation: 61
Many new users have trouble spatially or conceptually with the inverted tree metaphor for the file system . Going "up" or "down" the directory tree isn't immediately comfortable to them. Even though they may be able to dive from one folder into a sub-folder in a GUI explorer, there is still a hierarchical disconnect. Pictures often help solidify the abstraction, especially for those more visual.

Students seemed to like some of the graphics I created for Unix intro course:

http://cis68a.mikecappella.com/

See Coursework, Week 2 Notes "Files, Directories, Permissions and Ownership"
 
Old 07-26-2008, 10:45 AM   #10
jamesubuntufan
LQ Newbie
 
Registered: Aug 2007
Posts: 20

Original Poster
Rep: Reputation: 0
ok

Thankyou to everybody who posted here.

I think my problem is i don't know what directories there are in my system.

Using the GUI, how do i find out which directories there are?

Also, what is the full definition of a directory?

Thanks,
jamesubuntufan.
 
Old 07-26-2008, 10:56 AM   #11
Nylex
LQ Addict
 
Registered: Jul 2003
Location: London, UK
Distribution: Slackware
Posts: 7,464

Rep: Reputation: Disabled
Quote:
Originally Posted by jamesubuntufan View Post
Using the GUI, how do i find out which directories there are?
Use whatever file manager you use. In the command line, ls will tell you which files and directories are in the current directory and pwd will tell you the current working directory (but you may not need it because the directory may be shown in your prompt). / is the root of the filesystem hierarchy.

Quote:
Also, what is the full definition of a directory?
A kind of file that contains other files?
 
  


Reply


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
making a script that opens terminal and enter commands into that terminal Cinematography Linux - General 8 12-16-2008 11:34 AM
Need help for Windows cmd commands into Linux terminal commands. windowsNilo Linux - Software 2 07-02-2008 07:26 PM
Need help for Windows cmd commands into Linux terminal commands. windowsNilo Linux - General 2 07-01-2008 07:53 AM


All times are GMT -5. The time now is 05:22 AM.

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