Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Add a user
- # Basic usage: useradd [options] username
- sudo useradd -s /bin/bash -m -c "Fname Lname" -Gwheel <username>
- # Set a password for new user:
- sudo passwd <username>
- # Set to prompt user to change password at login:
- sudo passwd --expire <username>
- # Add a User to Multiple Groups
- sudo groupadd admins
- sudo groupadd webadmin
- sudo groupadd developers
- sudo usermod -a -G admins,webadmin,developers <username>
- sudo useradd -G admins,webadmin,developers <username>
- # Add user to a group
- # groupadd - add current user to a group
- sudo groupadd <newgroup>
- # usermod - add specified user to a group
- usermod -a -G <examplegroup> <username>
- # File and Directory managment
- ls # List directory contents
- ls -a # Do not ignore entries starting with .
- ls -h # List file sizes in human-readable format
- ls -l # Use long listing format
- ls -lha # May combine switches
- pwd # Print working directory
- cd # Change current directory
- mkdir # Create a new directory
- rm # Remove files or directories
- rm -rf # Remove directory and all contents/subfolders
- cp # Copy files and folders
- mv # Move files and folders
- # File Content Managment
- cat # Concatenate and display file contents
- less # View file contents one page at a time
- head # View the first part of files
- tail # View the last part of files
- # User and Permissions Managment
- sudo # Execute a command as a superuser
- passwd # Change user password
- chmod # Change the permissions of files and folders
- # Process Managment
- ps # Report a shapshot of the corrent processes
- kill # Kill a process - need PID (process ID)
- # System Information
- uname # Display system information, -a for all information
- df # Display file system disk space usage
- free # Display amount of free and used memory in the system
- # Network Managment
- ping # Test network connectivity
- ifconfig # Configure network interface parameters
- hostname -I # Show IP address
- ip addr # Display IP address of NICs
- # Software updater
- systemctl stop packagekit
- systemctl disable packagekit
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement