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
- Create a file:
touch file.txt
- View contents:
cat file.txt
- Copy and move:
cp file.txt backup.txt
mv file.txt newname.txt
- Remove:
rm file.txt
- Disk usage:
df -h
du -sh /var
Tips
- Use
man <command>to read the manual. historyshows past commands;!nreruns command number n.- Aliases in
~/.bashrcspeed up repetitive tasks.
Common issues
rmis permanent; there is no recycle bin by default.- Wildcards like
*can match more than intended; verify withlsfirst.