Linux Command Cheat Sheet

Bipul PrasaiBipul Prasai
4 min read

Basic Linux Commands

Linux commands are the building blocks of your interaction with the system. From navigation to file manipulation, these basic commands form the foundation of your Linux journey.

  • ls - List Files and Directories: Begin your journey by listing the contents of the current directory, revealing the world of files and directories around you.

  • cd - Change Directory: Seamlessly switch between directories, from your HOME directory to the system's root.

  • cat - Concatenate and Display Files: Master the art of file creation, display, and merging, enhancing your file manipulation skills.

  • mv - Move and Rename Files: Achieve file mobility and adapt filenames to your needs.

  • sudo - Superuser Privileges: Elevate your permissions temporarily to execute commands with the authority of a superuser.

  • rm - Remove Files: Declutter your system by eliminating unwanted files with precision.

  • touch - Create Empty Files: Generate empty files for various purposes, setting the stage for your content creation.

cp - Copy Files: Duplicate files and directories with ease, facilitating data backup and management.

File Permission Commands

Maintaining the integrity and security of your files is a priority. Dive into the nuanced world of file permissions with these advanced commands:

  • chmod - Change Permissions: Fine-tune file permissions to control access and manipulation.

  • chown - Change Ownership: Master the art of transferring file and directory ownership, safeguarding your data.

  • chattr - File Attributes: Go beyond traditional permissions and manipulate extended file attributes for added control.

  • getfacl - File ACLs: Examine and modify access control lists (ACLs) for precise file-level security.

Environment Variables Command

The Linux environment relies on variables for customization. These commands offer a more in-depth look into configuring your environment:

  • export - Environment Variable Manipulation: Set and modify environment variables to tailor your Linux environment to your needs.

  • source - Execute Commands from a File: Load environment variables and execute commands from a file, streamlining your environment configuration.

  • alias - Create Command Aliases: Simplify complex commands and create custom shortcuts for efficiency.

  • printenv - Display Environment Variables: Gain insight into the current environment by displaying all defined variables.

User Management Commands of Linux

In business-driven Linux environments, effective user management is paramount. These advanced commands provide comprehensive control over user accounts:

  • useradd - User Account Creation: Create new user accounts with a suite of options for customization.

  • usermod - Modify User Attributes: Fine-tune user attributes, such as groups and home directories, to meet business requirements.

  • passwd - Password Management: Maintain the security of user accounts by setting and managing strong passwords.

  • userdel - User Deletion: Safely remove user accounts while preserving data integrity.

  • su - Switch User: Change user contexts and execute commands as a different user, fostering secure administrative tasks.

Networking Command

Networking is the lifeblood of modern businesses. Explore advanced networking commands to keep your systems interconnected and efficient:

  • netstat - Network Statistics: Dive deep into network statistics, revealing connections, routing tables, and interface information.

  • tcpdump - Network Packet Analysis: Capture and analyze network packets for troubleshooting and monitoring purposes.

  • nc - Network Communication: Establish connections, send and receive data over the network, and facilitate business communication.

  • ip - Network Configuration: Manipulate network interfaces, routes, and addresses with precision using the IP command.

Process Command

In the dynamic world of business, efficient process management is essential. These advanced commands help you optimize system performance and resource utilization:

  • kill - Terminate Processes: Halt unresponsive or redundant processes, ensuring the smooth operation of your system.

  • nice - Adjust Process Priority: Allocate system resources with precision, prioritizing critical tasks.

  • systemctl - Service Management: Control system services, enabling you to manage daemons and their behavior.

VI Editing Commands

Text manipulation is at the core of business communication. Advanced VI commands allow you to edit text with finesse:

  • :%s - Global Text Replacement: Replace text globally within a file, streamlining document editing.

  • v - Visual Mode: Enhance your text selection capabilities, enabling precise editing.

  • g - Global Commands: Execute commands on multiple lines or the entire file, optimizing your text editing workflow.

  • n - Line Numbers: Display line numbers, providing a reference point for text manipulation.

  • / - Search and Replace: Search for text patterns and replace them, enhancing text editing efficiency. In conclusion, this comprehensive Linux Command Cheat Sheet equips you with a diverse array of essential commands, ranging from basic file management to advanced user administration and network control. The addition of VI editing commands empowers your text manipulation skills.

0
Subscribe to my newsletter

Read articles from Bipul Prasai directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Bipul Prasai
Bipul Prasai