So What Can I Do In Unix?
Moving Around
The standard command for changing the current directory is "cd". That stands for 'change directory', just like the 'cd' in MS-DOS.
Within every directory, there are a few 'special' directories. These are :
. - This is the current directory
.. - This is the directory above the current one @ parent directory. So, to go up one directory, just type: "cd .."
~ - This is the user's home directory. This command takes you straight away to '/home/username'. It's like going straight away to 'C:\Documents And Settings\username' in Microsoft Windows. So, to go 'home', just type “cd ~”
/ - This is the root directory. Think of it as taking you straight to “C:\” in Microsoft Windows.
Where Am I?
Now that you can move around, how do you find out where you are? Simple, just type "pwd"! This will display your current directory path.
Now that you can find out where you are and move around, it's time to learn how to move files around.
Copying And Moving Files
There are very simple commands for copying and moving files. Copying a file to a new location and/or filename is done as follows :
cp <source> <destination>
For example, if we have a file called "mad_cow.gif" and we would like to copy this into a subdirectory called "herd", then you can do so by typing :
cp mad_cow.gif herd/
If you want to copy multiple files into a new directory, just use :
cp <source 1> <source 2> ... <source n> <directory>
For example, if you have three files called 'cow', 'abu', and 'nga', and you want to move them to a folder called 'herd', then you can do so by typing :
cp cow abu nga herd/
Simple, huh? Well, the move files command is just as simple!
To move a file, do exactly the same as copying, except replace "cp" with "mv". For example, to move a file called 'file1.txt' into the folder called 'myfolder', you just need to type :
mv file1.txt myfolder/
To rename a file, just 'move' it to a new filename. For example, if we want to rename the file 'mad_cow.gif' to 'moo.gif', we just need to type :
mv mad_cow.gif moo.gif
<<< What Is Linux?, Why Should You Learn Linux?, The Shell Is Not A Shell! : Previous Page | Next Page : I Wanna List My Files! >>>