commit b5b19a05d9f131c7463b25f51f430c93baf51918 Author: Eng-Mahmoud-Walid Date: Thu Sep 25 20:29:21 2025 +0300 Add Linux-Commands.txt diff --git a/Linux-Commands.txt b/Linux-Commands.txt new file mode 100644 index 0000000..a82832a --- /dev/null +++ b/Linux-Commands.txt @@ -0,0 +1,76 @@ +# List files and directories in the current location +ls + +# Change directory +cd /path/to/dir + +# Display the content of a file +cat file.txt + +# Print text to the terminal +echo "Hello World" + +# Remove a file or folder (-r for directories) +rm file.txt +rm -r folder_name + +# Create a new directory +mkdir new_folder + +# Create an empty file +touch new_file.txt + +# Move or rename a file/directory +mv old_name.txt new_name.txt +mv file.txt /path/to/destination/ + +# Copy a file or directory (-r for directories) +cp file.txt copy.txt +cp -r folder /path/to/destination/ + +# Search for text inside a file +grep "keyword" file.txt + +# Git commands +git init # Initialize a new repository +git status # Show the status of files +git add . # Add all files to staging +git commit -m "Message" # Commit changes with a message + +# Download files from the internet +wget https://example.com/file.zip + +# Package management (Ubuntu/Debian) +apt update +apt upgrade +apt install package_name + +# Manage services with systemctl +systemctl status service_name +systemctl start service_name +systemctl stop service_name + +# Manage services (old command, alternative to systemctl) +service service_name start +service service_name stop + +# Monitor processes and system resources +top # Basic monitoring tool +htop # Advanced monitoring tool (needs installation) + +# Text editors +vi file.txt +vim file.txt +nano file.txt + +# View file content page by page +less file.txt + +# Show the first lines of a file +head file.txt +head -n 20 file.txt # Show first 20 lines + +# Show the last lines of a file +tail file.txt +tail -f log.txt # Follow file updates live +