LinuxQuestions.org
Visit the LQ Articles and Editorials section
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 05-04-2013, 01:52 PM   #1
computergirl121
LQ Newbie
 
Registered: May 2013
Posts: 24

Rep: Reputation: Disabled
Is there another way to go to top level?


Is there another way to go from /etc to top level other than by using 'cd /'?
 
Old 05-04-2013, 01:55 PM   #2
273
Senior Member
 
Registered: Dec 2011
Location: UK
Distribution: Debian Sid AMD64, Raspbian Wheezy, various VMs
Posts: 3,508

Rep: Reputation: 800Reputation: 800Reputation: 800Reputation: 800Reputation: 800Reputation: 800Reputation: 800
You could type:
Code:
cd ..
Why are you asking -- what is it you want to achieve?
 
Old 05-04-2013, 02:05 PM   #3
computergirl121
LQ Newbie
 
Registered: May 2013
Posts: 24

Original Poster
Rep: Reputation: Disabled
Hello,
I am trying to learn Linux from a book I got from the library. It was explaining top level, I had learned it was 'cd /'.Then the book said there was other ways to get to this location but didn't state what those ways were. That is why I had asked if there was another command. WHEW these Linux commands and levels in security is driving me crazy. LOL. I think I need to take a class. I thought I could self teach due to me knowing Windows. I am going to go on my virtual Fedora and check it out. Thanks
 
Old 05-04-2013, 06:51 PM   #4
John VV
Guru
 
Registered: Aug 2005
Posts: 13,271

Rep: Reputation: 1775Reputation: 1775Reputation: 1775Reputation: 1775Reputation: 1775Reputation: 1775Reputation: 1775Reputation: 1775Reputation: 1775Reputation: 1775Reputation: 1775
from your normal user $HOME folder
Code:
cd ../../
--- but this is less typing --- 
cd /
 
1 members found this post helpful.
Old 05-05-2013, 01:10 PM   #5
jefro
Guru
 
Registered: Mar 2008
Posts: 11,967

Rep: Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484
I had to look that up.

cd either . or .. is normal. Dot and dot dot are current and first upper subdirectory.


cd to some direct place such as / or /bin/usr/ is common also


Somewhat common is plain cd which usually goes back to your /home directory but is set with command.

The most uncommon of all may be the -.

If you were to go from some directory to some then want to go back, you'd then use cd -

There are also ways to change what program cd is and how it acts but most people use the built in cd as is.

Good to know command.
 
1 members found this post helpful.
Old 05-05-2013, 03:55 PM   #6
David the H.
Bash Guru
 
Registered: Jun 2004
Location: Osaka, Japan
Distribution: Debian sid + kde 3.5 & 4.4
Posts: 6,823

Rep: Reputation: 1950Reputation: 1950Reputation: 1950Reputation: 1950Reputation: 1950Reputation: 1950Reputation: 1950Reputation: 1950Reputation: 1950Reputation: 1950Reputation: 1950
I'd say there really are no other options. It's just cd with either an absolute or relative path. And frankly there's no need for anything else. In bash running "help cd" will give you a general description of it, and the SHELL BUILTIN COMMANDS section of the the bash man page will give you a bit more. (cd has to be built-in since it has to modify the current shell environment.)

The only other commands available for changing directories, at least in bash, are pushd/popd, and those are really just a directory stack tracking wrapper for cd.

By the way, in case you're wondering . and .. are not some kind of shell built in shortcut but actual directory names. They're hardlinks to the current and parent directory respectively, automatically created by the filesystem.
 
Old 05-05-2013, 04:35 PM   #7
computergirl121
LQ Newbie
 
Registered: May 2013
Posts: 24

Original Poster
Rep: Reputation: Disabled
This has helped me a lot. I appreciate your help. Thank you. I love Linux I just never knew it was so advanced behind the scenes. I will conquer this. LOL
 
Old 05-06-2013, 09:30 PM   #8
PTrenholme
Senior Member
 
