📚 College Credit Guide ✓ UPI Study 🕐 11 min read

How Do You Create and Move Files in Linux?

This article shows how to create, move, copy, and rename Linux files and folders with real terminal practice and clear path and permission rules.

US
UPI Study Team Member
📅 July 24, 2026
📖 11 min read
US
About the Author
The UPI Study team works directly with students on credit transfer, degree planning, and course selection. We've helped thousands of students figure out what counts toward their degree and how to finish faster without paying more than they have to. This post is written the way we'd explain it to you directly.
🦉

Creating and moving files in Linux starts with four commands: touch, mkdir, mv, and cp. You use touch to make empty files, mkdir to make folders, mv to move or rename items, and cp to copy them. That basic pattern covers most beginner terminal work. The hard part is not the commands. It is knowing where the file goes, what the path means, and why Linux sometimes blocks the action. A command can fail because you typed the wrong folder name, picked a path that does not exist, or tried to write in a place your user cannot change. Those errors look small, but they stop the whole task. A good beginner workflow starts with a clean practice folder, then a few simple tests. Create one file. Create one directory. Move the file. Copy it. Rename it. Repeat the same task with a relative path like notes/todo.txt and an absolute path like /home/student/notes/todo.txt. That contrast teaches you faster than memorizing a cheat sheet. To do well in a Linux class or an online course, focus on the result after each command. Check where you are, check what exists, and check what changed. That habit saves time and keeps you from guessing when a command lands in the wrong place or fails with a permission message.

A skilled IT technician organizing tangled cables at his workstation in an office environment — UPI Study

How Do You Create Files in Linux?

Use touch for empty files and mkdir for folders, because they solve two different jobs in 1 command each. touch homework.txt makes a blank file, while mkdir lab1 makes a directory you can fill later. That split matters in a terminal lab, since a file and a folder act differently from the start.

The catch: touch does not write text into a file; it only creates the file or updates its time stamp, so a beginner who expects content inside the file gets a surprise. mkdir does one job too, and it can create a 2-level path like mkdir notes/week1 if the parent folder already exists.

Path choice changes everything. A relative path like mkdir drafts uses your current folder, while an absolute path like mkdir /home/student/drafts points to one exact place on the system. I like teaching both on day 1 because people stop treating the terminal like a guessing game and start reading the path like a map with 2 clear routes.

Names matter more than most students think. Use simple names with letters, numbers, dashes, and underscores, such as report_2026.txt or class-notes, and skip spaces when you can. Linux can handle spaces, but they force extra quoting or escape marks, and that slows down a 5-minute task into a messy one.

Permissions can stop creation in folders like /etc or /usr even if the name looks fine. If you do not have write access, Linux blocks the command, and that is normal behavior, not a random glitch. In a lab on a shared machine, that one detail explains a lot of the first 3 errors students hit.

When Should You Use mv or cp?

mv moves a file or folder to a new place, and it also renames that item in the same command; cp makes a second copy and leaves the original alone. That difference sounds small, but it changes the risk level a lot. If you only need one clean copy before editing, cp gives you a backup. If you want the item gone from the old spot, mv does the job in 1 step.

Reality check: Many beginners lose a file because they use mv when they meant cp, and that mistake hurts more when the original held 2 hours of notes or a graded lab. I tell students to slow down for 10 seconds before they press Enter, because that tiny pause prevents the dumbest errors.

The -i flag feels slow at first, but it saves work when a folder already has the same name. The -r flag matters any time you copy a directory with 3 or more files inside. That is why mv and cp show up in every basic Introduction to Linux lesson and in a lot of Introduction to Operating Systems work too.

Introduction To Linux UPI Study Course

Learn Introduction To Linux Online for College Credit

This is one topic inside the full Introduction To Linux course on UPI Study — a self-paced, online class that earns real college credit. Credits are ACE and NCCRS evaluated and transfer to partner colleges across the US and Canada. Courses start at $250 with no deadlines and lifetime access.

Browse Introduction To Linux →

How Do You Move Files and Folders Step by Step?

