토. 7월 26th, 2025

Navigating Linux starts with the terminal. Here are fundamental commands every beginner should know, with practical examples:


1. File & Directory Operations

  1. pwd
    Print current directory path.
    $ pwd/home/user

  2. ls
    List directory contents.
    $ ls -lDetailed view (permissions, size)

  3. cd
    Change directory.
    $ cd DocumentsEnter “Documents” folder

  4. mkdir
    Create a directory.
    $ mkdir new_folder

  5. touch
    Create an empty file.
    $ touch file.txt

  6. cp
    Copy files/directories.
    $ cp file.txt backup/

  7. mv
    Move/rename files.
    $ mv old.txt new.txtRenaming
    $ mv file.txt ~/Documents/Moving

  8. rm
    Remove files/directories.
    $ rm file.txtDelete file
    $ rm -r old_dir/Delete directory (recursive)

  9. cat
    Display file content.
    $ cat notes.txt

  10. head / tail
    Show first/last lines of a file.
    $ tail -5 log.txtLast 5 lines


2. System & Process Management

  1. ps
    List active processes.
    $ ps auxDetailed process list

  2. top / htop
    Monitor system resources (CPU, memory).
    $ top

  3. kill
    Terminate processes.
    $ kill 1234End process with PID 1234

  4. df
    Check disk space.
    $ df -hHuman-readable format

  5. free
    Display memory usage.
    $ free -mShow in megabytes

  6. uname
    Print system information.
    $ uname -aKernel version, hardware


3. Text & Search Tools

  1. grep
    Search text patterns.
    $ grep "error" log.txtFind “error” in file

  2. find
    Locate files/directories.
    $ find /home -name "*.jpg"Search .jpg files

  3. wc
    Count lines/words/characters.
    $ wc -l data.csvLine count

  4. echo
    Print text/variables.
    $ echo $HOME/home/user

  5. nano / vim
    Text editors.
    $ nano file.txt


4. Networking

  1. ping
    Test network connectivity.
    $ ping google.com

  2. ifconfig / ip
    Configure network interfaces.
    $ ip addr show

  3. ssh
    Connect to remote servers.
    $ ssh user@192.168.1.10

  4. wget / curl
    Download files.
    $ wget https://example.com/file.zip


5. Permissions & Users

  1. chmod
    Change file permissions.
    $ chmod 755 script.shUser: rwx, Group/Others: rx

  2. chown
    Change file owner.
    $ chown user:group file.txt

  3. sudo
    Execute commands as superuser.
    $ sudo apt update

  4. passwd
    Change user password.
    $ passwd


6. Package Management

  1. APT (Debian/Ubuntu)
    $ sudo apt install nginxInstall package
    $ sudo apt remove nginxRemove package

  2. YUM/DNF (Fedora/CentOS)
    $ sudo dnf install httpd


7. Compression & Archives

  1. tar
    Create/extract archives.
    $ tar -czvf archive.tar.gz /folder/Compress
    $ tar -xzvf archive.tar.gzExtract

  2. zip/unzip
    Handle .zip files.
    $ unzip files.zip


8. Shortcuts & Help

  1. man
    Access command manuals.
    $ man ls

  2. history
    View command history.
    $ history | grep "ssh"

  3. clear
    Clean terminal screen.
    $ clear


Pro Tips:

  • Use Tab for auto-completion.
  • Chain commands with | (pipe):
    $ cat log.txt | grep "warning" | wc -lCount warnings
  • Combine commands with &&:
    $ mkdir new && cd new

Master these to navigate Linux confidently! 🐧

답글 남기기

이메일 주소는 공개되지 않습니다. 필수 필드는 *로 표시됩니다