Great choice! Learning the Linux command line will give you much more control and flexibility with Ubuntu. Hereβs a structured overview of the most important commands youβll want to know as you get started:
-
pwdβ Show your current directory (print working directory). -
lsβ List files and folders in the current directory.- Options:
ls -l(detailed),ls -a(show hidden),ls -lh(human-readable sizes).
- Options:
-
cd <path>β Change directory (e.g.,cd /home/user/Documents). -
mkdir <name>β Create a new directory. -
rmdir <name>β Remove an empty directory. -
touch <file>β Create an empty file. -
cp <src> <dest>β Copy files or directories (-rfor directories). -
mv <src> <dest>β Move or rename files. -
rm <file>β Delete files (-rfor directories,-fto force).
cat <file>β Show file contents.less <file>β View file contents page by page.head <file>β Show the first 10 lines of a file.tail <file>β Show the last 10 lines of a file (tail -ffollows updates, useful for logs).nano <file>β Simple text editor.vim <file>β Advanced text editor (steeper learning curve).
whoamiβ Show current user.idβ Show user and group info.chmod <mode> <file>β Change file permissions (e.g.,chmod 755 script.sh).chown <user>:<group> <file>β Change file owner.sudo <command>β Run command as administrator.
apt updateβ Refresh package list.apt upgradeβ Upgrade installed packages.apt install <package>β Install a new package.apt remove <package>β Uninstall a package.apt search <keyword>β Search available packages.
uname -aβ Kernel and system details.df -hβ Show disk usage (human-readable).du -sh <dir>β Show size of a directory.free -hβ Show memory usage.toporhtopβ Show running processes.ps auxβ List all processes.uptimeβ Show how long the system has been running.whoβ Show logged-in users.
ping <host>β Test connectivity.ip aβ Show network interfaces and IPs.curl <url>β Fetch content from a URL.wget <url>β Download a file.ssh user@hostβ Connect to a remote server.
find <path> -name <file>β Search for files by name.grep <pattern> <file>β Search for text inside files.locate <name>β Find files (uses a prebuilt index, runupdatedbfirst).
historyβ Show previously used commands.clearβ Clear the terminal screen.aliasβ Create shortcuts (e.g.,alias ll='ls -lh').man <command>β Open manual/help for a command.
π Tip: Practice is key! Try exploring /home, /etc, and /var/log with these commands.
Would you like me to make you a cheat sheet PDF with all of these commands nicely formatted, so you can keep it handy while learning?