How to use the Linux shell and basic commands

· Category: Linux

Short answer

The Linux shell interprets your commands. Learn basic utilities to manipulate files, inspect processes, and query the system.

Steps

  1. Create a file:
touch file.txt
  1. View contents:
cat file.txt
  1. Copy and move:
cp file.txt backup.txt
mv file.txt newname.txt
  1. Remove:
rm file.txt
  1. Disk usage:
df -h
du -sh /var

Tips

  • Use man <command> to read the manual.
  • history shows past commands; !n reruns command number n.
  • Aliases in ~/.bashrc speed up repetitive tasks.

Common issues

  • rm is permanent; there is no recycle bin by default.
  • Wildcards like * can match more than intended; verify with ls first.