Basic operations and instructions for Ubuntu system

Terminal operations and command line

  • Open the terminal: Use the shortcut key Ctrl + Alt + Tto open the terminal.
  • Common command line operations:
    • Switch directories: use cdthe command, for example cd /path/to/directory.
    • View file contents: Use catthe command, for example cat filename.txt.
    • Create a file: use touchthe command, for example touch filename.txt.
    • Delete files: Use rmthe command, for example rm filename.txt.
  • File and directory management:
    • List directory contents: Use lscommands such as lsor ls /path/to/directory.
    • Switch directories: use cdthe command, for example cd /path/to/directory.
    • To view the current directory path: use pwdthe command, for example pwd.
    • Create a directory: Use mkdirthe command, for example mkdir directoryname.
    • Delete a directory: use rmdirthe command, for example rmdir directoryname.
  • Package management:
    • Install a package: Use apt-getthe command, for example sudo apt-get install packagename.
    • Update packages: Use apt-getthe command, for example sudo apt-get update.
    • Uninstall a package: use apt-getthe command, for example sudo apt-get remove packagename.
  • System information and monitoring:
    • View system information: Use unamethe command, for example uname -a.
    • View system resource usage: Use topthe command, for example top.
    • View memory usage: Use freethe command, for example free -h.
    • View disk usage: Use dfthe command, for example df -h.
  • Process management:
    • View processes: Use psthe command, for example ps aux.
    • Kill a process: Use killthe command, for example kill process_id.
  • Network management:
    • View network interface information: Use ifconfigthe command, for example ifconfig.
    • Test network connectivity: Use pingthe command, for example ping hostname.
    • Remote connection: use sshthe command, for example ssh username@hostname.
  • Permissions and user management:
    • Modify file permissions: use chmodthe command, for example chmod 755 filename.
    • Modify file owner: use chowncommand, for example chown username filename.
    • To add a new user: use useraddthe command, for example sudo useradd username.
    • To delete a user: use userdelthe command, for example sudo userdel username.
  • Command line editor:
    • Using the nano editor: Use nanothe command, for example nano filename.
    • Using the vim editor: use vimthe command, for example vim filename.
  • Script writing and execution:
    • Create a script file: Use a text editor to create a new file and add the script content.
    • Execute a script file: use bashthe command, for example bash scriptname.sh.

Supongo que te gusta

Origin blog.csdn.net/gao511147456/article/details/135067121
Recomendado
Clasificación