Linux - NewbieThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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
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.
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
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'
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".
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.