Searching...
English
EnglishEnglish
EspañolSpanish
简体中文Chinese
FrançaisFrench
DeutschGerman
日本語Japanese
PortuguêsPortuguese
ItalianoItalian
한국어Korean
РусскийRussian
NederlandsDutch
العربيةArabic
PolskiPolish
हिन्दीHindi
Tiếng ViệtVietnamese
SvenskaSwedish
ΕλληνικάGreek
TürkçeTurkish
ไทยThai
ČeštinaCzech
RomânăRomanian
MagyarHungarian
УкраїнськаUkrainian
Bahasa IndonesiaIndonesian
DanskDanish
SuomiFinnish
БългарскиBulgarian
עבריתHebrew
NorskNorwegian
HrvatskiCroatian
CatalàCatalan
SlovenčinaSlovak
LietuviųLithuanian
SlovenščinaSlovenian
СрпскиSerbian
EestiEstonian
LatviešuLatvian
فارسیPersian
മലയാളംMalayalam
தமிழ்Tamil
اردوUrdu
Linux for Beginners

Linux for Beginners

by Jason Cannon 2014 147 pages
4.02
100+ ratings
Listen
Try Full Access for 7 Days
Unlock listening & more!
Continue

Key Takeaways

1. Accessing Linux: Multiple Avenues to Get Started

In order to start learning your way around and putting your newfound knowledge to the test, you're going to need access to a Linux system.

Immediate Access. The quickest way to dive into Linux is through web-based command-line interfaces like SimpleShell.com, offering immediate access to a Linux server without setup. These are ideal for short sessions and trying out commands, but remember that your data is temporary.

Web Hosting. If you host a website, you might already have SSH access to a Linux server. Check your hosting provider's documentation for "SSH" or "shell access." Shared web hosting is an affordable option for gaining persistent shell access. Some providers include:

  • 1and1.com
  • BlueHost.com
  • DreamHost.com
  • HostGator.com
  • Site5.com

Virtualization. For a more comprehensive experience, use VirtualBox to run a pre-installed Linux image on your Windows, Mac, or Linux system. Download VirtualBox and a CentOS or Ubuntu image from virtualboxes.org. This provides a personal Linux environment for in-depth exploration.

2. Connecting to a Linux Server: SSH and Telnet Explained

SSH stands for Secure Shell and it provides a way to connect to a server over a network, like the Internet.

Secure Shell (SSH). SSH is the primary protocol for connecting to Linux servers, offering encrypted communication for secure remote access. You'll need a username, password (or SSH key), server name/IP address, and potentially a port number.

SSH Clients. For Windows, PuTTY is a popular SSH client. Macs have a built-in Terminal application. The basic SSH command format is ssh -p port_number username@servername. If no port is specified, the default port 22 is used.

SSH Keys. SSH keys provide a password-less login option, enhancing security. Generate keys using ssh-keygen (Mac/Linux) or PuTTYgen (Windows). Share the public key with the server administrator and keep the private key secure.

3. Navigating the Shell: Your Command-Line Interface

The shell is nothing more than a program that accepts your commands and executes those commands.

Shell Interface. The shell is your primary interface for interacting with the Linux system. It interprets your commands and executes them. The shell prompt typically displays your username, server name, and whether you're a normal user ($) or superuser (#).

Basic Commands. Essential commands include:

  • ls: Lists directory contents
  • cd: Changes directory
  • pwd: Displays the current directory
  • cat: Displays file contents
  • echo: Displays arguments
  • man: Displays command documentation

Learning by Doing. Use the man command to learn about other commands. The PATH environment variable lists directories where executable commands are located. Use which command to find the exact location of a command.

4. Understanding the Linux Directory Structure: A Map of the System

Understanding the directory structure will help you in the future when you are searching for components on the system.

Root Directory. The root directory (/) is the starting point of the file system hierarchy. It's not related to the root user account.

Common Directories. Key directories include:

  • /bin: Essential binaries
  • /etc: System configuration files
  • /home: User home directories
  • /opt: Optional software
  • /tmp: Temporary files
  • /usr: User-related programs
  • /var: Variable data, like log files

