Beginner's Guide to Learning Linux Commands

1. Introduction

Linux is an open-source operating system that offers a powerful command line interface (CLI). This guide will detail basic commands and concepts for beginners who want to learn how to use the Linux command line.

2. Basic Commands

2.1. ls - List Files and Directories

  • Usage: ls [options] [directory]
  • Examples:
    • ls: Lists files and directories in the current directory.
    • ls -l: Lists in long format.
    • ls -a: Lists hidden files as well.

2.2. cd - Change Directory

  • Usage: cd [directory]
  • Examples:
    • cd /home: Changes to the /home directory.
    • cd ..: Moves up one directory.
    • cd: Moves to the home directory.

2.3. pwd - Show Current Directory

  • Usage: pwd
  • Example: pwd shows the full path of the current working directory.

2.4. mkdir - Create a New Directory

  • Usage: mkdir [directory_name]
  • Example: mkdir new_folder creates a new directory named new_folder.

2.5. rmdir - Remove an Empty Directory

  • Usage: rmdir [directory_name]
  • Example: rmdir old_folder removes an empty directory named old_folder.

2.6. rm - Remove Files or Directories

  • Usage: rm [options] [file/directory]
  • Examples:
    • rm file.txt: Removes file.txt.
    • rm -r directory: Removes the directory and its contents.

3. File Operations

3.1. cp - Copy Files or Directories

  • Usage: cp [options] source destination
  • Examples:
    • cp file1.txt file2.txt: Copies file1.txt to file2.txt.
    • cp -r dir1 dir2: Copies the contents of dir1 to dir2.

3.2. mv - Move/Rename Files or Directories

  • Usage: mv [options] source destination
  • Examples:
    • mv file1.txt file2.txt: Renames file1.txt to file2.txt.
    • mv file1.txt /target_dir: Moves file1.txt to the target_dir directory.

3.3. cat - Display File Content

  • Usage: cat [file_name]
  • Example: cat file.txt displays the content of file.txt in the terminal.

3.4. nano or vim - Edit Files

  • Usage:
    • nano [file_name]: Edit a file with the nano editor.
    • vim [file_name]: Edit a file with the vim editor.
  • Example: nano file.txt opens file.txt in the nano editor.

4. File Permissions

4.1. chmod - Change File/Directory Permissions

  • Usage: chmod [options] permissions file
  • Examples:
    • chmod 755 file: Sets the permissions of the file to 755.
    • chmod +x file: Adds execute permission to the file.

4.2. chown - Change File/Directory Ownership

  • Usage: chown [owner][:group] file
  • Example: chown user:group file changes the ownership of the file to the specified user and group.

5. System Control and Management

5.1. ps - Display Running Processes

  • Usage: ps [options]
  • Example: ps aux lists detailed information about all running processes.

5.2. top - Monitor System Performance

  • Usage: top
  • Description: Displays real-time system performance, CPU, and memory usage.

5.3. df - Display Disk Usage

  • Usage: df [options]
  • Example: df -h shows disk usage in a human-readable format.

5.4. du - Display Directory and File Sizes

  • Usage: du [options] [directory/file]
  • Example: du -h directory lists sizes of files and subdirectories in the directory in a human-readable format.

6. Network Commands

6.1. ping - Test Network Connection

  • Usage: ping [target]
  • Example: ping google.com tests the connection to google.com.

6.2. ifconfig - Display Network Interface Information

  • Usage: ifconfig
  • Description: Shows the status and configuration of network interfaces.

6.3. wget - Download Files

  • Usage: wget [URL]
  • Example: wget http://example.com/file.zip downloads file.zip from the specified URL.

7. Help and Documentation

7.1. man - View Command Manual Pages

  • Usage: man [command_name]
  • Example: man ls opens the manual page for the ls command.

7.2. --help - Command Help Option

  • Usage: [command_name] --help
  • Example: ls --help displays usage options for the ls command.

8. Conclusion

This guide covers the basic commands and concepts for those who want to get started with the Linux command line. For more advanced commands and applications, refer to Linux documentation and online resources. The most important part of learning Linux is to practice what you have learned.

Release date : 08.07.2024 Author : Samet Views : 58 Category : Linux

Share : Twitter / Facebook

Comments Made
No comments have been written on this topic yet.
Write a Comment
Name & Surname :
E-Mail :
Web Site :
Message :
Security Code: Güvenlik Kodu
Frequently Asked Questions

Web sitelerini oluşturan web sayfalarının temel yapı taşı, HTML kısaltması ile anılan HyperText Markup Language isimli biçimleme dilidir. HTML kodlaması web tasarımcı tarafından manuel olarak yapılan, bir veritabanı desteği ile çalışmayan web sitelerine statik web sitesi denir.

Kısaca, bir içerik yönetim sistemi yazılımı ve veritabanı desteği ile çalışan web siteleridir. İçerik yönetim sistemi, siteye gelen ziyaretçinin görüntülemek istediği sayfayı o anda yaratır. İçerik yönetim sistemi bu işlemi veritabanından çektiği yazılı içeriği, sunucudaki görsel içerik ve tasarım şablonuyla birleştirmek suretiyle yapar.
  • Browse Related Topics.