Basic Linux commands


After you get your computer ready with Linux, you would like to try out some fun with the console. When you get into the Terminal you would first like to move about. The command (“cd“) which means current directory being used. This command also helps you move around in other directories. For example if you want to go to /var and you are in the root directory (“/”) then you have to say “cd /var”. To list the contents of directory try out “ls” or “dir“.

To create new directories you have to use mkdir. If you want a directory called fedora try “mkdir fedora” in your home directory. To copy files from another directory to fedora, the directory you just created use “cp /etc .” where /etc is the directory that you are copying and “.” or period is used to refer to the current directory. To move files you have to use mv. Try to move files from one directory to other. Command is “mv {filename to move} {destination folder}”.

If you want to see the contents of a file you can use touch. By doing so you can read the contents of a file. And if the file is very large you won’t be able to read everything. So you can use more. By using more you will be able to view the contents of a file, one screen full at a time. Another command cat displays the whole file at once. There are also command line file readers and editors like nano.

Actually with ls you can do some wild card searches too. For example if you are searching for joe but forgot the middle letter ‘e’ then try “ls j?e”. The result may be joe, jie, jfe, jme but not jaae. And if you are searching for jaae use “ls j??e”. Sorry for awkward names.