page1
openSUSE Basic Command Cheat Sheet
Accounts
To create a new user account
# useradd <name>
To add/change a password
# passwd <name>
To Modify a user account
# usermod <name>
-u specific UID
-g specific GID
-d create home dir
-c User full name
-s Assign a Default Shell
# useradd jsmith -u 1010 -g 501 -d /home/users/jsmith -c “Joe Smith” -s /bin/bash
Example
-c Changes the user name
# usermod -c “Joe Smith” jsmith
-G add a user to a group
# usermod -G homeuser jsmith
-L Lock the user account
# usermod -L jsmith
-U Unlock the user account
# usermod -U jsmith
-s Change or set a shell
# usermod -s /bin/tcsh jsmith
Deleting User Accounts
# userdel <name>
Change a User Shell
# chsh -s /bin/<shell> <name>
RPM
Installing an RPM
# rpm -ivh <package>
Upgrading an RPM
# rpm -Uvh <package>
Removing an RPM *
# rpm -e <package>
Detials about an install RPM
# rpm -qi <package>
List the contents of an RPM
# rpm -qlp <package>.rpm
List installed RPM'es
# rpm -qal
# rpm -qal | grep <package>
Example to find an installed RPM
To see what provides a command
To see what current shell is set
YaST
Run YaST in QT Graphical Frontend
# yast --qt
Run YaST in gtk Graphical Frontend
# yast --gtk
Run YaST in text-mode frontend
# yast --ncurses
Install a Package with YaST
# yast -i <package>.rpm
Remove an Installed Package with YaST
# yast --remove <package>.rpm
List all available Module
# yast -l -or- yast --list
To obtain usage of a module
# yast <module> help
Using the Shell
To see who you are
Change directory
# echo $SHELL
# whoami
# cd <directory>
Display all of the settings
# set | less
To see what current shell is set
# echo $SHELL
To see history
# history
Log in as Superuser
# su -l
Go back the last directory
# cd -
To repeat the last command
# !!
To see the current time
# date
List Bash Settings
# env
To find a command you have ran
# ctrl-r <start typing the command>
Watch a file
# tail -f <file>
# rpm -q –whatprovides <name>
http://opensuse.terrorpup.net/downloads/commands.pdf
* Do recommend using the rpm -e. It can break
other packages