Linux is a powerful and widely used open-source operating system renowned for its stability, security, and flexibility. I am learning Linux Commands. If I see any command that is important or most frequently used, then I will add the command and description to the blog.
File and Folder Management:
ls
- List Files and Directories:
example: Listing the contents of your home directory.
ls ~
cd
- Change Directory:
example: Moving into the Documents directory.
cd ~/Documents
touch
- Create Empty Files:
example: Creating a new text file named "example.txt."
touch example.txt
mkdir
- Create Directories:
example: Creating a directory named "projects."
mkdir projects
cp
- Copy Files and Directories:
example: Copying a file from one directory to another.
cp file.txt /path/to/destination/
mv
- Move/Rename Files and Directories:
example: Renaming a file.
mv oldfile.txt newfile.txt
rm
- Remove Files and Directories:
example: Deleting a file.
rm unwantedfile.txt
File Permissions:
chmod
- Change File Permissions:
example: Making a script executable.
chmod +x myscript.sh
chown
- Change File Ownership:
example: Changing the owner of a file.
chown newowner:groupname myfile.txt
User and Group Management:
useradd
- Add Users:
example: Adding a new user named "johndoe."
sudo useradd johndoe
userdel
- Delete Users:
example: Removing the user "johndoe."
sudo userdel johndoe
passwd
- Change User Passwords:
example: Changing the password for the user "johndoe."
sudo passwd johndoe
groupadd
- Create Groups:
example: Creating a group named "developers."
sudo groupadd developers
groupdel
- Delete Groups:
example: Removing the group "developers."
sudo groupdel developers
usermod
- Modify User Attributes:
example: Adding a user to the "developers" group.
sudo usermod -aG developers johndoe
Editor
nano example.txt
Create a Python environment in Linux (Ubuntu)
apt update
apt install python3.12
python3.12 --version
python3.12 -m pip
pip3.12 -V
python3.12 -m venv --help
sudo apt install python3.12-venv
----create environment Name "python-env-file"---
python3.12 -m venv python-env-file
------------"install all dependencies of requirements.txt"--------
pip3.12 install -r requirements.txt
Top comments (0)