This will take you back to your home directory.
You can also use:
ls /bin - list directory /bin ls -l - list currect directory in long format ls A* - list all files starting with A in currect directory
mkdir /home/cheung/testdir - make directory /home/cheung/testdir mkdir testdir - make directory testdir inside current directory
rmdir /home/cheung/testdir - remove directory /home/cheung/testdir rmdir testdir - remove directory testdir inside current directory
cp -i oldfile newfile
cp /home/cheung/share/example . - copy /home/cheung/share/example to current dir cp -i /home/cheung/share/example . - Same as above, but safer cp /home/cheung/share/e* . - copy all files starting with "e" inside /home/cheung/share to current dir In this case, you really should use the safer option: cp -i /home/cheung/share/e* . because "cp" may overwrite some existing files !! cp example my-example - make a copy of "example" in current dir and rename the new copy to "my-example"
(the net result is: rename the file oldpath to newpath overwriting the file newpath).
And just like "cp", "mv" has an interactive option "-i" that asks the user if he/she really wants to overwrite existing files.
mv /home/cheung/share/example . - move /home/cheung/share/example into the current directory mv -i /home/cheung/share/example . - Same as above, but safer mv /home/cheung/share/e* . - mv all files starting with "e" inside /home/cheung/share to curr dir mv example my-example - Rename file "example" in current dir to "my-example"
rm /home/cheung/share/example - remove /home/cheung/share/example rm -i /home/cheung/share/example - Same as above, but safer rm /home/cheung/share/e* - remove all files starting with "e" inside /home/cheung/share rm example - remove file "example" in current dir rm e* - remove all files starting with "e" rm * - remove all files
**** Warning: rm e * - remove file "e" and all files!!! So if you make a typo (extra space), you can end up deleting all your files !!!
lpr Hello.java - prints the file "Hello.java" lpr *.java - prints all files ending in ".java"
alias cp="cp -i" - now, "cp" is replaced by "cp -i" - The result makes the "cp" command always interactive alias ls="ls -F" - Now, the list directory command "ls" will always - be invoked with the -F option, which tags "/" on - to directory names (making them easier to recognize) - Also, executable files (programs) are tagged with "*" alias dir=ls - Now you can use "dir" to list the content of - directories... (like Microsoft windows)