In DOS Linux as there is a concept of current directory. If you are the user foo, after logging in your current directory is (usually) / home / foo (or / usr / foo), known as the home directory (the private seasonal "home", where you keep your files). Add some other useful command: mkdir to create a directory and rmdir to remove it: now we take a small sample of comments (written in italics are comments, written in bold are commands you need to type you. Of course you need to press Enter after typing each command):
$ Ls
[Usually, there is nothing]
$> Test
[Trick to create a file]
$ Ls
test
Mkdir $ dir, ls
test dir
[More commands concatenated with;]
$ Mv test dir, ls
dir
[Moves to test dir]
Cd $ dir; ls
test
[Here it is]
$ Rm test ls
[Nothing, now the dir is empty]
$ Cd .. ; Rmdir dir, ls
[No, we have deleted all]
Linux uses a file system directory hierarchy. To refer to a file should be given the full name, using the '/' (and not '\') as a separator. Examples of file names / etc / passwd or / usr / local / bin / perl. Unlike DOS, where there are the "volumes" ( A:, C:, F: ), on Linux we do not have anything like that. So, you say, how do I access a floppy or a CD ROM? Linux allows you to "mount" a volume in its directory hierarchy. For example, to access files on a CD ROM you must issue a command like this (be careful, to use it normally need to be root):
mount / dev / hdb / mnt / cdrom
One feature of Linux is that the devices are seen as files, and then an entire CD ROM file that is represented in "special" hdb. The special files are usually harvested in the directory / dev. Do not consider the matter with a special file which is a long complex, and it is not useful for beginners. The effect of the mount command is to turn the device files in a hierarchy of files and directories related to the main hierarchy. Using ls / mnt / cdrom can see the files in the root directory of the CD ROM. In fact sometimes the mount command requires a few extra parameter, such as the type of file you want to use if you want to mount read only and so on. Linux is often smart enough to be able to recognize only these details (but not always) in other systems may be necessary to explicitly specify some parameters. The reverse mount command to "remove" a file system, umount it (and unmount). Be aware that before withdrawing from a CD-ROM drive must be removed. If you are using a recent version of Linux and a CD-ROM IDE will not be able even to remove the CD before they dismantled it.
Bookmarks