LINUX- CHEAT SHEET

Displays Linux system information

Displays kernel release information

Displays how long the system has been running

Shows the system hostname

Displays the IP address of the system

Shows system reboot history

Displays current system date and time

Displays who you are logged in as

Displays information about the user

Displays information about system’s hardware configuration

Displays block devices related information

Displays free and used memory in the system (-m indicates memory in MB)

Displays the details of the active user e.g. uid, gid, and groups

Shows the last logins in the system

Shows who is logged in to the system

Adds the group ‘pink’

Adds user ‘rajni’

Deletes user ‘rajni’

Used for modifying user information

Lists files – both regular & hidden files and their permissions

Displays the present working directory path

Creates a new directory named ‘pink’

Removes a file

Forcefully removes a file

Removes a directory recursively

Removes a directory forcefully and recursively

Copies the contents of file1 to file2

Recursively Copies dir1 to dir2. dir2 is created if it does not exist

Renames file1 to file2

Creates a symbolic link to file_name

Creates a new file

Places standard input into a file

Outputs the contents of a file

Displays the first 10 lines of a file

Displays the last 10 lines of a file

Encrypts a file

Decrypts a file

Prints the number of bytes, words and lines in a file

Executes commands from standard input

Display currently active processes

Searches for the id of the process ‘telnet’

Displays memory map of processes

Displays all running processes

Terminates process with a given pid

Kills / Terminates all processes named proc

Sends a signal to a process with its name

Resumes suspended jobs in the background

Brings suspended jobs to the foreground

Lists files that are open by processes

Change file permissions of the file to octal

Example

Set rwx permissions to owner, group and everyone

Set rwx to the owner and r_x to group and everyone

Sets rwx for owner, rw for group and everyone

Change ownership of the file

Change owner and group owner of the file

Change owner and group owner of the directory

Displays IP addresses and all the network interfaces

Assigns IP address 192.168.0.1 to interface eth0

Displays IP addresses of all network interfaces

ping command sends an ICMP echo request to establish a connection to server

Retrieves more information about a domain name

Retrieves DNS information about the domain

Performs an IP lookup for the domain name

Displays local IP address

Downloads a file from an online source

Displays all active listening ports

Creates archive file called ‘peep.tar’ from file ‘peep’

Extract archive file ‘peep.tar’

Creates gzipped tar archive file from the source folder

Compression a file with .gz extension

Install an rpm package

Removes an rpm package

Install package using dnf utility

www.tecmint.com

Search for a given pattern in files

Search recursively for a pattern in a given directory

Find all instances of the file

Find file names that begin with ‘index’ in /home folder

Find files greater than 10000k in the home folder

Securely copy file1.txt to server2 in /tmp directory

Synchronize contents in /home/apps directory with /backup directory

Displays free space on mounted systems

Displays free inodes on filesystems

Shows disk partitions, sizes, and types

Displays disk usage in the current directory in a human-readable format

Displays target mount point for all filesystems

Mount a device

Move up one level in the directory tree structure

Change directory to $HOME directory

#cd /test Change directory to /test directory

Scroll to Top