How to change to a dirrectory in ubuntu
I can change to a nother directory in home folder using cd command.I have several partitions in my hard drive.But i want to know ho to cheng to a directory in nother partition or flash drive using command line.how can i do that
|
You do that the same way you use the `cd` command to navigate around your home folder.
Remember, everything is somewhere off of the / directory (that means root of the filesystem, not the "root user"). Other disks or partitions are going to be mounted somewhere, i.e. onto a folder somewhere. The `mount` command will show you what is mounted where. So, if you want to `cd` to some flash drive partition, and that partition is mounted at /media/usb/ then you would do: Code:
cd /media/usb To go backwards one or two or three levels, use: Code:
cd .. Code:
cd ~ Code:
man cd |
cd may also bring you to home. Haa. Sasha missed one finally! :) Ok I gave her a did it help point.
Might help to know paths. They can sometimes help in less direct moves. Flash drives may be found in one of two places usually. /mnt or /media. It would help us to know your distro too for exact help. Partitons may be something either a name or somewhat of a drive code. Like /hda1 or sda2 or such. Might even show up as /Maxtor 60lmcbw whatever. |
I change to dev directory using
"cd /dev" command.There are several partitions in my heard disk.So i try to go to sda7 partition using cd sda7.It says sda7 is not a directory.So please if someone can , teach me how to go to a folder inside sda7 partition using command line.Every time, when i want to do some work in a folder in separate partition,i have to copy the folder to Desktop.Because i don't know how to go to that folder using command line. |
The stuff in the /dev folder is mostly NOT folders; therefore you cannot cd into any of that stuff, except the very few places in /dev that actually are folders. However, cd'ing into those folders will not get you where you want to go.
Follow along here, doing the same commands I do, on your machine: Code:
sasha@reactor: mount Let's look at my last line from above: Code:
/dev/hda12 on /home type ext4 (rw,noatime) Code:
sasha@reactor: cd /home Code:
sasha@reactor: cd /dev/hda12 Try that - if you need further help, just ask. :) |
Quote:
In any UNIX-like OS, everything is a "file", i.e. it is an object that can be written to/read from, and has permissions/flags/etc. One example that somewhat demonstrates how this works is if you type cat /dev/urandom > /dev/dsp into a terminal (turn your speakers way down though! :eek:). What this does is it redirects the "contents" of /dev/urandom (the pseudorandom number generator) into /dev/dsp (the device node for the audio controller), resulting in white noise. You're reading from one device "file" (/dev/urandom) and writing to another device "file" (/dev/dsp). |
Thank
I got the answer,and now i can do it thanks to all of your help.Thank you very much.
|
All times are GMT -5. The time now is 02:51 AM. |