LINUX
COMMANDS
Contents | Previous
| Next
Logging-in and creating a user account
The first thing Linux requires you to do is log-in.
This involves entering the name of an existing user account,
followed by the password for that account.
If Linux has been setup with a graphical log-in screen
you'll start in X, the Linux GUI (Graphical
User Interface, pronounced gooee). If Linux has been
setup with a text-only log-in screen you'll start at the
console.
Consoles and terminal windows
The console is that text-only screen where white text is
typed on a black background. In X the equivalent is a terminal
window (sometimes called a terminal emulator).
When someone says, "Type this at the command-line,"
(or command-prompt, prompt, terminal,
or shell-prompt), type the command at the console
or in a terminal window, and press the Enter key
to run the command. Most of the time it doesn't matter which
of the two is used. If it does, I'll mention it.
The shell (most likely the bash shell) makes
sure the command you entered makes sense, then passes it
to the kernel (the core of the operating system),
to be run.
Note:
To be sure you're using the bash shell, enter:
echo $SHELL
To display:
/bin/bash
If not, you can temporarily change shell, by entering:
chsh -s /bin/bash
The root account
All Linux distributions setup a special account called
root during installation. Unlike ordinary
user accounts which, for security reasons, restrict what
you can read, alter, and run, the root account
gives you access to everything.
Because being logged-in as root is both dangerous
to the well-being of your Linux installation, and for the
most part unnecessary, for everyday-use you should use an
ordinary user account.
Note:
If your shell prompt ends with a hash/number-sign (#)
you're logged-in as root. If it ends with a dollar-sign
($) you're an ordinary user.
Creating a user account
During installation you had the chance to create some user
accounts, but you should know how to create others after
installation.
- 1 -
Only root can create user accounts, so at the
log-in prompt, enter root, followed by the root
account's password, which you set during installation.
Note:
Account names, passwords, commands, filenames, and just
about everything in Linux, is case-sensitive. The user root
is not the user Root.
- 2 -
Throughout this book, when you're asked to enter
something (like below), either enter it at the console or
in a terminal window.
Enter:
adduser accountname
...replacing accountname with a name for
the account.
- 3 -
Now give this new account a password by entering:
passwd accountname
...which will prompt you for a password and then again
for verification.
Note:
To later change your password, enter:
passwd
...or as root, include the account name to change
another account's password.
Intermediate tip:
When a new user account is created, that user's home directory
gets the content of the /etc/skel ("skeleton")
directory. Entering ls -a /etc/skel will list this
directory's content. As root, add to this directory
any files you want created, by default.
Removing a user account
To remove an account, as root, enter:
userdel john
...and to remove his home directory, enter:
rm -rf /home/john
Note:
To perform the above two commands in one step, enter:
userdel -r john
Logging-out
To log-out of an account from the console, press Ctrl+D.
(Ctrl+D means hold down the Ctrl
key on your keyboard, and press the D key, pronounced
"Control D".) In a terminal window, Ctrl+D
usually closes the terminal window.
There are many GUIs available for Linux, but the two most
popular are KDE and GNOME.
Rebooting
The simplest way to reboot (restart) a computer from the
console is to press Ctrl+Alt+Delele.
From the graphical log-in screen simply select the halt
(shutdown) or reboot menu options.
Contents | Previous
| Next