Linux commands are a crucial part of navigating and managing your system. Whether you're a beginner or a seasoned user, understanding these commands can greatly enhance your productivity. In this tutorial, we'll cover some essential Linux commands to get you started.

Navigation

Changing Directories

To navigate through directories, you can use the cd command. For example:

  • cd ~ to go to your home directory.
  • cd / to go to the root directory.

Listing Files and Directories

  • ls to list files and directories in the current directory.
  • ls -l for a detailed list.
  • ls -a to show hidden files and directories.

File Management

Creating Files

  • touch filename.txt to create a new file.
  • echo "Hello, World!" > filename.txt to create a file with content.

Copying Files

  • cp source.txt destination.txt to copy a file.
  • cp -r directory/ destination/ to copy a directory and its contents.

Moving and Renaming Files

  • mv oldname.txt newname.txt to rename a file.
  • mv file.txt /path/to/directory/ to move a file to a directory.

Deleting Files

  • rm filename.txt to delete a file.
  • rm -r directory/ to delete a directory and its contents.

Text Editing

Viewing Files

  • cat filename.txt to view the content of a file.
  • less filename.txt to view a file with pagination.

Editing Files

  • vi filename.txt to open a file in the vi editor.
  • nano filename.txt to open a file in the nano editor.

System Information

Checking CPU Information

  • cat /proc/cpuinfo to view CPU information.

Checking Memory Usage

  • free -m to view memory usage.

Checking Disk Space

  • df -h to view disk space usage.

Useful Links

For more in-depth tutorials and guides on Linux commands, check out our Linux Commands Guide.


Images

Linux Terminal

Linux Terminal

File Structure

Linux File Structure

Remember, these are just a few of the many commands available in Linux. As you become more comfortable, explore more commands and expand your knowledge!