Basic Commands Flashcards

1
Q

What does the following command do?

shutdown -p

A

The command will shut down the system down cleanly, and if the hardware supports it, turn itself off.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

I think I pressed something…

What keyboard combination gets to tty8, the GUI console?

A

ALT+F8

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

I think I pressed something…

What keyboard combination gets to tty0, the system console?

A

ALT+F1

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

I want to add a user account but…

What is the recommended command-line application for adding new users?

A

adduser

When a new user is added, this program automatically updates /etc/passwd and /etc/group. It also creates a home directory for the new user, copies in the default configuration files from /usr/share/skel, and can optionally mail the new user a welcome message. This utility must be run as the superuser.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

We fired Joe today…

What is the recommended command-line application for removing users?

A

rmuser

  • Removes the user’s crontab entry, if one exists.
  • Removes any at jobs belonging to the user.
  • Kills all processes owned by the user.
  • Removes the user from the system’s local password file.
  • Optionally removes the user’s home directory, if it is owned by the user.
  • Removes the incoming mail files belonging to the user from /var/mail.
  • Removes all files owned by the user from temporary file storage areas such as /tmp.
  • Finally, removes the user name from all groups to which it belongs in /etc/group. If a group becomes empty and the group name is the same as the username, the group is removed. This complements the per-user unique groups created by adduser(8).
  • rmuser(8) cannot be used to remove superuser accounts since that is almost always an indication of massive destruction.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

I want my bash shell back…

What command changes the default shell and personal information for a user?

A

chpass

Any user can use chpass to change their default shell and personal information associated with their user account. The superuser can use this utility to change additional account information for any user.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Jim, he forgot his password again, shoot ‘em…

What command changes a password?

A

passwd

The superuser can change any user’s password by specifying the username when running passwd. When this utility is run as the superuser, it will not prompt for the user’s current password. This allows the password to be changed when a user cannot remember the original password.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

I have 50 users to change by 8am…

What command utility can create and standardize many users? It is used often inside a shell script.

A

pw

The pw utility can create, remove, modify, and display users and groups. It functions as a front end to the system user and group files. pw(8) has a very powerful set of command line options that make it suitable for use in shell scripts

How well did you know this?
1
Not at all
2
3
4
5
Perfectly