Pick a Free OS

User login

Navigation

Starters for Linux - Part 1

Create a hard link called destination to the file called source. The link appears as a copy of the original files, but in reality only one copy of the file is kept, just two (or more) directory entries point to it.. Any changes in the file are automatically visible throughout. When one directory entry is removed, the others stay intact. The limitation of the hard links is that the files have to be on the same file system. Hard links to directories or special files are impossible.

ln -s source destination

Create a symbolic (soft) link called destination to the file called source. The symbolic link just specifies a path where to look for the file. In contradistinction to hard links, the source and destination do not have to be on the same file system. In comparison to the hard links, the drawback of symbolic links is that if the original file is removed, the link is broken, symbolic links can also create circular references (like circular references in spreadsheets or databases, ( e.g., a points to b and b points back to a).

rm files

Remove (delete) files. You must own the file in order to be able to remove it.

mkdir directory

Make a new directory.

rmdir directory

Remove an empty directory.

rm -r files

(Recursive remove) Remove files, directories, and their subdirectories.

Be careful with this command when logged in as root--you can easily remove all files on the system if you are not careful.

cat filename | more

View the contents of a text file called filename, one page a time. The | is the pipe symbol (on many keyboards it shares the key with) The pipe makes the output stop after each screenful. For long files, it is sometimes convenient to use the commands head and tail that display just the beginning and the end of the file. If you happened to use cat on a binary file and your terminal displays funny characters afterwards, you can restore it with the command reset.

less filename

Scroll through a content of a text file. Press q when done. Less is roughly equivalent to more, the command you just read about.

pico filename

Edit a text file using the simple and standard text editor called pico.

pico -w filename

Edit a text file, while disabling the long line wrap. Handy for editing configuration files. e.g. /etc/fstab. We would advise you to disable the word wrap feature for the simple reason that you could very easily mess up the configuration files with Word Wrap on, because the line length will differ from system to system.