Code Monkey home page Code Monkey logo

linux-commands-'s Introduction

Linux, a powerful and versatile operating system, is known for its robust command-line interface. Here's a comprehensive guide to some fundamental Linux commands that you'll find useful whether you are a beginner or an advanced user. The commands can be entered in the terminal, which is Linux's command-line interface.

Basic Navigation

  • pwd - Print Working Directory. Shows the current directory you are in.
  • ls - Lists all files and folders in the current directory.
    • ls -l - Provides detailed information including permissions, number, owner, size, and date of last modification.
    • ls -a - Lists all entries including hidden files starting with '.'.
  • cd - Change Directory.
    • cd .. - Moves up one directory.
    • cd ~ - Takes you to your home directory.
  • whoami - Displays the current user logged in.
  • man [command] - Shows the manual for the specified command.

File Management

  • touch [file] - Creates a new file or updates the timestamp on an existing file.
  • cp [source] [destination] - Copies files or directories.
    • cp -r [source_directory] [destination_directory] - Copies directories recursively.
  • mv [source] [destination] - Moves or renames files or directories.
  • rm [file] - Removes a file.
    • rm -r [directory] - Recursively removes a directory and all its contents.
  • mkdir [directory] - Creates a new directory.
  • rmdir [directory] - Removes an empty directory.

File Viewing & Editing

  • cat [file] - Displays the content of a file on the terminal.
  • less [file] - Views the content of a file one page at a time.
  • head [file] - Displays the first 10 lines of a file (customizable with -n option).
  • tail [file] - Displays the last 10 lines of a file (also customizable).
  • nano [file] - Opens the nano editor with the specified file.
  • vi [file] - Opens the vi/vim editor with the specified file.

System Monitoring

  • top - Displays an ongoing view of all running processes.
  • ps - Lists snapshots of current processes.
    • ps aux - Shows detailed information about all running processes.
  • df - Reports the amount of disk space used and available on filesystems.
    • df -h - Shows the disk space in human-readable format.
  • free - Shows the amount of free and used memory in the system.
    • free -h - Outputs the information in human-readable format.

Networking

  • ping [address] - Checks connectivity between the host and the target address.
  • ifconfig - Displays network interface configuration and can also set up an interface.
  • wget [URL] - Downloads files from the internet.
  • curl [URL] - Transfers data from or to a server.
  • ssh [user@host] - Connects to a remote host via Secure Shell.

System Management

  • sudo [command] - Executes a command with superuser privileges.
  • apt-get update and apt-get upgrade - Updates package list and upgrades all packages respectively (specific to Debian-based systems like Ubuntu).
  • chmod [permissions] [file] - Changes the file permissions.
  • chown [owner]:[group] [file] - Changes the owner and/or group of a file.

Searching and Sorting

  • grep [pattern] [file] - Searches for a specific pattern in the file's content.
  • find [directory] -name [search_pattern] - Finds files and directories based on a pattern.
  • sort [file] - Sorts the contents of a file.

These commands are just the basics to get you started with Linux. There are countless more commands and options to explore depending on what you need to achieve. For specific tasks or advanced functionality, referring to the manual pages (man command) is highly recommended.

linux-commands-'s People

Contributors

sandysanthosh avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.