Command | Purpose |
---|---|
pwd |
Show current directory path |
ls |
List files and directories in the current directory |
ls -F |
List files and directories, marking directories with / |
ls -a |
Show all files, including hidden ones |
cd <directory> |
Change directory |
cd .. |
Move up one directory level |
cd |
Move to home directory |
Command | Purpose |
---|---|
mkdir <directory> |
Make a new directory |
rmdir <directory> |
Remove an empty directory |
touch <filename> |
Create a new empty file |
cp <src> <dest> |
Copy a file |
mv <src> <dest> |
Move or rename a file |
rm <filename> |
Remove (delete) a file |
Command | Purpose |
---|---|
cat <filename> |
View the entire contents of a file |
less <filename> |
View file page by page (scrollable) |
head <filename> |
View first 10 lines of a file |
tail <filename> |
View last 10 lines of a file |
Command | Purpose |
---|---|
nano <filename> |
Open file in Nano text editor |
nano notes.txt
Controls:
Ctrl + O
: SaveCtrl + X
: ExitCtrl + K
: CutCtrl + U
: PasteCommand | Purpose |
---|---|
grep "text" <filename> |
Search for text inside a file |
wc <filename> |
Count lines, words, characters in a file |
Symbol | Meaning |
---|---|
. |
Current directory |
.. |
Parent directory |
~ |
Home directory |
Command | Purpose |
---|---|
history |
Show command history |
clear |
Clear the terminal screen |
echo "text" |
Print text to the terminal |
man <command> |
Show manual page for a command |