UNIX Commands and Concepts

Firstly you need to log in.

Once you have logged in for the first time, your first priority should be to reset your password from the one you gave when you joined to something else. To select a password, you should consider the following guide lines:

  • Use at least 6 different letters/numbers/symbols
  • Use a mixture of lower and uppercase
  • Use a mixture of numbers and letters and symbols
  • Don't use names of family members / boyfriends / girlfriends etc.
  • Don't use words which appear in the dictionary
  • Do consider using acronyms (with mixed case) to generate what would appear to be a random mix of letters, numbers and symbols to anyone who didn't know the acronym.

In order to change your password, type the command passwd. You will be prompted for your old password and then you have to enter the new password twice. Once you have done this, there is no way for any of the Computer Society System Admin to find out what your password is. If you forget your password, it must be reset by the Admin to a new one.

The Command Line

When you login, you will be faced with a variety of messages which end up with the display of a prompt. At this point you can type in commands; pressing Enter results in the commands being executed. To start with, try out some of the commands listed below. They all return immediatly to the command line after they have executed resulting in the display of another prompt at which you can enter another command.

 

Here is a list of simple commands with brief descriptions:

  • ls List files in the current directory
  • ps List all the process you are running
  • who List who is on the system and where they are
  • w List who is on the system and what they are doing

Most commands are very short; they are often used with command line arguments. If you type:

ls -la
Then you will get a long listing of all your files. The "-la" part of the command is referred to as it's command line arguments. You could also try:
ps -aux
As this will produce a list of all the processes (programs) being run on the computer which will be much longer than the list the command produced earlier. Don't worry if you did not understand the output produced by this program, it will be explained later. If the text scrolled off the top of your screen, then try typing:
ps -aux | more
This time you will see only a single screenful of information. Press the space bar to see the next screen, press return to see the next line; pressing b will make the text scroll back one page. When you have finished viewing the document, type q if the prompt has not been redisplayed.

 

Finally

Try some other commands, such as those below:

 

  • finger username - Find out about others on the system
  • talk username - Talk to another user
  • write username - Write to a users screen
  • cp file1 file2 - Copy a file
  • mv file1 file2 - Move a file
  • mkdir name - Make a directory
  • rmdir name - Remove a directory
  • cd name - Change directory
  • cat name - View a text file
  • more file - View a text file a screen at a time
  • chmod perms name - Change file permissions
  • chsh - Change your login shell
  • chfn - Change your real name and contact information on the system
  • man command - View the manual page for specified command (see also the man section)
Page last modified by dez on Fri, 11 Sep 2015 22:23:36 +0100