Application Structure. Applications often follow a similar directory structure within /opt or /usr/local, with subdirectories for binaries, configuration, libraries, and logs.

5. Essential Linux Commands: Your Toolkit for Basic Operations

In Linux, commands are case-sensitive and more often than not they are entirely in lowercase.

Core Commands. A handful of commands can get you far:

  • ls: List files and directories
  • cd: Change directories
  • pwd: Print working directory
  • cat: Display file content
  • echo: Display text
  • man: Access the manual
  • exit: End session
  • clear: Clear the screen

Directory Navigation. Use . for the current directory and .. for the parent directory. The command cd - takes you to the previous directory.

Command Execution. To execute a program in the current directory, use ./program.

6. File Permissions: Understanding and Managing Access

The first character in the permissions string reveals the type.

Permission String. The ls -l command displays a permission string like -rw-r--r--. The first character indicates the file type (e.g., - for file, d for directory, l for link). The next nine characters represent read (r), write (w), and execute (x) permissions for the user, group, and others.

User Categories. Permissions apply to the user (owner), group, and others. Use the groups command to see your group memberships.

Changing Permissions. Use chmod to change permissions. Symbolic mode (e.g., chmod g+w file) adds or removes permissions. Octal mode (e.g., chmod 755 file) sets permissions directly using numeric values (4 for read, 2 for write, 1 for execute).

7. Finding Files: Locating What You Need

If you ever need to locate a file or directory you can use the find command.

The find Command. The find command is a powerful tool for locating files and directories based on various criteria. The basic syntax is find [path...] [expression].

Common Options. Useful options include:

  • -name pattern: Finds files matching the pattern (case-sensitive)
  • -iname pattern: Finds files matching the pattern (case-insensitive)
  • -ls: Performs an ls on found files
  • -mtime num_days: Finds files modified num_days ago
  • -size num: Finds files of size num
  • -exec command {} \;: Executes a command on found files

The locate Command. The locate command is faster than find because it searches a pre-built database. However, the database may not be up-to-date.

8. Viewing and Editing Files: Interacting with Content

Here are some simple commands that display the contents of files to the screen.

Viewing Files. Commands for viewing file content include:

  • cat: Displays the entire file
  • more: Browses a file page by page
  • less: Like more, but allows backward movement and searching
  • head: Displays the beginning of a file
  • tail: Displays the end of a file
  • tail -f: Displays data as it's written to the file in real-time

Editing Files. nano is a simple, user-friendly text editor. vi and emacs are more powerful but have a steeper learning curve.

The file Command. Use the file command to determine a file's type.

9. File Management: Manipulating Files and Directories

Eventually you will get tired of all the old files you created just laying around, cluttering up your home directory, and taking up precious space.

Removing Files. Use the rm command to remove files. Use rm -r to remove directories recursively. Be careful, as there is no "trash" and deleted files are gone.

Copying Files. Use the cp command to copy files. Use cp -r to copy directories recursively.

Moving and Renaming Files. Use the mv command to move or rename files and directories.

Archiving and Compression. Use the tar command to create archives. Use gzip to compress files. Modern tar versions support gzip compression with the -z option (e.g., tar zcf archive.tar.gz directory).

10. Customizing Your Shell: Making Linux Your Own

As you have seen in the "Welcome To Shell" chapter, default prompts can vary from system to system.

Customizing the Prompt. Customize your shell prompt by setting the PS1 environment variable (for bash, ksh, sh) or prompt (for csh, tcsh, zsh). Use format strings like \u (username), \h (hostname), and \w (current directory).

Creating Aliases. Create shortcuts for frequently used commands with the alias command (e.g., alias ll='ls -l'). Add aliases to your personal initialization files (e.g., .bash_profile, .bashrc) to make them persistent.

Interactive vs. Non-interactive Sessions. Understand the difference between interactive and non-interactive shell sessions. Ensure your configuration is loaded in both types of sessions by sourcing .bashrc from .bash_profile.

11. Processes and Job Control: Managing Running Programs

To display the currently running processes use the ps command.

