- 01Getting Started
- 02What Is a Terminal?
- 03Checking Where You Are with pwd
- 04Checking Contents with ls
- 05Seeing Hidden Files Too with ls -la
- 06Moving Around with cd
- 07Creating a Folder with mkdir
- 08Creating a File with touch
- 09Viewing a File's Contents with cat
- 10Displaying and Writing Text with echo
- 11Searching Text with grep
- 12Copying and Moving with cp / mv
- 13Deleting with rm (Use Caution!)
- 14Checking Who You Are with whoami
- 15Changing File Permissions with chmod
- 16Finding Files with find
- 17Viewing Part of a File with head/tail
- 18Counting Lines & Characters with wc
- 19Viewing Running Processes with ps
- 20Ending a Process with kill
- 21Checking Free Disk Space with df
- 22Checking a Folder's Usage with du
- 23Sorting a File's Lines with sort
- 24Merging Duplicate Lines with uniq
- 25Extracting a Column with cut
- 26Viewing Command History with history
- 27Reading a Command's Manual with man
- 28Creating a Symbolic Link with ln -s
- 29Bundling Files with tar
- 30Replacing Text in a File with sed
- 31Finding a Command's Location with which
- 32Setting Environment Variables with export
- 33Checking Environment Variables with printenv
- 34Giving a Command a Nickname with alias
- 35Extracting a Column with awk
- 36Checking System State with top
- 37Making a Request to a URL with curl
- 38Checking a Server's Reachability with ping
- 39Connecting to a Remote Server with ssh
- 40Changing a File's Owner with chown
- 41Comparing Two Files with diff
- 42Checking the Current Date and Time with date
- 43Checking Your Computer's Name with hostname
- 44Replacing Characters with tr
- 45Displaying with Line Numbers Using nl
- 46Extracting Just the Filename with basename
- 47Extracting Just the Folder Part with dirname
- 48Generating a Sequence with seq
- 49Checking Your User Info with id
- 50Checking Memory Usage with free
- 51Checking Server Uptime with uptime
- 52Doing Simple Math with expr
- 53Listing Environment Variables with env
- 54Checking a File's Details with stat
- 55Repeating a String with yes
- 56Creating Nested Directories at Once with mkdir -p
- 57Clearing Command History with history -c
- 58Checking a Command's Type with type
- 59Reversing Text with rev
- 60Formatting Output with printf
- 61Making Usage Human-Readable with du -h
Repeating a String with yes
yes is for when "I want to output the same string repeatedly, to practice with pipes." yes repeatedly outputs the given string (or "y" if omitted), infinitely, until stopped.
Use it in the form yes string. Press Ctrl+C to stop it. Combining it with head to limit the line count is common.
Running yes practice fills the screen with the string "practice," endlessly. For learning purposes, limiting it with something like | head -5 is safer.
A common early mistake is running it with no line limit, flooding the terminal with a massive amount of output that's hard to work with. Always combine it with head while learning.
In real work, this is occasionally used in a script that wants to auto-answer every confirmation prompt with "y" (yes | command).
🧑💻 You can type this command into the Linux pseudo terminal to try it yourself (this page itself has no interactive terminal).
