To get started as a Linux (or Unix) user, you need to have a good perspective on how Linux works and a handle on some of the most basic commands. This first post in a \u201cgetting started\u201d series examines some of the first commands you need to be ready to use.\n\nOn logging in\n\nWhen you first log into a Linux system and open a terminal window or log into a Linux system from another system using a tool like PuTTY, you\u2019ll find yourself sitting in your home directory. Some of the commands you will probably want to try first will include these:\n\nWhen you first log into a Linux system and open a terminal window or log into a Linux system from another system using a tool like PuTTY, you\u2019ll find yourself sitting in your home directory. Some of the commands you will probably want to try first will include these:\n\nUsing the whoami command immediately after logging in might generate a \u201cduh!\u201d response since you just entered your assigned username and password. But, once you find yourself using more than one account, it\u2019s always helpful to know a command that will remind you which you\u2019re using at the moment.\n\nThese commands will generate output like this:\n\nListing your files\n\nOne of the first things you will likely want to do is look at the files and directories that are associated with your account. The command below provides a \u201clong listing\u201d \u2013 one that shows all the files and directories in the current file system location along with the permissions and ownership of those files and directories.\n\nIn the output shown above, there are three directories (lines starting with \u201cd\u201d) and five files lines starting with \u201c-\u201c). The details are only provided because the ls command includes the -a (show all) and -l (provide details) options.\n\nNote that the owner and group are both \u201cjustme\u201d. By default, any particular user will be the only member of a same-named user group. Both are set up when a new user is added to the system.\n\nThe dates and times that are displayed in long listings show when the files were last updated.\n\nMoving around the file system\n\nTo move into any of the directories, use a command like \u201ccd .mozilla\u201d. The current directory, wherever you\u2019re sitting in the file system, can be addressed as \u201c.\u201d. Using a command like \u201ccd .\u201d, therefore, doesn\u2019t accomplish anything. It means \u201cmove to where I already am\u201d. Using the \u201ccd ..\u201d command, on the other hand, will move you up one directory \u2013 toward \/, the base of the file system.\n\nCommands like \u201ccd \/tmp\u201d will take you to the specified directory. A cd command without arguments will always take you back to your home directory as would \u201ccd ~\u201d or a command like \u201ccd \/home\/justme\u201d. Most Linux users, however, prefer typing as little as needed and just use cd to get back home.\n\nNote that there will always be directories that you will be unable to access unless you switch to the root (superuser) account or use the su (switch user) command to use a different account that has access rights. If you try to move into a directory for which you don\u2019t have adequate access, you\u2019ll see an error like this one:\n\nTo see why access was denied, try listing the directory\u2019s permissions like this:\n\nThe only account that has access rights to this directory is \u201cnewuser\u201d.\n\nNOTE: You will likely be set up to use the su command unless your role involves managing the system.\n\nUnderstanding file and directory permissions\n\nTo understand what you can access and not access, it\u2019s important to understand how file and directory permissions work. The first character in the permissions strings like the \u201cd\u201d in \u201cdrwxr-----" represents the file type. Most entries in a directory listing will be one of the following.\n\nThe rest of the permissions string displays the permissions given to the file\/directory owner, the owner\u2019s primary group and everyone else. If we break the permissions string into groups, it might look like this:\n\nThe \u201crwx\u201d shown in the example above means that read (r), write (w) and execute (x) permissions are provided to the directory owner. In contrast, \u201c---\u201d means that none of these permissions are provided. Expect to see many instances in which only read (r--) or read and execute (r-x) permissions are granted. You can control who can access your files. For example, you could grant access to a file in your directory with a command like this provided the intended user has access to your home directory as well.\n\nThe command shown above would give read access to anyone in the \u201cother\u201d group (i.e., anyone who is neither the owner nor a member of the file\u2019s assigned group). Keep in mind that these users would not have access if they don\u2019t also have access to the directory containing the file.\n\nNOTE: As you likely suspect, only the owner of a file or root can change the file\u2019s permissions.\n\nViewing file content\n\nViewing the content of a file depends on the file type. To view text files, you can use the cat (show file content) or the more (show file content a screenful at a time) command. Bash scripts are text files as are startup files like .bashrc. System executables, on the other hand, which are referred to as \u201cbinary\u201d files cannot be viewed except with commands that display the content as a long series of 0\u2019s and 1\u2019s \u2013 binary content. Finding a command that can display the content (like an image) on the desktop is an altogether different process.\n\nNote that the more command will list file content a screenful at a time. Hit the enter key to move the next screenful.\n\nCopying, moving and deleting files\n\nTo make a copy of a file, use the cp (copy) command like this:\n\nTo move a file to a different directory (one you have write access to), use a command like this:\n\nIn the command shown above, you would be a copying a file named \u201cmyscript\u201d to the bin directory in your home directory. The bin directory will likely not exist unless you create it with a \u201cmkdir ~\/bin\u201d command.\n\nTo delete a file, use the rm command. Deleting a file requires that you have write permission to it.\n\nWrap-up\n\nStay tuned for Part 2 of getting started on the Linux (or Unix) command line.