Sponsorizzato

Top 50 Linux Commands for Beginners

0
772

Linux, a powerful and versatile operating system, offers a vast array of commands to manage and manipulate your system. While mastering all of them might take time, a solid understanding of the most common ones can significantly enhance your productivity. Let's dive into the top 50 Linux commands that every beginner should know.

Navigation and File Management

  1. ls: Lists files and directories in the current directory.

    • ls -l: Lists files in long format, displaying details like permissions, owner, size, and modification time.
    • ls -a: Lists all files, including hidden ones (starting with a dot).
    • ls -h: Lists file sizes in human-readable format (e.g., 1.2K, 2.3M).
  2. pwd: Prints the current working directory.

  3. cd: Changes the current working directory.

    • cd ..: Moves to the parent directory.
    • cd ~: Moves to the home directory.
  4. mkdir: Creates a new directory.

  5. rmdir: Removes an empty directory.

  6. cp: Copies files or directories.

    • cp source destination: Copies a file or directory to a new location.
    • cp -r source destination: Recursively copies directories and their contents.
  7. mv: Moves or renames files or directories.

  8. rm: Removes files or directories.

    • rm -r directory: Recursively removes a directory and its contents. Use with caution!
  9. touch: Creates a new file or updates the modification time of an existing one.

  10. ln: Creates symbolic links (shortcuts).

  • ln -s source link: Creates a symbolic link to the source file.

File Viewing and Editing

  1. cat: Concatenates and displays file contents.
  • cat file1 file2: Concatenates the contents of file1 and file2 and displays them.
  1. head: Displays the first few lines of a file.
  • head -n 5 file: Displays the first 5 lines of the file.
  1. tail: Displays the last few lines of a file.
  • tail -n 10 file: Displays the last 10 lines of the file.
  1. less: Page through a file one screen at a time.
  • Use the spacebar to scroll down, b to scroll up, / to search, and q to quit.
  1. nano: A simple text editor.
  • Use Ctrl+X to exit, Ctrl+O to save, and Ctrl+W to search.
  1. vim: A powerful text editor.
  • Requires learning basic commands, but offers extensive features.

Text Processing

  1. grep: Searches for patterns in files.
  • grep pattern filename: Searches for the pattern in the specified file.
  • grep -i pattern filename: Case-insensitive search.
  1. sed: Stream editor for manipulating text.
  • Can be used for complex text substitutions and transformations.
  1. awk: Text processing tool for extracting and manipulating data from files.
  • Powerful for data analysis and reporting.

System Information and Processes

  1. pwd: Prints the current working directory.

  2. whoami: Prints the current username.

  3. uname: Prints system information.

  • uname -a: Prints all system information.
  1. ps: Displays information about running processes.
  • ps aux: Lists all running processes with detailed information.
  1. top: Displays dynamic system information, including CPU and memory usage.

  2. kill: Terminates a process.

  • kill PID: Kills the process with the specified process ID (PID).
  1. killall: Kills all processes matching a given name.

Disk and File System Information

  1. df: Displays disk usage information.
  • df -h: Displays disk usage information in human-readable format.
  1. du: Displays disk usage for files and directories.
  • du -sh *: Displays disk usage for all files and directories in the current directory.
  1. mount: Mounts file systems.

  2. umount: Unmounts file systems.

Networking

  1. ifconfig: Displays network interface information.

  2. ping: Sends ICMP echo requests to a host.

  3. ssh: Secure Shell, used for remote login and file transfer.

  4. scp: Secure Copy, used for copying files securely over SSH.

Package Management

  1. apt-get: Package management tool for Debian-based systems (e.g., Ubuntu).
  • sudo apt-get update: Updates package lists.
  • sudo apt-get install package_name: Installs a package.
  • sudo apt-get remove package_name: Removes a package.
  1. yum: Package management tool for RPM-based systems (e.g., CentOS, Fedora).

Other Useful Commands

  1. date: Displays the current date and time.

  2. cal: Displays a calendar.

  3. clear: Clears the terminal screen.

  4. history: Displays a list of previously executed commands.

  5. man: Displays the manual pages for a command.

  6. sudo: Executes a command with superuser privileges.

  7. find: Searches for files and directories.

  8. locate: Searches for files by name (requires a database to be updated).

  9. which: Locates a command in the PATH.

  10. whereis: Locates a command's binary, source code, and manual page.

  11. chmod: Changes file permissions.

  12. chown: Changes file ownership.

  13. tar: Archives and compresses files.

  14. unzip: Unzips compressed files.

Conclusion

This list provides a strong foundation for your Linux journey. As you gain more experience, you'll discover even more powerful commands and techniques. Remember, practice is key to mastering Linux. Experiment with these commands, explore their options, and don't be afraid to make mistakes. With time and dedication, you'll become a proficient Linux user.

Sponsorizzato
Cerca
Recomended
Categorie
Leggi tutto
Giochi
World of Warcraft Dragonflight Pre-Patch Launches October 25
World of Warcraft players are excitedly anticipating the new Dragonflight expansion and the...
By classicgold igvwow 2022-11-17 00:48:05 0 4K
Home
Giants comeback falls shorter, get rid of 4-3 in direction of Pirates in just accessories
Inspite of a late inning comeback test, the San Francisco Giants dropped toward the Pittsburgh...
By Blanco Ronel 2024-07-17 09:57:43 0 9K
Religion
লুমাযাহ কারা?
লুমাযাহ কারা? (সুরা হুমাযাহ)************************আমাদের আশেপাশে এমন অনেক মানুষ আছেন, যারা বুক...
Drinks
Prized Cavs novice out with problem
CLEVELAND, October. 28 UPI) -- The Cleveland Cavaliers will be with no beginner safeguard Dajuan...
By Holmes Ambroses 2024-09-11 02:17:59 0 4K
Giochi
Shakur Stevenson Promises Superstar Performance on July 6, Rips Detractors
Lightweight titleholder Shakur Stevenson is ready to rejuvenate his career following a...
By Shakur Stevenson 2024-05-25 05:23:13 0 5K
Sponsorizzato