Registered: Dec 2004
Location: Olympia, WA, USA
Distribution: Fedora, (K)Ubuntu
Posts: 4,153

Rep: Reputation: 331Reputation: 331Reputation: 331Reputation: 331
There are, however, many other ways to move around the file system. As you are coming from a Windows background, and using Fedora, the easiest way for you might be to start nautilus or gnome-commander so you have a GUI view of things (sort of a grown-up version of the Windows "Computer" page).

Underneath the GUI hood, the cd command will be used, but you won't directly use it. (Technically, the cd command and the GUI programs are both, under their hoods, probably using calls to the Linux chdir function. [I have NOT verified that comment with the source code.])

Note also that the alias command can be used to allow you to create your own command to do what you want the way you want to do i. For example, you could enter alias rd 'cd /' command, and then rd would move your current working directory to /. (That alias would only be "active" in your current terminal session. To make permanent alias, you need to create a shell script called bash_alias.sh in /etc/profiles.b/

For example, here is my alias file:
Code:
$ cat /etc/profile.d/bash_alias.sh
#!/bin/bash
alias mounted='mount | grep -v ^[^/] | sort'
alias Mounted='gawk '\''/^\//{print gensub("\\\\040"," ","g",$2)}'\'' /etc/mtab | sort'
alias CIFS='sudo /usr/scripts/mount_cifs.gawk'
alias lsdev='mount | grep ^/dev | sort'
alias ISO='sudo /usr/scripts/mount_iso_images.igawk'
 
Old 05-08-2013, 07:27 PM   #9
computergirl121
LQ Newbie
 
Registered: May 2013
Posts: 24

Original Poster
Rep: Reputation: Disabled
Ok I have another question pertaining to this one I posted. Is top the command the same as going to the top level?
 
Old 05-08-2013, 07:34 PM   #10
273
Senior Member
 
Registered: Dec 2011
Location: UK
Distribution: Debian Sid AMD64, Raspbian Wheezy, various VMs
Posts: 3,508

Rep: Reputation: 800Reputation: 800Reputation: 800Reputation: 800Reputation: 800Reputation: 800Reputation: 800
The command "top" shows the "top" processes...
http://unixhelp.ed.ac.uk/CGI/man-cgi?top
 
Old 05-08-2013, 07:47 PM   #11
computergirl121
LQ Newbie
 
Registered: May 2013
Posts: 24

Original Poster
Rep: Reputation: Disabled
what is top level?
 
Old 05-08-2013, 07:51 PM   #12
273
Senior Member
 
Registered: Dec 2011
Location: UK
Distribution: Debian Sid AMD64, Raspbian Wheezy, various VMs
Posts: 3,508

Rep: Reputation: 800Reputation: 800Reputation: 800Reputation: 800Reputation: 800Reputation: 800Reputation: 800
Quote:
Originally Posted by computergirl121 View Post
what is top level?
I have no idea.
 
Old 05-09-2013, 12:19 AM   #13
Z038
Member
 
Registered: Jan 2006
Distribution: Slackware
Posts: 804

Rep: Reputation: 157Reputation: 157
Quote:
Originally Posted by computergirl121 View Post
what is top level?
The most common name for the top directory level in a filesystem heirarchy is the root directory, often just referred to as "root". The root directory is an unnamed directory that is denoted by a "/". So "cd /" means "change directory to the root directory".
 
1 members found this post helpful.
  


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
[SOLVED] Reverse Proxy/no top level domain name! secondhandman Linux - Newbie 3 05-10-2012 04:48 AM
How to create a top level makefile rushadrenaline Mandriva 3 12-10-2007 11:16 PM
Top Level Domain Names wwnexc Linux - Networking 3 03-12-2006 03:03 PM
DNS & Top Level Domain JJX Linux - Networking 2 03-28-2004 08:56 AM
FTP - setting top level dir donokono Linux - Networking 2 06-18-2002 07:17 PM


All times are GMT -5. The time now is 05:12 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration