Skip to content

clzo-adrian/arch-linux-base-commands

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

10 Commits
Β 
Β 

Repository files navigation

Basic Commands for Linux (Arch)

πŸ“‚ File and Directory Management

  • ls – List files and directories.
    ls -la  # List with details and hidden files
    -l - Long items properties display. -a - Show hidden files(., ..) -la - The 2 previous commands merged.
  • cd – Change directory.
    cd /desired/path
  • pwd – Show the current directory path.
  • mkdir – Create a new directory.
    mkdir new_directory
  • rm – Delete files or directories.
    rm file.txt         # Deletes a file
    rm -r directory     # Deletes a directory and its content
  • cp – Copy files or directories.
    cp file.txt /destination/path
  • mv – Move or rename files.
    mv file.txt new_name.txt

πŸ”§ System Management

  • pacman – Arch Linux package manager.
    sudo pacman -S package           # Install a package
    sudo pacman -R package           # Remove a package
    sudo pacman -Syu                 # Update the system
    sudo pacman -Qs keyword          # Search installed packages
  • systemctl – Service and daemon management.
    sudo systemctl start service     # Start a service
    sudo systemctl stop service      # Stop a service
    sudo systemctl enable service    # Enable a service at startup
    sudo systemctl status service    # Check the status of a service
  • htop – Interactive process monitor.
    sudo pacman -S htop && htop
  • Note: If you want to enable or manage a service with systemd only locally(User only), you need to run one or more of this commands:
    systemctl --user start service # Start a service
    systemctl --user stop service # Stop a service
    systemctl --user enable service # Enable a service at startup
    systemctl --user status sevice # Check the status of a service
  • Syntaxis of systemctl command:
    systemctl --option [command] [service]
    If it is globally
    sudo systemctl --option [command] [service]

πŸ“œ File Viewing and Editing

  • cat – Show the content of a file.
    cat file.txt
  • less – View long files.
    less file.txt
  • nano or vim – Text editors.
    nano file.txt
  • Note: If the file is in a high-rights level
    sudo [program] <file>
    Example:
    sudo vim /etc/conf.d/sensord

πŸ“Š Disk and Space Management

  • df – View filesystem usage.
    df -h
  • du – Check disk usage of a directory or file.
    du -sh directory
  • lsblk – View partitions and block devices.
    lsblk

🌐 Internet Connection

  • Connecting to internet For Ethernet dhcpcd daemon will stablish the connection. For WiFi, you can use iwd package or networkmanager package
    • Who can be installed with sudo pacman -S iwd or sudo pacman -S networkmanager
    • And activated with systemd(systemctl)
  • ping – Test connectivity to an address.
    ping -c 4 google.com
  • ip – Configure and display network information.
    ip a

πŸ”‘ Permissions and Ownership

  • chmod – Change file permissions.
    chmod 755 file.sh
  • chown – Change the owner of a file.
    sudo chown user:group file.txt

πŸ“¦ Compression and Decompression

  • tar – Create or extract tar files.
    tar -czvf file.tar.gz directory
    tar -xzvf file.tar.gz
  • zip/unzip – Compress or decompress zip files.
    zip -r file.zip directory
    unzip file.zip
  • Note: zip/unzip packages must be installed before running zip/unzip, you can install them with the following command: sudo pacman -S zip unzip.

πŸš€ Useful Shortcuts

  • Ctrl + C – Interrupt a running command.
  • Ctrl + Z – Suspend a process.
  • Ctrl + R – Search commands in history.
  • !! – Execute the last command.
    sudo !!

Recommended packages

  • Xscreensaver: sudo pacman -S xscreensaver Screensaver
  • Conky: sudo pacman -S conky Desktop Widgets
  • bpytop: sudo pacman -S bpytop Better htop

About

Base commands for linux.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published