Summary of "C Linux Day1"
High-level summary
This introductory lecture is the first session of a two-week short course on C programming in a Linux environment. The instructor explains course goals, schedule, and motivation, then demonstrates practical steps: connecting to a remote Ubuntu server via SSH, basic Linux command-line usage, creating/editing/compiling C/C++ programs, and using the Vim editor effectively.
Key points:
- Emphasis on why Linux skills matter for computer-science students and job applicants, with examples from Kakao job postings.
- Strong encouragement to practice consistently, especially for coding tests used in hiring.
- Hands-on material: SSH (PuTTY on Windows), basic filesystem navigation and manipulation, compiling/running C/C++ (
gcc/g++), Vim usage, and safety notes (back up data; be careful withrm -rf).
Course schedule & learning objectives
- Duration: 2 weeks of practice in a Linux environment. Lecture videos uploaded daily (around 2 PM).
- Early focus on pointers — taught first because understanding pointers makes later topics easier.
- After pointers: review basic C grammar; if time permits, cover file I/O and working with files by day 7.
- Goal: students should be able to create and run C programs on Linux and feel comfortable with the terminal, editors, and toolchain by course end.
Motivation and context
- Linux is widely used in production systems: servers, cloud, databases, system software. Many roles (platform, backend, cloud, database, system software, data engineering) use Linux daily.
- Practical Linux and algorithm skills are important for coding tests and blind recruitment; they can open career opportunities regardless of background.
- Linux is powerful, free, flexible, and broadly relevant for CS majors and job seekers.
Practical instructions and methodology
1. Accessing the remote Linux server (Windows example with PuTTY)
- Download and install PuTTY (search “putty”, choose the Windows 64-bit installer).
- In PuTTY configuration: set the server IP address and port, and choose the SSH protocol.
- Login with assigned student ID and password (accounts created using student numbers in class).
- First actions after login:
- Change your password:
passwd - Troubleshooting: use
Ctrl-Cto interrupt running commands (note:Ctrl-Zsuspends a job).
- Change your password:
2. Basic Linux concepts explained
- IP address: identifies the machine on a network.
- Port: identifies a specific application/service on that machine.
- Client-server model: your terminal/browser is a client; services run on servers bound to ports (e.g., web on 80, SSH commonly on 22 or a custom port).
- Distros and kernel: Ubuntu is the distribution used in class (examples also include Red Hat); the kernel is the core OS.
- Permissions: root vs normal users; use
sudoorsuwhen administrator privileges are required.
3. Filesystem/navigation commands
Common commands demonstrated:
ls— list files/directoriesmkdir newdir— create directorypwd— print working directory (absolute path)cd dirname— change directorycdwith no args → go to homecd ..→ go to parent directory
rmdir dirname— remove empty directoryrm -r dirname— recursively remove directory (dangerous)mv source target— move or renamecp source target— copy filescp -r source_dir target_dir— copy directories recursively
tree— show directory structure (if installed)
Be careful with rm -rf — deletions can be irreversible.
4. Installing development tools (self-managed Linux)
- Example:
sudo apt-get install build-essentialto install compilers and development utilities (server used in course had tools preinstalled). - Use
sudoas needed for system package installation.
5. Creating, editing, compiling, and running C/C++ programs
Workflow:
- Create a code directory:
mkdir codeandcd code
- Edit files with Vim:
vim test.corvim test.cpp
Basic Vim commands:
- Enter insert mode:
i; return to command mode:Esc - Save and exit:
:w(write),:q(quit),:wq(write and quit) - Undo:
u; redo:Ctrl-r - Delete a line:
dd; delete multiple lines:5dd - Yank (copy) line:
yy; paste:p - Movement:
h(left),j(down),k(up),l(right) - Open new line below/above:
o/O - Append/insert at line ends/beginnings:
A/I - Jump to line:
:70 - Page forward/back:
Ctrl-F/Ctrl-B - Window movement:
Ctrl-Wthenh/j/k/l - Visual mode:
v(select), thend(delete) ory(yank) - Search:
/pattern(forward),?pattern(backward), thenn(next) /N(previous) - Highlight searches by default: add
set hlsearchto~/.vimrc
Compile and run:
- C:
gcc test.c -o test - C++:
g++ test.cpp -o test - If
-ois omitted, the default executable is oftena.out - Run:
./testor./a.out
Notes on main and arguments:
int main(int argc, char *argv[])—argccounts arguments (including program name);argvholds argument strings.- Use
printf(C) orstd::cout(C++) to displayargcandargvwhile testing.
6. Typical file operations / tips
- Rename/move:
mv oldname newnameormv file dir/ - Copy file:
cp file.c dir/ - Copy directory:
cp -r sourcedir targetdir - Remove directory tree carefully:
rm -r dirname(use-fto force:rm -rf— use with caution) - Use numeric prefixes for Vim commands, e.g.,
10dddeletes 10 lines - Use Vim splits to edit multiple files; close a split with
:q
7. Vim productivity tips
- Prefer
h,j,k,lover arrow keys for speed. - Use counts with motions/commands (e.g.,
5j,10dd) to speed repetitive edits. - Use visual mode for block selections and copy/paste/delete.
- Add
:set hlsearchto~/.vimrcto always highlight search results. - Use window splits (
Ctrl-W+ movement) to work on multiple files; close with:q.
8. Warnings and best practices
Back up important data. The classroom server is temporary — back up any important work elsewhere. Avoid careless use of
rm -rf; deleted data may be unrecoverable. On shared servers, respect permissions and user roles; usesudoonly when necessary. Practice consistently for coding tests — start preparing early.
References, tools, and examples mentioned
- Distributions / OS: Ubuntu (used in class), references to kernel and other distributions (e.g., Red Hat).
- SSH client for Windows: PuTTY.
- Compilers / toolchain:
gcc,g++(packages provided bybuild-essential/ dev toolchain). - Editor: Vim (vi).
- Job/search examples: Kakao and Naver used to motivate Linux relevance and show job postings (system software, cloud, database, backend, platform, data engineer roles).
Speakers / sources
- Lecturer / instructor (unnamed) — main speaker presenting lecture and demos.
- Background music noted as [music] in subtitles.
- Referenced sources used for examples: Kakao (job postings) and Naver (search engine). Tools/systems referenced include PuTTY, Ubuntu,
gcc/g++, and Vim.
Category
Educational
Share this summary
Is the summary off?
If you think the summary is inaccurate, you can reprocess it with the latest model.