Hi, we made this post to help our client's with the basic commands that they need to know / learn when they purchase a VDS/VPS.
Basic Linux Commands
ls
- Lists the files and directories in the current directory.
cd [directory]
- Changes the current directory to the specified one.
pwd
- Displays the current working directory.
mkdir [directory]
- Creates a new directory with the specified name.
rm [file]
- Deletes the specified file. Use with caution!
cp [source] [destination]
- Copies a file or directory from the source to the destination.
mv [source] [destination]
- Moves or renames a file or directory.
touch [file]
- Creates a new empty file with the specified name.
cat [file]
- Displays the contents of a file.
nano [file]
or vi [file]
- Opens a file in a text editor for editing.
chmod [permissions] [file]
- Changes the permissions of a file or directory.
chown [user]:[group] [file]
- Changes the ownership of a file or directory.
find [path] -name [filename]
- Searches for files by name within a specified path.
grep [pattern] [file]
- Searches for a pattern within a file.
top
- Displays real-time system information, including processes and memory usage.
Additional Commands
ps
- Displays a list of currently running processes.
kill [PID]
- Terminates a process by its process ID (PID).
df -h
- Displays disk space usage in a human-readable format.
du -sh [directory]
- Shows the total size of a directory.
history
- Displays a list of previously executed commands.
clear
- Clears the terminal screen.
echo [text]
- Prints text to the terminal or writes it to a file.
man [command]
- Shows the manual for a specific command.
wget [URL]
- Downloads files from the web.
tar -czvf [archive.tar.gz] [directory]
- Compresses a directory into a .tar.gz
archive.
unzip [file.zip]
- Extracts files from a .zip
archive.
ssh [user]@[host]
- Connects to a remote server via SSH.
scp [file] [user]@[host]:[path]
- Securely copies files to a remote server.
crontab -e
- Edits the cron jobs for scheduling tasks.
alias [name]='[command]'
- Creates a shortcut for a command.