Start in one folder, make a practice space, and watch each command change the file list. This 5-step drill teaches path rules better than reading 20 lines of notes, and it only takes about 10 minutes on a normal laptop.

  1. Run pwd first so you know your current directory, such as /home/student. That one check tells you where every relative path will land.
  2. Create a practice folder with mkdir linux-lab and enter it with cd linux-lab. If you misspell the folder name, Linux gives a No such file or directory error right away.
  3. Make 2 files with touch draft.txt and touch plan.txt, then make a subfolder with mkdir archive. You now have 1 folder, 2 files, and a place to move one item.
  4. Move the first file with mv draft.txt archive/ and confirm the change with ls. If you use a missing path like mv draft.txt old/archive/, Linux refuses the command because it cannot find the target.
  5. Rename the second file with mv plan.txt final-plan.txt, then check it again with ls -l. A clean rename takes less than 1 second, and it does not create a second copy.
  6. Try the same move with an absolute path, such as mv final-plan.txt /home/student/linux-lab/archive/. That one line shows the difference between a short local path and a full system path.

What this means: The same command can move or rename, and the result depends on the path you type, not on a secret setting in Linux. That is why I like this exercise for a first lab: it builds real muscle memory in 1 sitting instead of 3 separate lessons.

Which File Paths and Permissions Matter Most?

File paths tell Linux where to put or find something, and that choice controls the result before the command even runs. A path like docs/week2/notes.txt depends on your current folder, but /home/student/docs/week2/notes.txt points to one exact spot on the machine. That difference sounds basic, yet it causes a huge share of beginner mistakes in the first 30 minutes of terminal practice.

Spaces and wildcards can change a command fast. A file named lab notes.txt needs quotes like "lab notes.txt" or an escape mark, while a wildcard like *.txt can match 12 text files at once. That saves time when you know what you are doing, but it can also hit more files than you meant, so I tell students to use wildcards only after they run ls and see the folder list.

Permissions decide whether Linux lets you create, move, or rename at all. Read permission lets you look at a file, write permission lets you change it, and execute permission lets you enter a directory or run a script. If a folder blocks write access, mv and touch fail with Permission denied, which usually means your user lacks the right to change that location.

No such file or directory means Linux cannot find the path you named, and that error often points to a typo, a missing folder, or a bad slash. In a class on March 12 or during a 2-hour lab, that message usually means the path is wrong, not that the command broke. I prefer this kind of error to silent failure because it tells you what went wrong instead of hiding it.

What Practice Exercise Helps Linux Beginners Most?

A 12-step lab works well in an Introduction to Linux course because it gives students one clean sequence to repeat for transferable credit. In a community college class, that kind of exercise turns abstract commands into a real 15-minute terminal routine.

One student at Houston Community College can finish this lab in a single class block and use it for transferable credit in a 12-step file-management assignment. Bottom line: The best practice labs mix create, copy, move, and rename tasks in one folder, because that is how real terminal work happens, not as isolated tricks.

If a command fails, rerun it with -v or check the path before trying again. That habit beats guessing, and it makes the next lab in a college credit setting feel less like a trap and more like work you already know.

Frequently Asked Questions about Linux Files

Final Thoughts on Linux Files

Linux file work gets easier once you stop treating each command like a separate puzzle. touch creates empty files, mkdir builds folders, mv moves or renames, and cp gives you a second copy when you want a safety net. That four-command set covers most beginner tasks, and it shows up again and again in classes, labs, and real work. Paths matter because Linux follows the exact text you type. One missing folder name or one wrong slash can send a command off course fast. Permissions matter too, because write access controls whether you can change a folder, and execute access controls whether you can enter it. Those rules feel strict at first, but they also make the system predictable. A strong habit beats memorizing tricks. Start with pwd, make a practice folder, create 2 files, move one, copy one, rename one, and check the result with ls after each step. That loop takes only a few minutes, and it teaches you more than watching someone else type commands for an hour. Keep the commands simple, keep the names clean, and keep one eye on the path. Do that for 3 or 4 practice rounds, and the terminal stops looking like a wall of text and starts looking like a tool you can control.

How UPI Study credits actually work

Ready to Earn College Credit?

ACE & NCCRS approved · Self-paced · Transfer to colleges · $250/course or $99/month

More on Introduction To Linux
© UPI Study. This article and its educational content are solely owned by UPI Study and licensed under CC BY-NC-ND 4.0. It is not free to reuse or modify. Any citation must credit UPI Study with a direct link to this page.