Sponsorluk

Top 50 Linux Commands for Beginners

0
739

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.

Sponsorluk
Site içinde arama yapın
Recomended
Kategoriler
Read More
Food
Eco-Friendly Custom Parchment Paper for Baking and Packaging Excellence
Custom parchment paper is essential in any professional or home kitchen. It serves as a non-stick...
By Books Sss 2024-09-30 05:21:54 0 2K
Shopping
Investigating the Corteiz Tracksuit Universe
Investigating the Corteiz Tracksuit Universe Regarding fashionable and cozy tracksuits, Corteiz...
By Corteiz Shorts 2024-10-28 11:21:05 0 2K
Film
সাজিদ খানের বিরুদ্ধে নতুন বোমা ফাটালেন রানি
ভারতের জনপ্রিয় বিয়্যালিটি শো ‘বিগ বস’ সিজন ১৬-তে অংশ নিয়ে দেশটির বিনোদন জগত থেকে শুরু...
By Ekattor Television 2022-11-05 12:41:11 0 3K
Networking
ভাইরাল হতে ‘ব্যাংকে টাকা নেই’ গুজব ছড়ান সাইফুল
‘দেশের ব্যাংকে টাকা নেই’ ফেসবুকে এমন একটি পোস্টে যখন তোলপাড় চলছে তখন একাত্তরের...
By Ekattor Television 2022-11-26 01:35:52 0 5K
Uncategorized
ট্রাম্পের টুইটার অ্যাকাউন্ট ফেরত দেওয়া নিয়ে মাস্কের জরিপ
যুক্তরাষ্ট্রের সাবেক প্রেসিডেন্ট ডোনাল্ড ট্রাম্পের টুইটার অ্যাকাউন্ট ফেরত দেওয়া উচিত কি না, এ...
By Prothom Alo 2022-11-19 14:45:42 0 4K
Sponsorluk