
Mastering Linux starts with understanding its command-line interface. This comprehensive guide provides a detailed overview of 25 essential Linux commands, complete with practical examples and explanations. From navigating directories to managing files and system processes, this guide empowers beginners to confidently explore the world of Linux. Let's dive in!
1. Navigating Files and Directories: Your Linux GPS

Think of files and directories as the streets and buildings of your Linux system. These commands are your GPS!
pwd (Print Working Directory)
Lost? Never again! pwd
reveals your current location (directory) in the file system. It's like checking your GPS coordinates – always good to know where you are before heading somewhere new. It might spit out something like /home/user/documents
, showing you the complete path.
ls (List)
Want to see what's around? ls
is your friend. It lists all files and directories in your current location. For more details (like file size and modification time), use ls -l
. Want to see everything, including hidden files? ls -a
is your go-to. It's like looking around your current directory!
cd (Change Directory)
Ready to explore? cd
lets you move between directories. cd /tmp
takes you to the /tmp
directory. Want to go back up a level? Just use cd ..
. And cd
by itself (with no arguments) zips you back to your home directory. It's like teleporting within your Linux system!
mkdir (Make Directory)
Need a new place to store things? mkdir new_directory
creates a new directory called "new_directory" in your current location. It's like building a new folder!
rmdir (Remove Directory)
Time to do some spring cleaning? rmdir directory_name
removes an empty directory. Be careful though – if the directory isn't empty, it won't be deleted! This command is like demolishing an empty building – make sure it's vacant first!
rm (Remove)
This command is a powerful tool! It deletes files and directories. rm file_name
removes a file. For directories (and everything inside!), use rm -r directory_name
. Handle with care – this command is like a digital shredder; once something is gone, it's gone!
2. File Creation and Manipulation: Become a Linux Architect

Now that you know how to navigate, let’s create and modify files. Become a true Linux architect!
touch
Create a new, empty file with touch new_file.txt
. This command is also handy for updating a file's timestamp – think of it as a gentle nudge to the system, reminding it that the file exists.
cat (Concatenate)
Want a quick peek at a file's contents? cat file.txt
displays the entire file content in your terminal. For larger files, consider using less
, which is designed for easier viewing.
less
Think of less
as a more refined way to view file content. less file.txt
lets you scroll through the file page by page (using the spacebar and 'b' key). Press 'q' to exit.
head
Just need a glimpse of the beginning? head file.txt
shows the first 10 lines. Want to see a different number? Use head -n 5 file.txt
to see the first five lines. It's like skimming the introduction of a book.
tail
Need the latest updates? tail file.txt
displays the last 10 lines. tail -n 2 file.txt
shows the last two. For real-time monitoring (perfect for log files!), use tail -f file.txt
. It's like watching a live stream of your file!
cp (Copy)
Need a duplicate? cp source_file destination_file
creates a copy. For directories, use cp -r source_directory destination_directory
to copy the directory and everything within it.
mv (Move)
Renaming or relocating? mv old_name new_name
renames a file or directory. mv file_name /path/to/destination
moves it to a new location. It’s your versatile moving and renaming tool!
echo
Need to display some text or write to a file? echo "Hello, world!"
prints the text to the terminal. echo "New content" > file.txt
writes the text to a file (overwriting its current content, so be careful!).
3. System Information and Management: Your Linux Control Panel

These commands give you insights into your system and allow you to manage its resources.
date
What time is it? date
tells you the current date and time.
cal
Need a calendar? cal
displays the current month's calendar. Use cal 2024
to see the whole year!
whoami
Who are you? In the Linux world, whoami
reveals your current username.
who
Who's logged in? who
lists all currently logged-in users.
ps (Process Status)
What's running? ps
shows the running processes. Use ps aux
for a detailed view of all processes. It’s like checking the task manager!
top
System resources at a glance! top
provides a dynamic, real-time view of CPU usage, memory consumption, and more. It's your system performance dashboard!
df (Disk Free)
How much space is left? df
shows disk space usage. Essential for avoiding those dreaded "disk full" errors!
du (Disk Usage)
How big are those files and directories? du
reveals their sizes. Great for tracking down storage hogs.
uname (Unix Name)
What kind of system is this? uname
provides system information. uname -a
gives you all the juicy details, like kernel version and system architecture.
4. Other Essential Commands: Linux Swiss Army Knife

These additional commands will make your Linux journey smoother and more efficient.
clear
Tidy up your terminal with clear
. It clears the screen, giving you a fresh start.
history
Can't remember that command you used earlier? history
displays your command history. Use the up and down arrows to navigate and repeat previous commands.
man (Manual)
Need help with a command? man ls
(or any other command) displays its manual page, explaining its usage and options. It’s your built-in Linux encyclopedia!
grep (Global Regular Expression Print)
Searching for a needle in a haystack? grep "pattern" file.txt
searches for a specific pattern within a file. A powerful tool for finding what you need!
alias
Tired of typing long commands? alias la="ls -la"
creates a shortcut for ls -la
. Now you can just type la
to get the same result. Customize your shortcuts for maximum efficiency!
This comprehensive guide equips you with the essential commands to navigate, manage, and explore the powerful world of Linux. Practice these commands, explore their options, and embrace the command line – you'll be amazed at what you can achieve! Happy commanding!
'뉴스위드' 카테고리의 다른 글
로봇, 코딩 대신 사람처럼 직접 배운다? 미래 로봇 학습법 (1) | 2024.12.02 |
---|---|
클라우드 백업, 안전할까? 솔루션 선택 4계명과 실패 사례 (1) | 2024.12.02 |
인스타그램 로그인 장애, 메타에 과태료 500만원 부과 (1) | 2024.12.01 |
카톡 주변 친구 초대 기능 전화번호 없이 그룹채팅 참여! (0) | 2024.12.01 |
리플 급등! SEC 위원장 사임, 코인 시장 영향 분석 (2) | 2024.12.01 |