IT-INFO

Where IT meets innovation, IT-INFO lights the path to technological brilliance

Linux Commands Guide

Linux Commands Guide

Navigating the File System:

  • `pwd` - Print Working Directory: Display the current working directory to orient yourself within the file system.
  • `ls` - List: List the contents of a directory. Adding options such as `-l` provides detailed information, and `-a` shows hidden files.
  • `cd` - Change Directory: Move between directories. Use `cd ..` to move up one level.

File Operations:

  • `cp` - Copy: Copy files or directories. For example, `cp file.txt /path/to/destination` copies "file.txt" to the specified destination.
  • `mv` - Move: Move files or directories. It can also be used to rename files. For example, `mv file.txt newfile.txt` renames the file.
  • `rm` - Remove: Delete files or directories. Exercise caution with this command, as it permanently removes files.

Working with Text Files:

  • `cat` - Concatenate: Display the contents of a file. Useful for viewing the entire content of small files.
  • `nano` or `vim` - Text Editors: Edit text files in the terminal. Choose between the straightforward `nano` or the more advanced `vim`.
  • `grep` - Global Regular Expression Print: Search for a specific pattern within a file or command output. For example, `grep "pattern" file.txt`.

System Information:

  • `top` - System Monitor: View real-time system statistics, including CPU and memory usage. Press `q` to exit.
  • `df` - Disk Free: Display disk space usage. Adding `-h` provides a human-readable format.

User and Permission Management:

  • `whoami` - Who Am I: Display the current username.
  • `sudo` - Superuser Do: Execute a command with elevated privileges. Use responsibly.
  • `chmod` - Change Mode: Modify file permissions. For example, `chmod +x script.sh` grants execute permission to a script.

Networking:

  • `ping` - Network Ping: Check network connectivity to a specific host.
  • `ifconfig` or `ip` - Network Configuration: Display network interface information. `ip` is more modern and versatile.

These Linux commands represent just a fraction of the vast command-line capabilities. The command line is a gateway to efficiency and control, providing users with the tools to manage files, administer systems, and troubleshoot issues. As you delve into the world of Linux commands, remember that practice is key. Experiment with these commands in a controlled environment to build confidence and familiarity. Happy command line journey!

Created on Aug. 4, 2024, 10:40 a.m.