ㅤㅤㅤㅤㅤㅤㅤㅤㅤㅤCheat Sheet about Linux commands

Keyboard Shortcuts Commands

Keyboard Shortcuts

Description
Ctrl + KCut and add to the clipboard part of the line after the cursor
Ctrl + UCut and add to the clipboard part of the line before the cursor.
Ctrl + WCut and add to the clipboard one word before the cursor was.
Ctrl + CKill process running in the terminal.
Ctrl + ZStop the current process.
Ctrl + RRecall the last command that matches the provided characters.
Ctrl + ORun the previously recalled command.
Ctrl + GExit command history without running a command.
Ctrl + YPaste from clipboard.
Useradd

useradd
This command creates a new user.

sudo useradd [options] username
  • Common Options:

    • -m : Create the user’s home directory if it doesn’t exist.
    • -d : Specify a custom home directory.
    • -G : Add user to one or more groups.
    • -s : Specify the login shell.
    • -c : Add a comment (e.g., user’s full name).

userdel
This command deletes a user.

sudo userdel [options] username
  • Common Options:

    • -f : Delete Linux user account with force removal of files
    • -r : Remove Linux user account including home directory and mail spool

usermod
This command modifies a user.

sudo usermod [options] ___ username
  • Common Options:

    • -e : To change the expiry date of a user 
    • -d : To change the home directory of a user 
    • -g : To change the group of a user 
    • -l : To change user login name 
    • -c : To add a comment for a user 
    • -L : To lock a user 
    • -U : To unlock a user 
    • -s : To create a shell for the user 
Groupadd

groupadd
This command creates a new group.

sudo groupadd [options] groupname
  • Common Options:

    • -g : This parameter is used to specify the numerical ID for the group.
    • -c : create a group with attached comment

groupdel
This command deletes a group.

sudo groupdel [options] groupname
  • Common Options:

    • -f : Delete Linux user account with force removal of files
    • -r : Remove Linux user account including home directory and mail spool

groupmod
This command modifies a group.

sudo groupmod [options] ___ groupname
  • Common Options:

    • -g : Changes the group ID
    • -n : Changes the name of the group
    • -U : Lists members of a group
    • -o : Allows using duplicate group ID

COMMANDS

Description
man ___It is a manual for near every command
lsList directory contents
cdTo change directories
whatis ___
Shows the section “name” in man command
whoamiShows in which account you are
clear“Deletes” all the commands of the screen
echo ___Prints text to the screen
historyShows to you the commands that you have entered previously
mkdir ___
Create a new directory

 

COMMANDS

Description
date
Shows the date that have configured
rebootRestarts the systems
apt updateUpdates the packages
apt upgrade
Updates the installed packages
apt install ___Installs a package
apt remove ___
Removes a package
cp ___ ___Copies the file or directory
rm ___Removes a file
chmod ___ ___To change the file permissions