If you are managing a Linux server for the first time, you are probably using a web-based control panel, such as cPanel/WHM. While a control panel may fill most of your basic needs as a system administrator, there are some tasks best left to the command line. On a remote Linux server, you can access the command line via SSH.
Some Basic Tips
- $ – this symbol at the command prompt means you are logged in as a normal user with limited privileges.
- # – indicates you are logged in as root and have full system privileges
- ~ – tells you that you are within the local user’s home directory. For example “user@locahost:~/webs” would refer to the “webs” directory in the user’s home directory tree.
- / – the highest (or root) directory in the file system. Every path, even separate partitions on your hard drive, will fall under “/”.
- Ctrl+C – cancels a command in progress
- Ctrl+Z – stop user interaction with a command without terminating it (returns you to the command prompt)
- Up Arrow key – used to browse through command history (Type history for a full list)
- ls – lists all files in the current directory
- rm – removes the specified file (i.e. rm filename.txt)
- cp – copies files from one destination to another
- cd – change directory. Examples:
cd subdirectory – changes to a sub directory within the current one
cd .. – moves you up one directory
cd / – moves you to the root filesystem directory