Linux Commands

Linux Commands

Linux is a free and open-source operating system that is often used on servers, supercomputers, embedded systems, and personal computers. One of the best things about Linux is that it has a powerful command-line interface that makes it easy and flexible to work with the system. While graphical user interfaces are also available in Linux, mastering the command line can help users to perform complex tasks, automate repetitive actions, and troubleshoot issues more effectively. In this blog post, we'll talk about some basic and advanced Linux commands that have to do with the file system, managing memory, and other useful tasks. Whether you are a Linux beginner or an experienced user, this guide can help you improve your productivity and efficiency in the command line.

Basic Commands

Here are some basic commands in Linux:

  1. ls: Lists the files and directories in the current directory.

  2. cd: Changes the current directory.

  3. pwd: Prints the working directory.

  4. mkdir: Creates a new directory.

  5. rmdir: Removes a directory.

  6. touch: Creates a new file.

  7. rm: Removes a file.

  8. cp: Copies a file.

  9. mv: Moves or renames a file.

  10. cat: Displays the contents of a file.

  11. grep: Searches for a pattern in a file.

  12. sudo: Executes a command as the root user.

  13. apt-get: Installs, updates, or removes software packages.

  14. chmod: Changes the permissions of a file or directory.

  15. chown: Changes the ownership of a file or directory.

File System Commands

Here are some commands related to file system in Linux:

  1. df: Displays the disk usage and available space on mounted file systems.

  2. du: Displays the disk usage of a file or directory.

  3. fdisk: A partitioning utility that can create, delete, and manipulate disk partitions.

  4. mkfs: Formats a file system on a disk partition.

  5. mount: Mounts a file system to a directory.

  6. umount: Unmounts a file system from a directory.

  7. blkid: Displays the UUID and file system type of all available block devices.

  8. find: Searches for files and directories based on certain criteria such as name, size, or modification time.

  9. locate: Searches for files and directories based on their names.

  10. ln: Creates a hard or symbolic link to a file.

  11. tar: Creates or extracts a compressed archive file.

  12. rsync: Synchronizes the contents of two directories or files across a network.

  13. diff: Compares the contents of two files and displays the differences.

  14. grep: Searches for a pattern in a file or multiple files.

  15. awk: A text processing tool that can extract and manipulate data from files.

Memory Management Commands:

Here are some commands related to memory management system in Linux:

  1. free: Displays the amount of free and used memory in the system.

  2. top: Displays real-time information about the system's processes and memory usage.

  3. ps: Displays information about the currently running processes.

  4. kill: Sends a signal to terminate a process.

  5. nice: Adjusts the priority of a process to control its resource usage.

  6. renice: Changes the priority of a running process.

  7. vmstat: Displays virtual memory statistics such as page faults and swap usage.

  8. swapon: Activates a swap partition or file.

  9. swapoff: Deactivates a swap partition or file.

  10. ulimit: Sets limits on system resources such as memory usage and file size for user processes.

  11. top: Provides a dynamic real-time view of the processes running in a system, with detailed information about the memory and CPU usage of each process.

  12. htop: A more advanced version of top, which provides additional functionality and an interactive interface.

  13. pmap: Displays the memory map of a process, showing the virtual memory addresses used by each memory-mapped file or shared library.

  14. sysctl: Configures kernel parameters related to memory management, such as swappiness or the size of the page cache.

  15. numactl: Configures NUMA (non-uniform memory access) settings, such as the allocation policy for memory and CPUs.