pwd
Getting startedPrint the full path of your current working directory.
pwdSearch common Linux terminal commands, understand what they do, and adapt practical examples for your system.
find . -type f -name "*.log"grep -Rni "error" ./logsForever & Always presents Linux Command Atlas, a practical guide to Linux shell commands. Browse examples for files and directories, search, text processing, permissions, processes, system services, networking and archives. Use the command search to find tools such as ls, grep, find, chmod, systemctl, ssh and tar, then check your distribution’s manual before running them.
Useful commands, explained without the guesswork.
Print the full path of your current working directory.
pwdList files and folders. Add flags to show hidden files and details.
ls -lahMove to another directory. Use “cd -” to return to the previous one.
cd /var/logPrint the username associated with the current effective user ID.
whoamiShow user and group IDs for the current user or another account.
idClear the visible contents of the terminal screen.
clearShow commands recorded by your shell in the current history list.
history | tail -n 15Open the manual page for a command. Press q to leave the viewer.
man findCreate a directory. The -p flag also creates missing parent directories.
mkdir -p ./project/logsCreate an empty file, or update an existing file’s modification time.
touch notes.txtCopy files. Add -r when copying a directory and its contents.
cp -r ./assets ./backup/assetsMove or rename files and directories.
mv draft.txt notes.txtRemove files. This does not normally move them to a recoverable trash folder.
rm -i ./old-notes.txtCreate a link. Use -s to create a symbolic link.
ln -s /opt/app ./appDisplay detailed metadata about a file or directory.
stat ./report.csvIdentify a file’s type by examining its contents and metadata.
file ./download.binSearch a directory tree by name, type, age, and other conditions.
find . -type f -name "*.log"Search text for a pattern. Use -R for directories and -n to show line numbers.
grep -Rni "error" ./logsFind paths using a prebuilt filename database; results may need updating.
locate ssh_configShow which executable would run when you enter a command name.
which python3Print file contents to the terminal or join multiple files together.
cat ./config.iniRead long text one screen at a time. Search with / and quit with q.
less /var/log/syslogShow the first lines of a file; use -n to choose how many.
head -n 20 access.logShow the last lines of a file. Use -f to follow new lines as they arrive.
tail -f ./app.logCount lines, words, and bytes. Use -l for a line count only.
wc -l access.logSort lines of text. Add -n for numeric order or -r for reverse order.
sort -n scores.txtReport or remove adjacent repeated lines; sort first to group matches.
sort names.txt | uniq -cExtract selected fields or character ranges from each input line.
cut -d, -f1,3 users.csvTransform text streams; this example prints matching lines without editing files.
sed -n "/WARN/p" app.logProcess text by fields and patterns; fields are separated by whitespace by default.
awk '{print $1}' access.logShow a snapshot of processes. This format lists processes for all users.
ps auxView a live, interactive summary of processes and resource use.
topDisplay memory use. The -h flag chooses human-readable units.
free -hShow available and used disk space for mounted filesystems.
df -hEstimate directory space use. Here, list direct children in readable units.
du -sh ./*Print system information. The -a flag requests the available details.
uname -aShow how long the system has been running and its load averages.
uptimeInspect or manage systemd services. Service names vary by distribution.
systemctl status sshRead systemd journal entries. Use -u to filter by service unit.
journalctl -u ssh --since todayInspect or configure network interfaces, addresses, and routes.
ip address showSend diagnostic echo requests to test network reachability.
ping -c 4 example.comShow socket information. The flags below list listening TCP and UDP ports.
ss -tulnTransfer data to or from a URL; -I requests response headers only.
curl -I https://example.comRetrieve a file from a URL. Check the source before downloading or running it.
wget https://example.com/file.tar.gzConnect securely to a remote machine using its account and host name.
ssh user@server.exampleCopy files between hosts over SSH. Check both source and destination paths.
scp ./report.txt user@host:/tmp/Query DNS records and inspect the response returned by a DNS server.
dig example.comCreate or inspect tar archives. This example lists files without extracting them.
tar -tf backup.tar.gzCompress a file with gzip. By default, the input file is replaced by its compressed form.
gzip -k report.logCreate a ZIP archive. Add -r when including a directory tree.
zip -r site-backup.zip ./siteList or extract ZIP contents. Inspect untrusted archives before extraction.
unzip -l site-backup.zipCompress files using xz. The -k flag keeps the original file.
xz -k data.csvChange file permissions. This example grants the owner execute permission.
chmod u+x ./script.shChange file ownership. Use elevated privileges only when needed.
sudo chown user:group ./fileRun an approved command with elevated privileges. Check the command before confirming.
sudo systemctl status sshShow the groups to which a user account belongs.
groupsTry another keyword or clear your filters.
Commands can change or permanently remove data. Read each example, check the target path, and consult your system’s manual before running anything you do not understand.