Skip to content

MuhammedMagdyy/Linux-Commands

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 

Repository files navigation

📚 Linux Commands Reference Guide

Linux Visitors

A comprehensive, beginner-friendly guide to essential Linux commands. This repository was created to help students in the Operating Systems course at October 6 University, but it's perfect for anyone starting their Linux journey!

🎯 Purpose

Whether you're a computer science student, a developer transitioning to Linux, or someone curious about the command line, this guide provides:

  • Clear explanations of essential Linux commands.
  • Practical examples you can try immediately.
  • Structured learning from basic to more advanced operations.
  • Quick reference for daily use.

📖 Table of Contents

🚀 Getting Started

  1. Open your terminal (Ctrl+Alt+T on most Linux distributions).
  2. Start with basic commands like pwd, ls, and cd.
  3. Practice each command in a safe directory.
  4. Use man [command] to learn more about any command.

📋 Prerequisites

  • Any Linux distribution (Ubuntu, Debian, CentOS, etc.)
  • Basic understanding of what a terminal is.
  • No prior command-line experience required!

💡 Tip: If you're new to Linux, consider starting with a user-friendly distribution like Ubuntu.

🎥 Video Tutorials

I've created comprehensive video playlists (in Arabic) to supplement this guide:

📚 Command Categories

⚡ General Commands

These are the fundamental commands you'll use daily:

Command Description Example
date Display the current date and time date
cal [month] [year] Show calendar for specified month and year cal 12 2024
clear Clear the terminal screen clear
history Show command history history
history -c Clear all command history history -c
whoami Display current username whoami
who Show logged-in users who
echo [text] Print text to the terminal echo "Hello World"
pwd Show current directory path pwd
cd [directory] Change to specified directory cd /home/user/Documents
cd - Return to previous directory cd -
cd .. Go up one directory level cd ..
ls [directory] List files and directories ls -la
man [command] Display manual page for a command man ls
passwd Change user password passwd

👥 User Management

Commands for managing users (requires appropriate permissions):

Command Description Example
su Switch to root user su
exit Logout from current user exit
adduser [username] Add new user to the system adduser john
deluser --remove-home [user] Delete user and their home folder deluser --remove-home john

📁 File & Directory Operations

Essential commands for creating, viewing, and managing files:

Command Description Example
cat [file] Display file contents cat myfile.txt
cat > [file] Create new file and add content cat > newfile.txt
mkdir [directory] Create new directory mkdir my_folder
rmdir [directory] Remove empty directory rmdir empty_folder
rm [file] Delete file rm unwanted_file.txt
rm -r [directory] Delete directory and contents rm -r folder_to_delete
rm -r -i [directory] Delete with confirmation prompts rm -r -i careful_delete

🔄 Copy & Move Operations

Commands for copying, moving, and renaming files and directories:

General Syntax:

cp [options] [source] [destination]
mv [options] [source] [destination]
Command Description Example
cp [file1] [file2] Copy file1 to file2 cp document.txt backup.txt
cp [file1] [file2] [directory] Copy multiple files to directory cp file1.txt file2.txt /backup/
cp -r [directory1] [directory2] Copy directory and all contents cp -r project/ project_backup/
mv [file1] [file2] Move/rename file1 to file2 mv old_name.txt new_name.txt
mv [file1] [file2] [directory] Move multiple files to directory mv file1.txt file2.txt /archive/
mv [directory1] [directory2] Move/rename directory mv old_folder/ new_folder/
mv -i [source] [destination] Move with confirmation if destination exists mv -i important.txt /backup/

💡 Usage Examples

Basic Navigation

# Check where you are
pwd

# List files in current directory
ls

# List files with details
ls -la

# List files with human-readable sizes
ls -lh

# Change to home directory
cd ~

# Go to a specific folder
cd Documents

# Go back to previous directory
cd -

File Operations

# Create a new file
touch newfile.txt

# View file content
cat myfile.txt

# Create a directory
mkdir projects

# Copy a file
cp important.txt important_backup.txt

# Move a file to a directory
mv myfile.txt documents/

Getting Help

# Get help for any command
man ls
man cp
man mv

# Quick help (if available)
ls --help

🤝 Contributing

We welcome contributions from the community! Here's how you can help:

  1. Fork this repository
  2. Create a new branch (git checkout -b feature/new-commands)
  3. Add your improvements or new commands
  4. Commit your changes (git commit -am 'Add new commands')
  5. Push to the branch (git push origin feature/new-commands)
  6. Create a Pull Request

What we're looking for:

  • Additional useful Linux commands.
  • Better examples and explanations.
  • Corrections to existing content.
  • Improved formatting and organization.

📄 License

This project is licensed under the MIT License - see the LICENSE file for details.

⭐ Support

Star this repository if you find it helpful!

🐛 Report issues if you find any problems.

💡 Suggest improvements through issues or pull requests.

Happy learning and welcome to the world of Linux! 🐧

About

A concise, beginner-friendly collection of essential Linux commands and practical examples.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published