Linux Web Programming

Common Linux Commands

Common Commands in Linux

  1. Install MariaDB server and client
    1. Update the server: sudo apt update -y
    2. Add the official MariaDB apt repository: curl -LsS https://r.mariadb.com/downloads/mariadb_repo_setup | sudo bash
    3. Install the MariaDB server and client: sudo apt-get install mariadb-server mariadb-client -y
    4. Check the status: sudo systemctl status mariadb
  2. Open a text file for reading: cat "mytext.txt" or less "mytext.txt" to page and search the file for "findthis" by entering /findthis. Press q to quit.
  3. Check for listening ports: ss -nlt
  4. Display a dynamic view of the currently running processes and threads: top
  5. Make a new directory inside the current directory. Use mkdir mydir make a directory name "mydir" inside the current directory.
  6. To remove an empty directory, use rmdir mydir remove the empty directory "mydir".
  7. To remove a file, use rm myfile remove the file "myfile".
  8. To remove a directory and everything in it, use rm -r mydir remove the directory "mydir" and remove everything within it recursively.
  9. Change the current directory. Use cd mydir to switch to the directory "mydir" inside the current directory.
  10. List the contents of the current directory: ls or ls -a to list everything.
  11. Get your current username: whoami
  12. Print the name of the current working directory: pwd
  13. Check what is installed: apt list --installed or dpkg --list | more
    • For the next page, press <space>. For the next line, press <Enter>. Press "q" to quit or "h" for help.
 
 

© 2007–2025 XoaX.net LLC. All rights reserved.