Fundamentals 8 min read

Master Linux Command Line: Essential Commands, File Management, and Permissions

This guide walks through essential Linux command‑line skills, covering simple commands, OS partition concepts, root directory files, directory and file operations, user/group management, vi editor modes, permission settings, common utilities, pipes, find, soft and hard links, cron scheduling, ownership changes, and CD‑ROM mounting.

Efficient Ops
Efficient Ops
Efficient Ops
Master Linux Command Line: Essential Commands, File Management, and Permissions

1. Simple Commands

2. Operating System Partition Principles

1. Windows

2. Linux

3. Root Directory File Overview

4. Directory Operations

Create, move, rename, delete, copy.

5. Simple File Operations

6. User and Group Operations

7. vi Editor

1. Three Modes

2. Edit Mode Operations

Switch between command mode and edit mode.

3. Bottom Line Mode Operations

4. Command Mode Operations

4.1 Cursor Movement

4.2 Content Delete/Copy

8. Permission Operations

Permissions are divided into Read, Write, Execute. User categories: Owner, Group, Others.

1. Setting permissions.

2. Using permissions

File permissions: Read – view content, Write – modify (force write possible), Execute – run scripts.

Directory permissions: Read – list files, Write – create/delete files, Execute – cd into directory.

9. Common System Commands

10. Pipes

Linux pipes allow chaining commands such as grep, head, tail, wc, ls.

ls -l | wc // count lines of files in current directory ls -l | head -5 // view first 5 files ls -l | head -30 | tail -5 // view files 26 to 30 grep this apple.txt | grep was // find lines containing both "this" and "was"

11. File Search (find)

12. Soft and Hard Links

1. Soft link (symbolic link) – similar to a Windows shortcut, helps allocate disk space. Create with

ln -s source_file soft_link

.

Notes: use absolute path if the link and source are in different directories; both files and directories can have soft links; if the original is deleted, the link becomes broken but becomes valid again if a file with the same name is recreated.

2. Hard link – another name for the same file; only regular files can have hard links, and they must reside on the same filesystem.

Create with

ln [-d] source_file hard_link

.

Notes: original file path can be relative; only regular files can have hard links, not directories; all hard links must be on the same partition.

Benefits: prevents accidental deletion and allows multiple users to work on the same file via different names.

Differences: soft links are shortcuts; hard links are additional names for the same inode.

13. Task Scheduling (cron)

Define tasks to run at specified times.

crontab -e // edit cron jobs crontab -l // list cron jobs

14. File Owner and Group Settings

Change owner:

chown owner filename chown owner.group filename chown .group filename chown -R owner.group dirname // recursive chmod -R 777 dirname // recursive permission change

15. CD-ROM Mounting

Mount point: /home/jinnan/rom

Device: /dev/cdrom

Mount command:

mount /dev/cdrom /home/jinnan/rom

Unmount:

umount /dev/cdrom

or

umount /home/jinnan/rom

Eject:

eject
Linuxcommand lineCronPermissionsfile managementLinksvi Editor
Efficient Ops
Written by

Efficient Ops

This public account is maintained by Xiaotianguo and friends, regularly publishing widely-read original technical articles. We focus on operations transformation and accompany you throughout your operations career, growing together happily.

0 followers
Reader feedback

How this landed with the community

login Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.