"Linux Command-Line Specialist | Ubuntu Enthusiast"
Saurabh Rajput
"DevOps Engineer | Streamlining Development and Operations for Efficient Software Delivery"
File Crete:
- touch :Creates an empty file
- echo with redirection (> or >>): Writes text into a file using the echo command.
- cat: Can be used to create a new file by redirecting nothing into a file.
- printf : Creates and writes content into a file using the printf command.
- Text Editors (nano, vi, vim, emacs): ext editors can be used to create and edit files.
- dd if=/dev/zero of=output_file.txt bs=1024 count=10 : Can be used to create files of a specified size.
- truncate -s 1M filename.txt : Creates or shrinks a file to a specified size.This will create a file (filename.txt) with a size of 1MB.
File Operations:
- ls: List directory contents.
- cd: Change directory.
- pwd: Print working directory.
- mkdir: Make directory.
- rm: Remove files or directories.
- cp: Copy files or directories.
- mv: Move or rename files or directories.
File Viewing/Editing:
- cat: Display file content.
- more/less: View file content page-wise.
- nano/vi/vim: Text editors to create or modify files.
System Information:
- uname: Print system information.
- top/htop: Display system processes and resource usage.
- df: Show disk space usage.
- free: Display amount of free and used memory in the system.
User Management:
- useradd: Create a new user.
- userdel: Delete a user.
- passwd: Change user password.
Package Management:
- apt/yum/dnf: Package management tools for installing, updating, and removing software packages.
- apt-get install [package]: Install a package using APT.
- yum install [package]: Install a package using YUM.
Networking:
- ifconfig/ip: Show network configuration.
- ping: Check connectivity to a server.
- ssh: Securely connect to a remote server.
- scp: Securely copy files between machines.
Process Management:
- ps: Show current running processes.
- kill: Terminate a process.
- killall: Terminate processes by name.
File Permissions:
- chmod: Change file permissions.
- chown: Change file ownership.
Compression/Archiving:
- tar: Archive files.
- gzip/gunzip: Compress/decompress files.
System Shutdown/Reboot:
- shutdown: Shutdown the system.
- reboot: Reboot the system
Group Create :
- groupadd :Replace group_name with your desired group name. For instance, to create a group named mygroup, execute:
- sudo groupadd mygroup: This command will create a new group named mygroup. You'll need administrative privileges (via sudo) to create a group on most systems.
Soft Link (Symbolic Link) Creation:
ln -s: /path/to/original_file /path/to/link_name
Hard Link Creation:
ln : /path/to/original_file /path/to/hard_link
Exit