Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

iTechGuides is reader-supported. When you buy through links on our site, we may earn an affiliate commission. As an Amazon Associate I earn from qualifying purchases. Learn more

Start with eight everyday commands and tie each name to its job: ls lists, pwd shows where you are, cd changes location, cat displays file contents, cp copies, mv moves or renames, rm removes, and grep searches text. Learn them by task rather than as a random list, and check the path before running commands that change files.

Navigate and see what is around you

These first commands answer two basic questions: where am I, and what is in this directory? The GNU Coreutils 9.11 manual documents pwd and ls; cd is a shell builtin, so its behavior belongs to the shell rather than GNU Coreutils.

pwd: where am I?

Run pwd to print the current working directory—the location your shell is currently using. For example, its output might be /home/sam/projects. This is a useful check before opening, moving or removing a file by a relative path.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

ls: what is here?

Run ls to list the contents of the current directory. To put each entry on its own line, use ls -1, an option documented by the ls(1) manual page. The GNU Coreutils 9.11 manual covers the GNU version of this utility.

cd: go somewhere else

Use cd followed by a directory path to change the shell’s current directory. For instance, cd Documents enters a folder named Documents inside the current directory. A beginner Linux quick reference groups it with navigation commands.

View file contents and find text

cat: output a file

cat notes.txt writes the contents of notes.txt to the terminal. The name is a reminder of “concatenate”: the command can join file contents in its output as well as display a file. For a very large file, use a pager rather than sending all its contents to the terminal at once. The Calvin University quick reference includes cat as a way to view file contents.

grep: search matching text

Use grep to search text for matches. For example, grep "error" app.log searches app.log for lines matching the text error. This is a basic example; matching rules and options can add complexity. The quick reference describes grep as a pattern-search command.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Copy, move and remove files carefully

Unlike listing or reading, these commands change filesystem contents. Confirm the directory and filenames before using them, especially when removing anything.

cp: copy

cp report.txt report-copy.txt copies the first named file to the second. GNU’s cp invocation documentation describes this two-filename form.

mv: move or rename

mv report.txt archive/report.txt moves the file into the archive directory. If both names refer to files in the same directory, mv old-name.txt new-name.txt renames the file. GNU documents both uses under basic operations.

rm: remove

rm draft.txt removes the named file. Removal can be irreversible, so first use pwd and ls to confirm where you are and what the path identifies. GNU’s basic-operations documentation covers removal; do not treat rm as a harmless way to tidy a command line.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

A quick reference by task and impact

Task Command Example Effect
Show current location pwd pwd Prints the working directory; does not change files.
List contents ls ls Displays directory entries; does not change files.
Change location cd cd Documents Changes the shell’s current directory.
Display contents cat cat notes.txt Writes file contents to standard output.
Search text grep grep "error" app.log Searches text for matches.
Copy a file cp cp report.txt report-copy.txt Creates a copy at the destination.
Move or rename mv mv old-name.txt new-name.txt Changes a file’s location or name.
Remove a file rm rm draft.txt Removes the named file.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Make the names stick without memorizing a manual

Associate each short name with a plain-language verb: ls list, pwd print working directory, cd change directory, cat show contents, cp copy, mv move, rm remove, and grep search. Practice by first identifying the task, then choosing the command. Keep the distinction clear: the first five examples inspect information or navigate; cp, mv and rm alter files, with rm removing them.

Command details can differ between GNU utilities, other implementations, distributions and shells. The GNU manual identifies itself as authoritative for the utilities it documents, not as a universal reference for every platform. Use the manual for your installed command when you need options or behavior beyond these basic examples.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.