Most of the interactions with the Managed Metal service are achieved through the terminal over SSH, or through VSCode, and to users new to Linux this can be quite a change from the way they might normally access computer systems. Thankfully, the system is largely self-describing.
The man command in Linux is used to view the manual pages (or "man pages") for various commands, system calls, library functions, and configuration files. These manual pages provide detailed documentation about the usage, options, and functionality of commands and programs available on the system.
To view the manual page for a specific command, you can use the following syntax:
$> man command_name
For example, to view the manual page for the ls command, you would run:
man ls
Man pages are organized into sections, and each section covers different types of documentation:
- User Commands: Commands available to users.
- System Calls: Functions provided by the kernel.
- Library Calls: Functions provided by programming libraries.
- Special Files: Files in
/dev. - File Formats and Conventions: Configuration files and formats.
- Games: Games and demonstrations.
- Miscellaneous: Macro packages and conventions.
- System Administration Commands: Commands for system administration.
You can specify a section number when using the man command to view a specific section. For example:
$> man 5 passwd
This command would show the man page for the passwd file format (section 5).
Many Linux commands and programs also provide a -h or --help option to display a brief summary of how to use the command, including available options and arguments. This is particularly useful for quickly understanding the command's functionality without needing to navigate through the full man page.
The output will typically include a brief description of the command, its syntax, and a list of options. This is often more concise than the information found in the man pages.
The following lists some of the most common commands you might use on a Linux system, and some of their options. For any of these listed below, further options can be found by supplying the -h or --help argument to the command.
Usage: ls [options] [directory]
Common Options:
-l: Long format (detailed information).-a: Show hidden files (those starting with a dot).-h: Human-readable file sizes.
Usage: cd [directory]
Common Usage:
cd ..: Move up one directory.cd ~: Move to the home directory.
Usage: pwd
Common Usage: Useful to know your current location in the filesystem.
Usage: cp [options] source destination
Common Options:
-r: Recursively copy directories.-i: Prompt before overwriting files.
Usage: mv [options] source destination
Common Options:
-i: Prompt before overwriting files.
Usage: rm [options] file
Common Options:
-r: Recursively remove directories and their contents.-i: Prompt before each removal.
Usage: mkdir [options] directory
Common Options:
-p: Create parent directories as needed.
Usage: rmdir directory
Common Usage: Deleting directories conditionally, as it only works if the directory is empty.
Usage: touch filename
Common Usage: Useful for creating new files quickly.
Usage: cat [options] file
Common Options:
-n: Number the output lines.
Usage: grep [options] pattern [file]
Common Options:
-i: Ignore case.-r: Recursively search directories.-v: Invert match (show lines that do not match).
Usage: find [path] [options] [expression]
Common Options:
-name: Search for files by name.-type: Search by file type (e.g., f for files, d for directories).
Usage: chmod [options] mode file
Common Usage: Use numeric or symbolic modes to set permissions.
Usage: chown [options] owner[:group] file
Common Usage: Useful for changing file ownership.
Usage: ps [options]
Common Options:
-e: Show all processes.-f: Full format listing.
Usage: htop
Common Usage: Use to monitor system performance and resource usage.
Usage: df [options]
Common Options:
-h: Human-readable format.
Usage: du
Common Options:
-h: Human-readable format.-s: Produce summaries rather than per-file listings