Listing Processes. Use the ps command to display running processes. Common options include -e (all processes), -f (full format), and -u username (processes for a specific user).

Foreground and Background Processes. Run commands in the background by adding an ampersand (&) to the end. Use jobs to list background jobs, fg to bring a job to the foreground, and bg to background a suspended job.

Killing Processes. Use Ctrl-c to kill a foreground process. Use the kill command to send signals to processes, including the TERM (15) and KILL (9) signals.

12. Automating Tasks: Scheduling Jobs with Cron

If you need to repeat a task on a schedule, you can use the cron service.

Cron Service. The cron service schedules tasks to run automatically at specified times.

Crontab Format. Cron jobs are defined in crontab files. Each line specifies the schedule (minute, hour, day of month, month, day of week) and the command to execute.

Crontab Command. Use the crontab command to manage cron jobs:

  • crontab -l: List cron jobs
  • crontab -e: Edit cron jobs
  • crontab -r: Remove all cron jobs

Last updated:

Review Summary

4.02 out of 5
Average of 100+ ratings from Goodreads and Amazon.

Linux for Beginners receives mostly positive reviews, with an average rating of 4.02/5. Readers appreciate its beginner-friendly approach, comprehensive coverage of basic Linux commands, and additional resources for further learning. Some find it helpful for refreshing knowledge or learning new commands. However, criticisms include dated content, lack of depth in certain areas, and insufficient background information. The book is praised for its practical, hands-on approach but some feel it could benefit from more interactive elements and expanded explanations of abstract concepts.

Your rating:
4.47
12 ratings

About the Author

Jason Cannon is the author of "Linux for Beginners". He is known for writing instructional books on Linux and other technical subjects. Cannon's writing style is often described as clear, concise, and beginner-friendly. He focuses on practical, hands-on learning approaches in his books. In addition to writing, Cannon offers online courses through platforms like Udemy, which complement his book content. His work aims to make complex technical topics accessible to newcomers in the field. Cannon's expertise in Linux and his ability to explain technical concepts in simple terms have made his books popular among those looking to start their journey in Linux and system administration.

Download PDF

To save this Linux for Beginners summary for later, download the free PDF. You can print it out, or read offline at your convenience.
Download PDF
File size: 0.32 MB     Pages: 14

Download EPUB

To read this Linux for Beginners summary on your e-reader device or app, download the free EPUB. The .epub digital book format is ideal for reading ebooks on phones, tablets, and e-readers.
Download EPUB
File size: 2.97 MB     Pages: 10
Listen to Summary
0:00
-0:00
1x
Dan
Andrew
Michelle
Lauren
Select Speed
1.0×
+
200 words per minute
Home
Library
Get App
Create a free account to unlock:
Requests: Request new book summaries
Bookmarks: Save your favorite books
History: Revisit books later
Recommendations: Personalized for you
Ratings: Rate books & see your ratings
100,000+ readers
Try Full Access for 7 Days
Listen, bookmark, and more
Compare Features Free Pro
📖 Read Summaries
All summaries are free to read in 40 languages
🎧 Listen to Summaries
Listen to unlimited summaries in 40 languages
❤️ Unlimited Bookmarks
Free users are limited to 10
📜 Unlimited History
Free users are limited to 10
Risk-Free Timeline
Today: Get Instant Access
Listen to full summaries of 73,530 books. That's 12,000+ hours of audio!
Day 4: Trial Reminder
We'll send you a notification that your trial is ending soon.
Day 7: Your subscription begins
You'll be charged on May 16,
cancel anytime before.
Consume 2.8x More Books
2.8x more books Listening Reading
Our users love us
100,000+ readers
"...I can 10x the number of books I can read..."
"...exceptionally accurate, engaging, and beautifully presented..."
"...better than any amazon review when I'm making a book-buying decision..."
Save 62%
Yearly
$119.88 $44.99/year
$3.75/mo
Monthly
$9.99/mo
Try Free & Unlock
7 days free, then $44.99/year. Cancel anytime.
Scanner
Find a barcode to scan

Settings
General
Widget
Loading...