Table of contents
Essential Linux Commands
Here is a list of powerful Linux commands to navigate and manage your server environment effectively
sudo -i
: Switch from ec2-user to root user.sudo su -
: Switch to root user.logout
(Ctrl + D): Switch from root to ec2-user.cat /proc/cpuinfo
orlscpu
: Display CPU information.cat /proc/meminfo
orlsmem
: Display memory information.fdisk -l
orlsblk
: Show volume information.ifconfig
,ip addr
,ip addr show
,hostname -i
: Display IP address.clear
(Ctrl + L): Clear the screen.
File Commands
touch file
: Create a file.ls
orll
: Show list of files.cat file1
: Display the content of a file.cat >> file1
: Insert content into a file.Press
Ctrl + D
: Save and exit from a file.cp file1 file2
: Copy content from file1 to file2.mv file1 file2
: Rename file1 to file2.rm file1
orrm file1 -f
: Remove a file (forcefully).rm * -f
: Remove all files forcefully.touch file{1..100}
: Create 100 files at a time.cat file1 >> file2
: Copy content from file1 to file2 without overriding.
Conclusion
Empower yourself with these Linux commands to navigate your server environment seamlessly. Whether you're a beginner or an experienced user, mastering these commands will enhance your efficiency and control over your Linux-based systems. Happy exploring!