Welcome to Part 6 of the LFCS Certification - Phase 1 series! You've mastered privilege escalation with su and sudo. Now it's time to learn the fundamental rules that govern how Linux commands work. Understanding these basics will prevent countless frustrating errors and make you comfortable with the command line.
๐ฏ What You'll Learn: In this guide, you'll master:
- Why Linux is case-sensitive and what that means for commands
- Understanding command structure (command + options + arguments)
- Short options with single dash (-a, -l)
- Long options with double dash (--all, --list)
- Why single dash vs double dash matters
- How to combine short options (-al vs -a -l)
- Using --help to learn about any command
- Common beginner mistakes and how to avoid them
- Reading command syntax from help output
- Building confidence with command-line options
- 20+ comprehensive practice labs
Series: LFCS Certification Preparation - Phase 1 (Post 6 of 52) Previous: Part 5 - Creating and Managing sudo Configuration Next: Part 7 - Essential Navigation Commands (ls, pwd, cd, whoami)
Linux is Case-Sensitive
One of the first things that surprises Windows users is that Linux is case-sensitive. This applies to commands, filenames, directories, and everything else.
The Case Sensitivity Rule
In Linux:
lsโLSโLsโlSFile.txtโfile.txtโFILE.TXT/Homeโ/home
Let's test this:
[centos9@centos ~]$ ls
# Works - lists directory contents
[centos9@centos ~]$ LS
bash: LS: command not found...
Similar command is: 'ls'
[centos9@centos ~]$ Ls
bash: Ls: command not found...
Similar command is: 'ls'
What happened:
ls(lowercase) is the actual command - โ worksLS(uppercase) is not recognized - โ failsLs(mixed case) is not recognized - โ fails
โ ๏ธ Critical for LFCS: Case sensitivity is fundamental to Linux. Typing commands in the wrong case is one of the most common beginner mistakes. Always use lowercase for standard commands.
Why Linux is Case-Sensitive
Historical reason: Unix (Linux's ancestor) was designed for multi-user systems where case sensitivity allowed:
- More filename options (
report.txtandReport.txtcan coexist) - Precise command execution (no ambiguity)
- Programming flexibility (variables
Nameandnameare different)
Practical impact:
| Scenario | Linux (Case-Sensitive) | Windows (Case-Insensitive) |
|---|---|---|
| Commands | ls โ LS | dir = DIR |
| Filenames | file.txt and File.txt are different files | file.txt and File.txt are the same file |
| Directories | /home/user and /Home/user are different | C:\Users and C:\users are the same |
| Variables | $PATH โ $path | Variables less common in cmd.exe |
Standard Command Convention
All standard Linux commands use lowercase:
ls # List files
cd # Change directory
pwd # Print working directory
mkdir # Make directory
cp # Copy
mv # Move
rm # Remove
cat # Concatenate
grep # Search text
find # Find files
โ Best Practice: Always type Linux commands in lowercase. If a command doesn't work, check your capitalization first!
Understanding Command Structure
Every Linux command follows a basic structure:
command [options] [arguments]
Let's break this down:
Command Anatomy
Examples of Command Structure
1. Command only:
pwd
- Command:
pwd - Options: none
- Arguments: none
- Result: Shows current directory
2. Command with options:
ls -l
- Command:
ls - Options:
-l(long format) - Arguments: none (defaults to current directory)
- Result: Detailed listing of current directory
3. Command with options and arguments:
ls -l /home
- Command:
ls - Options:
-l(long format) - Arguments:
/home(directory to list) - Result: Detailed listing of /home directory
4. Multiple options:
ls -a -l /var
- Command:
ls - Options:
-a(show all),-l(long format) - Arguments:
/var - Result: Detailed listing including hidden files
Short Options vs Long Options
Linux commands support two types of options: short and long.
Short Options (Single Dash)
Short options use a single dash (-) followed by a single letter.
Syntax:
command -x
Examples:
ls -a # Show all files (including hidden)
ls -l # Long format listing
ls -h # Human-readable file sizes
mkdir -p # Create parent directories
rm -r # Remove recursively
Characteristics of short options:
- One dash:
- - Single letter:
-a,-l,-r - Can be combined:
-al=-a -l - Case matters:
-vโ-V
Long Options (Double Dash)
Long options use a double dash (--) followed by a word or phrase.
Syntax:
command --word
Examples:
ls --all # Same as -a
ls --human-readable # Same as -h
mkdir --parents # Same as -p
mkdir --help # Show help message
ls --version # Show version
Characteristics of long options:
- Two dashes:
-- - Full word(s):
--help,--version,--all - More readable/descriptive
- Cannot usually be combined
- Also case-sensitive
Short vs Long: Comparison
| Command | Short Option | Long Option | What It Does |
|---|---|---|---|
| ls | -a | --all | Show all files including hidden |
| ls | -l | (none) | Long format listing |
| ls | -h | --human-readable | Human-readable sizes (1K, 234M) |
| mkdir | -p | --parents | Create parent directories as needed |
| mkdir | -v | --verbose | Print message for each created directory |
| rm | -r | --recursive | Remove directories and contents |
| rm | -f | --force | Force remove without prompting |
When to Use Short vs Long
| Use Case | Prefer Short Options | Prefer Long Options |
|---|---|---|
| Interactive use | โ Faster to type | โ Too verbose |
| Scripts | โ Less clear what it does | โ Self-documenting |
| Documentation | โ Requires explanation | โ Obvious meaning |
| Multiple options | โ Can combine: -al | โ Cannot combine |
Why Single Dash vs Double Dash Matters
Let's see what happens when you use the wrong number of dashes:
The Single Dash Rule
Using -help (single dash) doesn't work as expected:
[centos9@centos ~]$ mkdir -help
mkdir: invalid option -- 'h'
Try 'mkdir --help' for more information.
Why did this fail?
With a single dash, each letter is treated as a separate option:
-helpis interpreted as-h -e -l -p-his not a valid mkdir option- Error: "invalid option -- 'h'"
The correct way:
[centos9@centos ~]$ mkdir --help
Usage: mkdir [OPTION]... DIRECTORY...
Create the DIRECTORY(ies), if they do not already exist.
...
โ ๏ธ Common Mistake: Typing -help instead of --help is a very common beginner error. Remember: help is a word, so it needs two dashes!
Single vs Double Dash Examples
| Command | Result | Explanation |
|---|---|---|
| ls --help | โ Shows help | Correct: two dashes for word |
| ls -help | โ Error | Tries -h -e -l -p separately |
| ls --all | โ Shows all files | Correct: two dashes for word |
| ls -all | โ Unexpected | Tries -a -l -l (duplicate -l) |
| ls -a | โ Shows all files | Correct: one dash for single letter |
| ls --a | โ Error | Single letters don't use double dash |
The Rule Summary
Simple rule to remember:
- (one dash) = single letter options (-a, -l, -r)
-- (two dashes) = word options (--help, --all, --version)
Combining Short Options
One powerful feature of short options is that you can combine multiple options into a single group.
Combining Syntax
Separate options:
ls -a -l
Combined options:
ls -al
Both do the same thing! When you combine options:
- Remove the extra dashes
- Put all letters together
- Order doesn't matter:
-al=-la
Examples of Combining Options
Example 1: ls with multiple options
# Separate
ls -a -l -h
# Combined
ls -alh
# Both show: all files, long format, human-readable sizes
Example 2: tar command
# Separate
tar -x -v -f archive.tar
# Combined
tar -xvf archive.tar
# Both extract archive with verbose output
Example 3: ps command
# Separate
ps -a -u -x
# Combined
ps -aux
# Both show all processes with user info
Order Doesn't Matter (Usually)
ls -al # Same as:
ls -la # Same as:
ls -a -l # Same as:
ls -l -a # All equivalent!
๐ก Exception: Some commands require specific option order, especially when options take values. But for simple flags, order usually doesn't matter.
Cannot Combine Long Options
Long options cannot be combined because they're words:
# This works
ls --all --human-readable
# This does NOT work
ls --all--human-readable # Wrong!
ls --allhuman-readable # Wrong!
Mixing Short and Long Options
You can mix short and long options in the same command:
ls -l --human-readable /home
ls --all -l /var
mkdir -p --verbose /path/to/directory
Using --help to Learn Commands
Every well-designed Linux command has built-in help documentation accessible with --help.
The --help Option
Basic syntax:
command --help
Example: ls --help
[centos9@centos ~]$ ls --help
Usage: ls [OPTION]... [FILE]...
List information about the FILEs (the current directory by default).
Sort entries alphabetically if none of -cftuvSUX nor --sort is specified.
Mandatory arguments to long options are mandatory for short options too.
-a, --all do not ignore entries starting with .
-A, --almost-all do not list implied . and ..
--author with -l, print the author of each file
-b, --escape print C-style escapes for nongraphic characters
...
Reading --help Output
Help output follows a standard format:
1. Usage line:
Usage: ls [OPTION]... [FILE]...
Breaking this down:
ls- The command name[OPTION]...- Optional options (brackets = optional, ... = can repeat)[FILE]...- Optional file arguments (can specify multiple)
2. Description:
List information about the FILEs (the current directory by default).
Brief explanation of what the command does.
3. Options list:
-a, --all do not ignore entries starting with .
-l use a long listing format
-h, --human-readable with -l, print sizes like 1K 234M 2G etc.
Each line shows:
- Short option (if available)
- Long option (if available)
- Description of what it does
Practical --help Examples
Example 1: mkdir --help
[centos9@centos ~]$ mkdir --help
Usage: mkdir [OPTION]... DIRECTORY...
Create the DIRECTORY(ies), if they do not already exist.
Mandatory arguments to long options are mandatory for short options too.
-m, --mode=MODE set file mode (as in chmod), not a=rwx - umask
-p, --parents no error if existing, make parent directories as needed
-v, --verbose print a message for each created directory
-Z set SELinux security context of each created directory
to the default type
--help display this help and exit
--version output version information and exit
Key options for mkdir:
-p, --parents- Create parent directories (most useful!)-v, --verbose- Show what's being created-m, --mode- Set permissions
Example 2: cp --help
[centos9@centos ~]$ cp --help
Usage: cp [OPTION]... SOURCE DEST
or: cp [OPTION]... SOURCE... DIRECTORY
Copy SOURCE to DEST, or multiple SOURCE(s) to DIRECTORY.
-i, --interactive prompt before overwrite
-r, -R, --recursive copy directories recursively
-v, --verbose explain what is being done
-p preserve mode, ownership, timestamps
...
Key options for cp:
-r, --recursive- Copy directories-i, --interactive- Ask before overwriting-v, --verbose- Show progress
โ
Pro Tip: Before using any new command, run command --help to see available options. This is faster than searching online and works even without internet!
Common Beginner Mistakes
Let's address the most common errors beginners make with Linux commands.
Mistake 1: Wrong Case
โ Wrong:
LS
Ls
CD
PWD
โ Correct:
ls
cd
pwd
Why it fails: Linux commands are case-sensitive. Standard commands are lowercase.
Mistake 2: Single Dash with Words
โ Wrong:
ls -help
mkdir -version
โ Correct:
ls --help
mkdir --version
Why it fails: Single dash expects single letters. Use double dash for words.
Mistake 3: Double Dash with Single Letters
โ Wrong:
ls --a
ls --l
โ Correct:
ls -a
ls -l
Why it fails: Single letters use single dash. Double dash is for words.
Mistake 4: Spaces in Combined Options
โ Wrong:
ls -a -l -h # This works but verbose
ls - alh # This fails - space after dash
ls -a lh # This fails - space in middle
โ Correct:
ls -alh
ls -a -l -h # Also correct but longer
Why it fails: No spaces allowed inside combined options.
Mistake 5: Forgetting Dash Entirely
โ Wrong:
ls a # Looks for file named "a"
mkdir p test # Tries to create dirs "p" and "test"
โ Correct:
ls -a # Show all files
mkdir -p test # Create with parents
Why it fails: Without dash, shell treats it as argument, not option.
Mistake 6: Combining Long Options
โ Wrong:
ls --all--human-readable
โ Correct:
ls --all --human-readable
ls -ah # Or use short options
Why it fails: Long options cannot be combined.
Mistake 7: Wrong Option Order with Values
Sometimes wrong:
tar -f -x archive.tar # May not work on all systems
โ Better:
tar -xf archive.tar # -f comes last because it takes a value
tar -x -f archive.tar # Also works
Why: When an option takes a value (like filename), it should be last or clearly separated.
Understanding Help Syntax
Help documentation uses special symbols. Let's decode them:
Help Syntax Symbols
| Symbol | Meaning | Example |
|---|---|---|
| [ ] | Optional | ls [OPTION] |
| ... | Can repeat | [OPTION]... |
| CAPS | User provides value | FILE |
| | | OR (choose one) | -a | -b |
| Required (choose one) | {on|off} |
Decoding Usage Examples
Example 1:
Usage: ls [OPTION]... [FILE]...
What this means:
ls- The command (required)[OPTION]...- Options are optional, can use multiple[FILE]...- Files are optional, can specify multiple- If no FILE given, uses current directory
Example 2:
Usage: cp [OPTION]... SOURCE DEST
or: cp [OPTION]... SOURCE... DIRECTORY
What this means:
- Two different ways to use cp:
- Copy one SOURCE to DEST
- Copy multiple SOURCEs to DIRECTORY
- Options are always optional
Example 3:
Usage: rm [OPTION]... FILE...
What this means:
rm- The command (required)[OPTION]...- Options optional, can use multipleFILE...- At least one FILE required, can specify multiple
๐งช Practice Labs
Time to practice command basics!
Lab 1: Case Sensitivity Testing (Beginner)
-
Try different cases of ls:
ls # Works LS # Fails Ls # Fails lS # Fails -
Try other commands:
pwd # Works PWD # Fails Pwd # Fails -
Note the error messages
Lab 2: Exploring --help (Beginner)
-
Get help for common commands:
ls --help mkdir --help cp --help rm --help cat --help -
Read through each help output
-
Identify 3 useful options for each command
Lab 3: Short vs Long Options (Beginner)
-
Try both forms of the same option:
ls -a ls --all # Both should produce same output -
Try with human-readable:
ls -lh ls -l --human-readable # Both should show human-readable sizes -
Experiment with other commands
Lab 4: The Dash Mistake (Beginner)
-
Try single dash with "help":
mkdir -help # Should fail with error -
Now try correct version:
mkdir --help # Should show help -
Try with other commands:
ls -help # Fails ls --help # Works cp -version # Fails cp --version # Works
Lab 5: Combining Short Options (Intermediate)
-
Use ls with separate options:
ls -a -l -
Combine them:
ls -al -
Try different orders:
ls -la ls -al # Both should produce same output -
Add more options:
ls -a -l -h ls -alh ls -lah ls -hal # All should produce same output
Lab 6: Cannot Combine Long Options (Intermediate)
-
Try combining long options (will fail):
ls --all--human-readable # Error! -
Use them separately:
ls --all --human-readable # Works! -
Mix short and long:
ls -a --human-readable ls --all -h # Both work!
Lab 7: Reading Help Documentation (Intermediate)
-
Read mkdir help:
mkdir --help -
Find these options:
- Option to create parent directories
- Option for verbose output
- Option to set permissions
-
Test each option:
mkdir -p test/nested/deep mkdir -v test2 mkdir -pv test3/nested
Lab 8: Options with Arguments (Intermediate)
-
Try mkdir with mode:
mkdir -m 755 testdir ls -ld testdir -
Create with parent and mode:
mkdir -p -m 755 parent/child mkdir -pm 755 parent2/child2 # Combined -
Verify permissions:
ls -ld parent parent/child
Lab 9: Understanding Usage Syntax (Advanced)
-
Read cp help:
cp --help | head -20 -
Identify:
- Required arguments
- Optional arguments
- Multiple usage patterns
-
Test different patterns:
touch file1 file2 file3 mkdir destdir # Pattern 1: SOURCE to DEST cp file1 file1_copy # Pattern 2: Multiple SOURCE to DIRECTORY cp file1 file2 file3 destdir/
Lab 10: Command Structure Practice (Advanced)
For each command, identify command/options/arguments:
ls -l /home
mkdir -p /tmp/test/deep
cp -r source/ dest/
rm -rf /tmp/old
cat -n file.txt
grep -i "error" /var/log/messages
Lab 11-15: Real-World Scenarios
Lab 11: Efficient Directory Creation
Create this structure using single command:
project/
โโโ src/
โ โโโ main/
โ โโโ test/
โโโ docs/
โโโ bin/
Use mkdir with appropriate options.
Lab 12: Comparing Options
For ls command, compare output of:
lsls -als -lls -alls -alh
Understand what each adds.
Lab 13: Help Documentation Hunt
Find in help docs:
- How to make cp interactive (prompt before overwrite)
- How to make rm recursive
- How to make mkdir verbose
- How to make ls sort by time
Lab 14: Error Message Analysis
Run these intentionally wrong commands:
LS -alls -helpmkdir --p test
Analyze each error message.
Lab 15: Option Combination Mastery
Create a file listing that shows:
- All files (including hidden)
- Long format
- Human-readable sizes
- Sorted by modification time
Use ls with combined options.
Lab 16-20: Advanced Challenges
Lab 16: Write a cheat sheet of your 10 most used command options
Lab 17: Compare short vs long option performance (timing with time command)
Lab 18: Find a command that uses both - and -- in unusual ways
Lab 19: Create a script that tests if user typed command correctly (case check)
Lab 20: Explore info vs --help vs man pages (which do you prefer?)
๐ Best Practices
โ Command Best Practices
-
Always use lowercase for commands
ls # Right LS # Wrong -
Use --help before using new commands
command --help # Learn before doing -
Prefer short options for interactive use
ls -alh # Quick to type -
Use long options in scripts
ls --all --human-readable # Self-documenting -
Combine short options for efficiency
ls -alh # Instead of ls -a -l -h -
Remember: one dash for letters, two for words
-a # Single letter = single dash --all # Word = double dash -
Check case sensitivity first when command fails
- Did you type
LSinstead ofls? - Case is the #1 beginner mistake
- Did you type
-
Read error messages carefully
mkdir: invalid option -- 'h' Try 'mkdir --help' for more information.The error tells you exactly what's wrong!
-
Use tab completion
- Type first few letters, press Tab
- Helps avoid case mistakes
-
Practice common options until they're muscle memory
ls -lamkdir -pcp -rrm -rf(use carefully!)
๐จ Common Pitfalls to Avoid
โ Mistakes to Avoid
-
Using uppercase for standard commands
LS,CD,PWDall fail- Standard commands are lowercase
-
Single dash with words
ls -help # Wrong ls --help # Right -
Double dash with single letters
ls --a # Wrong ls -a # Right -
Spaces in combined options
ls -a lh # Wrong ls -alh # Right -
Forgetting dashes entirely
ls a # Looks for file "a" ls -a # Shows all files -
Trying to combine long options
ls --all--human-readable # Wrong ls --all --human-readable # Right -
Not reading help documentation
- Guessing option names
- Use
--helpto know for sure
-
Assuming Windows command behavior
- DIR doesn't work (use ls)
- Commands aren't case-insensitive
- Different option syntax
-
Not testing commands before scripting
- Always test interactively first
- Then add to scripts
-
Confusing option order
- Most times order doesn't matter
- But some commands are picky
- Check help if unsure
๐ Command Cheat Sheet
Case Sensitivity
# Standard commands - all lowercase
ls pwd cd mkdir cp mv rm cat grep find
# These fail (wrong case)
LS Ls PWD Pwd CD Cd
Short Options (Single Dash + Single Letter)
ls -a # Show all
ls -l # Long format
ls -h # Human-readable
ls -r # Recursive
ls -t # Sort by time
Long Options (Double Dash + Word)
ls --all # Same as -a
ls --human-readable # Same as -h
mkdir --parents # Same as -p
mkdir --verbose # Same as -v
command --help # Show help
command --version # Show version
Combining Short Options
# These are equivalent:
ls -a -l -h
ls -alh
ls -lah
ls -hal
# Separate
mkdir -p -v directory
# Combined
mkdir -pv directory
Getting Help
# Show help for any command
command --help
# Examples
ls --help
mkdir --help
cp --help
rm --help
cat --help
grep --help
Common Option Patterns
# Show all (including hidden files)
ls -a
ls --all
# Long format (detailed)
ls -l
# Human-readable sizes
ls -h
ls --human-readable
# Combined (most common)
ls -alh
# Verbose output
mkdir -v
cp -v
rm -v
# Recursive operations
cp -r
rm -r
ls -R
# Force (no prompts)
rm -f
cp -f
# Interactive (prompt before action)
rm -i
cp -i
mv -i
๐ฏ Key Takeaways
โ Remember These Points
- Linux is case-sensitive - ls โ LS โ Ls
- Standard commands are lowercase - ls, cd, pwd, mkdir
- Single dash for single letters -
-a,-l,-h - Double dash for words -
--help,--all,--version - Can combine short options -
-al=-a+-l - Cannot combine long options - Must be separate
- -help fails (single dash) - Use
--help(double dash) - Options are usually optional - Command works without them
- --help is your friend - Built into every command
- Order usually doesn't matter -
-al=-la - Options modify behavior - Arguments are what to act on
- Square brackets [ ] mean optional - In help syntax
- Three dots ... mean repeatable - Can use multiple
- CAPS mean you provide value - FILE, DIRECTORY, OPTION
- Error messages are helpful - Read them carefully!
๐ What's Next?
Great work! You now understand the fundamental rules of Linux commands. You know about case sensitivity, options, and how to get help. In the next post, we'll put this knowledge to use with essential navigation commands!
In the next post (Part 7), we'll cover:
whoami- Identifying current userpwd- Print working directory (where am I?)cd- Change directory (moving around)cd ~(home),cd ..(up),cd -(back)ls- List directory contentsls -a- Show hidden filesls -l- Long format with details- Understanding ls -l output (permissions, owner, size, date)
- Practical navigation workflows
Coming Up in Phase 1:
- Part 8: Understanding File Timestamps with touch
- Part 9: Managing User Passwords with passwd
- Part 10: Help Systems (man, info, --help, /usr/share/doc)
- And 42 more posts!
๐ Congratulations! You've completed Part 6 of the LFCS Certification series. You now understand Linux command fundamentals, case sensitivity, and how to use options effectively.
These are the building blocks! Every Linux command follows these rules. Master them now, and the rest of the commands will be much easier to learn.
Practice is critical! Complete the 20 practice labs, especially the case sensitivity and dash mistakes labs. These fundamentals appear in every LFCS exam question.
๐ฌ Discussion
I'd love to hear about your experience:
- What was your biggest "aha!" moment learning command basics?
- Did you make the
-helpmistake (single dash)? - Coming from Windows? What surprised you most about Linux commands?
- Any tricks you've learned for remembering case sensitivity?
Connect with me:
This is Part 6 of 52 in the LFCS Certification - Phase 1 series. Stay tuned for Part 7: Essential Navigation Commands!

