Files Processes And Networking

25 Mar 2024 - Vishal Srivatsava AV

For this week, we will delve into three fundamental aspects of Linux: file manipulation commands, process management, and networking basics. These topics are essential for anyone looking to gain a deeper understanding of how to use and manage a Linux system effectively.

File Manipulation Commands

Linux provides a robust set of commands for file manipulation. Here are some of the most commonly used ones:

  • ls: Lists all files and directories in the current directory. This command is often used with various options like -l for long listing format, -a to show hidden files, and -h to display file size in human-readable format.

  • cd: Changes the current directory. You can navigate to a specific path or use shortcuts like .. for the parent directory and ~ for the home directory.

  • cp: Copies files and directories. The -r option allows you to copy directories recursively.

  • mv: Moves or renames files and directories. It’s important to be careful with this command as it can overwrite existing files without warning.

  • rm: Removes files and directories. The -r option is used to remove directories and their contents recursively.

  • touch: Creates an empty file. If the file already exists, touch updates the file’s access and modification timestamps.

  • cat: Concatenates and displays file content. It’s commonly used to display text files.

Process Management

Process management is a crucial aspect of Linux system administration. Some of the basic commands for process management include:

  • ps: Displays the status of current processes. By default, it shows processes for the current shell. Use ps aux to see all system processes.

  • top: Provides a real-time, dynamic view of the processes running on a system. It displays information about CPU usage, memory usage, and much more.

  • kill: Sends a signal to a process, usually to terminate the process. Signals can be specified by name (-SIGKILL) or by number (-9).

  • nice and renice: Used to set and change the priority of a process. The nice value ranges from -20 (highest priority) to 19 (lowest priority).

  • & (ampersand): Used to run a process in the background. This is particularly useful for long-running processes.

Networking Basics

Networking is another fundamental aspect of managing a Linux system. Here are some basic networking commands:

  • ping: Checks network connectivity to another host on your network. It sends ICMP echo request packets and waits for the echo reply.

  • ifconfig or ip: Displays or manipulates network interfaces. These commands show the current configuration of network interfaces and can be used to modify that configuration.

  • netstat: Displays network statistics. It’s a versatile tool that can display a variety of information about the network.

  • ssh: Securely connects to remote servers. It uses public-key cryptography to authenticate the remote computer and allow the remote computer to authenticate the user.

  • scp: Securely copies files between hosts on a network. It uses the same authentication and security as the ssh command.

Conclusion

Mastering file manipulation commands, process management, and networking basics are crucial steps in becoming proficient in Linux. While this post provides an introduction to these topics, I encourage you to explore these commands and concepts further to fully appreciate the power and flexibility of Linux.