Magic with Linux Commands
Tags: linux, commands, ubuntu, terminal
Published: 2023-07-22 11:48:04

"Linux: Where Geeks Roam Free!"

Welcome to the world of Linux, a place where the nerds, tech enthusiasts, and code wizards run wild! Linux is like an amusement park for computer geeks, offering a rollercoaster of open-source adventures and thrilling command-line rides.

Picture yourself strapping into the Terminal Express, a command-line coaster that takes you on a journey through the file system's twists and turns. Hold on tight as you ls your way through directories, discovering hidden files like buried treasures waiting to be found!

### A. File and Directory Management Linux Commands: 

1. **ssh** - Secure Shell, used for secure remote access to a system.
2. **ls** - List directory contents.
	A. **ls - a**, (--all) : do not ignore entries starting with .
	B. **ls -A**, (--almost -all) : don’t list implied . and ..
	C. **ls --l** : with -a, print the author of each file 

3. **pwd** - Print the current working directory.
4. **cd** - Change directory to a different folder.
5. **touch** - Create an empty file or update the modified timestamp of an existing file.
6. **echo** - Print a message or the value of a variable.
7. **nano**- A simple text editor.
8. **vim** - A more advanced text editor with many features.
	A. press “**I**” to Insert anything
	B. press **Esc key then :wq** to save and exit the changes you’ve made.

9. **cat** - Print the contents of a file to the console.
10. **shred** - Securely delete a file by overwriting its contents(encrypts the data)
11. **mkdir** - Create a new directory.
12. **cp** - Copy a file from one location to another.
13. **mv** - Move a file from one location to another, or rename a file.
14. **rm** - Remove a file.
15. **rmdir** - Remove a directory if it is empty.
16. **ln** - Create a link to a file or directory.


### B. System Management Commands: 

17. **clear** - Clear the console.
18. **useradd** - Add a new user to the system.
19. **sudo** - Run a command with administrative privileges.
20. **adduser** - Add a new user to the system with more options than useradd.
21. **su** - Switch to another user account.
22. **exit** - Close the current terminal or log out of the current user account.
23. **sudo passwd** - Change the password for the current user.
24. **sudo passwd [username]** - Change the password for another user.
25. **sudo apt** - A package manager used to install, update and remove software packages on Debian-based           systems.
26. **sudo apt update & install** - Update package lists and install packages.
27. **finger** - Display information about a user.
28. **man** - Display the manual page of a command.
29. **whatis** - Display a brief description of a command.
30. **which** - Locate a command and display its path.
31. **whereis** - Locate the binary, source, and manual page files for a command.
32. **wget** - Download files from the web.
33. **curl** - Transfer data to or from a server.
34. **zip** - Compress files into a zip archive.
35. **unzip** - Extract files from a zip archive.
36. **less** - View a file one page at a time.


### C. File Comparison and Manipulation Commands:

37. **head** - Display the first lines of a file.
38. **tail** - Display the last lines of a file.
39. **cmp** - Compare two files byte by byte.
40. **diff** - Display the differences between two files.
41. **sort** - Sort the lines of a file.
42. **find** - Search for files in a directory hierarchy.
43. **chmod** - Change the permissions of a file or directory.
44. **chown** - Change the owner of a file or directory.




### D. Networking Management & Monitoring Commands: 

45. **ifconfig** - Configure network interfaces.
46. **ip address** - Display IP address information.
47. **ip address | grep eth0** - Display the IP address of the eth0 interface.
48. **ip address | grep eth0 | grep inet | awk** - Display the IP address of the eth0 interface using awk.
49. **resolvectl status** - Display the current DNS resolver configuration.
50. **ping** - Test network connectivity by sending packets to a host.
51. **netstat** - Display network connections, routing tables, and interface statistics.
52. **-tulpn** - Display active listening ports and associated programs.
53. **ss** - Display socket statistics.
54. **iptables** - Configure and administer the netfilter firewall.
55. **ufw** - A user-friendly interface to manage iptables firewall rules.

### E. System Information & Process Management Commands:

56. **uname** - Print system information, including kernel name, network node hostname, kernel release, and kernel version.
57. **neofetch** - Display system information in a colorful and visually appealing way. (you’ve to install neofetch with sudo apt install neofetch first)
58. **cal** - Display a calendar of the current month or year.
59. **free** - Display the amount of free and used system memory.
60. **df and df-H** - Display disk usage statistics for a file system.
61. **ps** - Report a snapshot of current processes.
62. **top** - Display dynamic real-time information about running processes.
63. **kill** - Send a signal to terminate a process.
64. **pkill** - Send a signal to terminate one or more processes based on their name.
65. **systemctl** - Control the systemd system and service manager.
66. **history** - Display previously executed commands.
67. **sudo reboot** - Reboot the system with administrative privileges.
68. **shutdown** - Shutdown or reboot the system.